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

Version Description

Download this release

Release Info

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

Code changes from version 3.3.1 to 3.3.2

cmp-settings.php CHANGED
@@ -430,7 +430,33 @@ $overlay_button_url = get_option('niteoCS_overlay_text[button_url]', '');
430
 
431
  // create default social media if they do not exists
432
  if ( !get_option('niteoCS_socialmedia') ) {
433
- $social_icons = array('facebook', 'google-plus', 'twitter', 'instagram', 'skype', '500px', 'deviantart', 'behance', 'dribbble', 'pinterest', 'linkedin', 'tumblr', 'youtube', 'vimeo', 'flickr', 'soundcloud', 'vk','envelope-o', 'whatsapp', 'phone', 'telegram', 'xing', 'github', 'snapchat');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
  $i = 0;
435
  $socialmedia = array();
436
  foreach ( $social_icons as $social ) {
@@ -452,8 +478,6 @@ if ( !get_option('niteoCS_socialmedia') ) {
452
  $socialmedia = json_decode( $niteoCS_socialmedia, true );
453
  }
454
 
455
-
456
-
457
  //include theme defaults
458
  if (file_exists($this->cmp_theme_dir($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php')) {
459
  include ( $this->cmp_theme_dir($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php' );
@@ -499,9 +523,6 @@ if ( $niteoCS_banner_pattern == 'custom' && $niteoCS_banner_pattern_custom != ''
499
  // define patterns array
500
  $patterns = array('fabric', 'gray_sand', 'green_dust_scratch', 'mirrored_squares', 'noisy', 'photography', 'playstation', 'sakura', 'white_sand', 'white_texture');
501
 
502
-
503
-
504
-
505
  add_thickbox();
506
 
507
  ?>
@@ -598,151 +619,11 @@ add_thickbox();
598
 
599
  </div>
600
 
601
- <div class="table-wrapper general">
602
- <h3><?php _e('Available Themes', 'cmp-coming-soon-maintenance');?></h3>
603
- <table class="general theme-selector">
604
- <tr>
605
- <td class="theme-selector">
606
- <fieldset>
607
- <legend class="screen-reader-text">
608
- <span><?php _e('Free Themes', 'cmp-coming-soon-maintenance');?> </span>
609
- </legend>
610
- <?php
611
- // move active theme to beginning
612
- $key = array_search ( $this->cmp_selectedTheme(), $this->cmp_themes_available() );
613
-
614
- $themes = $this->cmp_themes_available();
615
-
616
- if ( $key ) {
617
- $active = $themes[$key];
618
- unset( $themes[$key] );
619
- array_unshift( $themes, $active );
620
- }
621
-
622
- // define what attribute we want from style.css header
623
- $headers = array('Version');
624
-
625
- foreach ( $themes as $theme_slug ) {
626
-
627
- $version = $this->cmp_theme_version( $theme_slug );
628
- $type = 'standard';
629
-
630
- // if premium get theme version
631
- if ( in_array( $theme_slug, $this->cmp_premium_themes_installed() ) ) {
632
- $type = 'premium';
633
- }
634
-
635
- // get thumbnail
636
- $thumbnail = plugins_url('/img/thumbnails/'. $theme_slug . '_thumbnail.jpg', __FILE__);
637
-
638
- if ( !file_exists( CMP_PLUGIN_DIR . '/img/thumbnails/'. $theme_slug . '_thumbnail.jpg' ) ) {
639
- $thumbnail = $this->cmp_themeURL( $themeslug ) . $theme_slug . '/img/thumbnail.jpg';
640
- } ?>
641
-
642
- <div class="theme-wrapper<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' active'; } ?>" data-security="<?php echo esc_attr($ajax_nonce);?>" data-type="<?php echo esc_attr($type);?>" data-purchased="1" data-slug="<?php echo esc_attr($theme_slug);?>" data-version="<?php echo esc_html($version);?>" data-remote_url="<?php echo esc_url(CMP_UPDATE_URL);?>">
643
- <div class="thumbnail-holder theme-details" style="background-image:url('<?php echo esc_url( $thumbnail ); ?>')"></div>
644
-
645
- <div class="buttons-wrapper">
646
-
647
- <div class="button theme-select hide<?php echo ( $this->cmp_selectedTheme() == $theme_slug ) ? ' activated' : '';?>">
648
- <input type="radio" name="niteoCS_select_theme" value="<?php echo esc_attr($theme_slug);?>" id="displayOption-<?php echo esc_attr($theme_slug);?>"<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' checked="checked"'; } ?>>
649
- <span class="input-label"><?php if ( $this->cmp_selectedTheme() == $theme_slug ) { _e('Active', 'cmp-coming-soon-maintenance'); } else { _e('Select', 'cmp-coming-soon-maintenance'); }?></span>
650
- </div>
651
-
652
- <a href="<?php echo esc_url( get_site_url().'?cmp_preview=true&cmp_theme='.$theme_slug );?>" target="_blank" class="theme-preview button hide"><i class="fa fa-external-link" aria-hidden="true"></i><?php _e('PREVIEW', 'cmp-coming-soon-maintenance');?></a>
653
-
654
- <button type="button" class="theme-details button hide"><i class="fa fa-eye" aria-hidden="true"></i><?php _e('DETAILS', 'cmp-coming-soon-maintenance');?></button>
655
- </div>
656
-
657
- <div class="theme-inputs">
658
-
659
- <span class="theme-title"><?php echo ucwords(esc_html(str_replace('_', ' ', $theme_slug)));?></span>
660
-
661
- <?php echo ( $this->cmp_selectedTheme() == $theme_slug ) ? ' <span class="italic">'.__('Active', 'cmp-coming-soon-maintenance').'</span>' : '';?>
662
-
663
- <span class="theme-version">ver. <?php echo esc_html( $version );?></span>
664
-
665
- </div> <!-- theme-inputs -->
666
- </div> <!-- theme-wrapper -->
667
-
668
- <?php
669
- } ?>
670
- </fieldset>
671
- </td>
672
- </tr>
673
-
674
- <?php echo $this->render_settings->submit(); ?>
675
-
676
- </tbody>
677
- </table>
678
- <div class="theme-overlay cmp"></div>
679
- </div>
680
-
681
- <?php
682
- if ( !empty( $downloadable_themes ) ) { ?>
683
-
684
- <div class="table-wrapper general">
685
- <h3><?php _e('Download more CMP Themes', 'cmp-coming-soon-maintenance');?></h3>
686
- <table class="general theme-selector">
687
- <tbody>
688
- <tr>
689
- <td class="theme-selector">
690
- <fieldset>
691
- <legend class="screen-reader-text">
692
- <span><?php _e('Premium Themes', 'cmp-coming-soon-maintenance');?> </span>
693
- </legend>
694
- <?php
695
-
696
- // build previews for downloadable themes
697
- foreach ( $downloadable_themes as $premium_theme ) {
698
- $theme_slug = $premium_theme['name'];
699
-
700
- switch ( $theme_slug ) {
701
- case 'pluto':
702
- $background = '4';
703
- break;
704
- default:
705
- $background = '1';
706
- break;
707
- }
708
-
709
- $thumbnail = plugins_url('/img/thumbnails/'. $theme_slug . '_thumbnail.jpg', __FILE__); ?>
710
-
711
- <div class="theme-wrapper premium" data-security="<?php echo esc_attr($ajax_nonce);?>" data-slug="<?php echo esc_attr($theme_slug);?>" data-type="premium">
712
-
713
- <div class="thumbnail-holder theme-details" style="background-image:url('<?php echo esc_url( $thumbnail ); ?>')"></div>
714
-
715
- <div class="buttons-wrapper">
716
-
717
- <a href="<?php echo esc_url ( $premium_theme['url'] );?>" target="_blank" class="theme-purchase button hide"><i class="fa fa-download" aria-hidden="true"></i><?php echo sprintf(__('Get %s', 'cmp-coming-soon-maintenance'), ucwords( esc_html( str_replace('_', ' ', $theme_slug) ) ));?></a>
718
-
719
- <a href="<?php echo 'http://cmp.niteothemes.com/?cmp_preview=true&selector=true&theme='.$theme_slug.'&background='.$background.'&utm_source=cmp&utm_medium=referral&utm_campaign='.$theme_slug.'';?>" target="_blank" class="theme-preview button hide"><i class="fa fa-external-link" aria-hidden="true"></i><?php _e('PREVIEW', 'cmp-coming-soon-maintenance');?></a>
720
-
721
- <button type="button" class="theme-details button hide"><i class="fa fa-eye" aria-hidden="true"></i><?php _e('DETAILS', 'cmp-coming-soon-maintenance');?></button>
722
-
723
- </div>
724
-
725
- <div class="theme-inputs">
726
- <span class="theme-title"><?php echo ucwords( esc_html( str_replace('_', ' ', $theme_slug) ) );?></span>
727
- <?php echo ( $premium_theme['price'] == '0' ) ? '<span class="theme-version"> ('. __('freebie') .')</span>' : ''; ?>
728
- </div>
729
- </div>
730
-
731
- <?php
732
- } ?>
733
- </fieldset>
734
- </td>
735
- </tr>
736
-
737
- <?php echo $this->render_settings->submit(); ?>
738
-
739
- </tbody>
740
- </table>
741
- </div>
742
-
743
  <?php
744
- } // if !empty($premium_themes
745
-
 
 
746
 
747
  // get logo settings
748
  if ( isset( $theme_supports['logo'] ) && $theme_supports['logo'] ) {
@@ -775,12 +656,8 @@ add_thickbox();
775
  <th><?php _e('Message', 'cmp-coming-soon-maintenance');?></th>
776
  <td>
777
  <?php wp_editor( $this->niteo_sanitize_html( $niteoCS_body ), 'niteoCS_body', $settings = array('textarea_name'=>'niteoCS_body', 'editor_height'=>'300') ); ?>
778
-
779
  <span class="cmp-hint">* <?php _e('WordPress embeds are fully supported. You can also add any custom HTML. No 3rd party shortcodes are currently supported.', 'cmp-coming-soon-maintenance');?></span>
780
  </td>
781
-
782
-
783
-
784
  </tr>
785
 
786
  <?php echo $this->render_settings->submit(); ?>
@@ -806,7 +683,6 @@ add_thickbox();
806
  if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-slider-disabled.php' ) ) {
807
  require ( dirname(__FILE__) . '/inc/settings/settings-slider-disabled.php' );
808
  }
809
-
810
  }
811
 
812
  // include custom theme content settings
@@ -846,141 +722,13 @@ add_thickbox();
846
  require (dirname(__FILE__) . '/inc/settings/settings-contact_form.php');
847
  }
848
 
849
- } ?>
850
-
851
- <div class="table-wrapper content" id="social-section">
852
- <h3><?php _e('Social Media', 'cmp-coming-soon-maintenance');?></h3>
853
- <table class="content">
854
- <tbody>
855
- <tr>
856
- <th><?php _e('Social Section Title', 'cmp-coming-soon-maintenance');?></th>
857
- <td>
858
- <fieldset>
859
- <input type="text" name="niteoCS_soc_title" id="niteoCS_soc_title" value="<?php echo esc_attr( $niteoCS_soc_title); ?>" class="regular-text code">
860
- </fieldset>
861
- </td>
862
- </tr>
863
-
864
- <tr>
865
- <th><?php _e('Social Media Icons', 'cmp-coming-soon-maintenance');?></th>
866
- <td>
867
- <p class="social-description"><?php _e('Click on Social Icons below to enable Social Media settings.', 'cmp-coming-soon-maintenance');?></p>
868
- <ul class="social-media">
869
- <?php
870
- uasort( $socialmedia, array($this,'sort_social') );
871
-
872
- // render icons
873
- foreach ( $socialmedia as $social ) {
874
-
875
- // push soundcloud if missing - pre version 1.13
876
-
877
- $social_active = '';
878
-
879
- if ($social['hidden'] == '0') {
880
- $social_active = 'active';
881
- }
882
-
883
- switch ($social['name']) {
884
- case 'envelope-o':
885
- $title = __('Email Address', 'cmp-coming-soon-maintenance');
886
- break;
887
- case 'phone':
888
- $title = __('Phone Number', 'cmp-coming-soon-maintenance');
889
- break;
890
- case 'whatsapp':
891
- $title = __('Phone Number', 'cmp-coming-soon-maintenance');
892
- break;
893
- default:
894
- $title = ucfirst( esc_attr($social['name'] ) );
895
- break;
896
- } ?>
897
-
898
- <li>
899
- <i class="fa fa-<?php echo esc_attr($social['name']) . ' '. $social_active;?>" title="<?php echo esc_attr($title);?>" data-name="<?php echo esc_attr($social['name']);?>" aria-hidden="true"></i>
900
- </li>
901
- <?php
902
- } ?>
903
- </ul>
904
-
905
- <ul class="social-inputs">
906
- <li class="social-labels"><span class="label"><?php _e('Position', 'cmp-coming-soon-maintenance');?></span><span class="label"><?php _e('Active', 'cmp-coming-soon-maintenance');?></span><span class="label"><?php _e('Website URL', 'cmp-coming-soon-maintenance');?></span></li>
907
- <?php
908
- foreach ( $socialmedia as $social ) {
909
-
910
- ( $social['hidden'] == '0' ) ? $active = 'active ' : $active = '';
911
-
912
- ( $social['active'] == '0' ) ? $disabled = ' disabled' : $disabled = '';
913
-
914
- $url = '';
915
-
916
- switch ( $social['name'] ) {
917
- case 'envelope-o':
918
- $title = __('Email Address', 'cmp-coming-soon-maintenance');
919
- $url = 'email@example.com';
920
- break;
921
- case 'google-plus':
922
- $title = ucfirst( $social['name'] );
923
- $url = 'https://plus.google.com/profile';
924
- break;
925
- case 'behance':
926
- $title = ucfirst( $social['name'] );
927
- $url = 'https://behance.net/profile';
928
- break;
929
- case 'phone':
930
- $title = __('Phone Number', 'cmp-coming-soon-maintenance');
931
- $url = '+123456789';
932
- break;
933
- case 'whatsapp':
934
- $title = __('Whatsapp Phone Number', 'cmp-coming-soon-maintenance');
935
- $url = '+123456789';
936
- break;
937
- case 'telegram':
938
- $title = ucfirst( $social['name'] );
939
- $url = 'https://telegram.me/username';
940
- break;
941
- default:
942
- $title = ucfirst( $social['name'] );
943
- $url = 'https://'.$social['name'].'.com/profile';
944
- break;
945
- }
946
-
947
-
948
- // if no URL set, change it to default profile
949
- if ( $social['url'] && $social['url'] !== '' ) {
950
- $url = $social['url'];
951
- } ?>
952
-
953
- <li class="<?php echo esc_attr( $active . $social['name'] );?>">
954
- <p><i class="fa fa-sort" aria-hidden="true"></i>
955
- <label for="niteoCS_<?php echo esc_attr( $social['name'] );?>" class="<?php echo esc_attr( $social['name'] );?>"><?php echo esc_html( $title );?></label>
956
- <input type="text" id="niteoCS_<?php echo esc_attr( $social['name'] );?>" value="<?php echo esc_attr( $url );?>" class="regular-text code <?php echo esc_attr( $social['name'] );?>" data-name="<?php echo esc_attr( $social['name'] );?>"<?php echo $disabled;?>/>
957
- <input type="checkbox" name="niteoCS_<?php echo esc_attr( $social['name'] );?>_checkbox" id="niteoCS_<?php echo esc_attr( $social['name'] );?>_checkbox" class="<?php echo esc_attr( $social['name'] );?>" data-name="<?php echo esc_attr( $social['name'] );?>"<?php checked( '1', $social['active'] ); ?>/>
958
- </p>
959
- </li>
960
- <?php
961
- } ?>
962
-
963
- </ul>
964
-
965
- <fieldset>
966
- <input type="hidden" name="niteoCS_socialmedia" id="niteoCS_socialmedia" value="<?php echo esc_attr( $niteoCS_socialmedia ); ?>" class="regular-text code active">
967
- </fieldset>
968
- </td>
969
- </tr>
970
-
971
- <?php
972
-
973
- // include social special settings
974
- if (file_exists($this->cmp_theme_dir($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-social_settings.php')) {
975
- include ( $this->cmp_theme_dir($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-social_settings.php' );
976
- }
977
- ?>
978
- <?php echo $this->render_settings->submit(); ?>
979
 
980
- </tbody>
981
- </table>
982
- </div>
983
- <?php
984
  // get footer
985
  if ( isset( $theme_supports['footer'] ) && $theme_supports['footer'] ) {
986
  if ( file_exists( dirname(__FILE__) . '/inc/settings/settings-footer.php') ) {
@@ -994,7 +742,6 @@ add_thickbox();
994
 
995
  }
996
 
997
-
998
  // special effects for premium themes
999
  if ( in_array( $this->cmp_selectedTheme(), $this->cmp_premium_themes_installed() ) || ( isset( $theme_supports['special_effects'] ) && $theme_supports['special_effects'] ) ) {
1000
 
@@ -1010,133 +757,17 @@ add_thickbox();
1010
  }
1011
  }
1012
 
1013
-
1014
-
1015
  // include theme related settings
1016
  if ( file_exists( $this->cmp_theme_dir( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-settings.php' ) ) {
1017
  require ( $this->cmp_theme_dir( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-settings.php' );
1018
- } ?>
1019
-
1020
- <div class="table-wrapper theme-setup font-selector">
1021
- <h3><?php _e('Customize Fonts', 'cmp-coming-soon-maintenance');?></h3>
1022
- <table class="theme-setup">
1023
- <tbody>
1024
- <tr>
1025
- <th><?php _e('Headings Font', 'cmp-coming-soon-maintenance');?></th>
1026
- <td>
1027
- <fieldset>
1028
- <label for="niteoCS_font_headings_<?php echo esc_attr( $themeslug );?>"><?php _e('Font Family from ', 'cmp-coming-soon-maintenance');?><a href="https://fonts.google.com" target="_blank"><?php _e('Google Fonts', 'cmp-coming-soon-maintenance');?></a></label><br>
1029
- <select id="niteoCS_font_headings_<?php echo esc_attr( $themeslug );?>" class="headings-google-font" name="niteoCS_font_headings_<?php echo esc_attr( $themeslug );?>">
1030
- <option value="<?php echo esc_attr( $heading_font['family'] ); ?>" selected="selected"><?php echo esc_html( $heading_font['family'] ); ?></option>
1031
- </select>
1032
- </fieldset>
1033
-
1034
- <fieldset>
1035
- <label for="niteoCS_font_headings_variant_<?php echo esc_attr( $themeslug );?>"><?php _e('Variant', 'cmp-coming-soon-maintenance');?></label><br>
1036
- <select id="niteoCS_font_headings_variant_<?php echo esc_attr( $themeslug );?>" class="headings-google-font-variant" name="niteoCS_font_headings_variant_<?php echo esc_attr( $themeslug );?>">
1037
- <option value="<?php echo esc_attr( $heading_font['variant'] ); ?>" selected="selected"><?php echo esc_html( $this->cmp_google_variant_title( $heading_font['variant'] ) ); ?></option>
1038
- </select>
1039
- </fieldset>
1040
-
1041
- <?php
1042
- if ( $this->cmp_selectedTheme() !== 'mercury' ) { ?>
1043
-
1044
- <fieldset>
1045
- <label for="niteoCS_font_headings_size_<?php echo esc_attr( $themeslug );?>"><?php _e('Font Size', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $heading_font['size'] ); ?></span>px</label><br>
1046
- <input type="range" id="niteoCS_font_headings_size_<?php echo esc_attr( $themeslug );?>" name="niteoCS_font_headings_size_<?php echo esc_attr( $themeslug );?>" min="10" max="75" step="1" value="<?php echo esc_attr( $heading_font['size'] ); ?>" data-css="font-size" data-type="heading" />
1047
- </fieldset>
1048
- <?php } ?>
1049
-
1050
- <fieldset>
1051
- <label for="niteoCS_font_headings_spacing_<?php echo esc_attr( $themeslug );?>"><?php _e('Letter Spacing', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $heading_font['spacing'] ); ?></span>px</label><br>
1052
- <input type="range" id="niteoCS_font_headings_spacing_<?php echo esc_attr( $themeslug );?>" name="niteoCS_font_headings_spacing_<?php echo esc_attr( $themeslug );?>" min="0" max="10" step="0.5" value="<?php echo esc_attr( $heading_font['spacing'] ); ?>" data-css="letter-spacing" data-type="heading" />
1053
- </fieldset>
1054
-
1055
- <?php
1056
- // include theme animation settings
1057
- if ( in_array( $this->cmp_selectedTheme(), $this->cmp_font_animation_themes() ) ) { ?>
1058
-
1059
- <fieldset>
1060
- <label for="niteoCS_heading_animation_<?php echo esc_attr( $themeslug );?>"><?php _e('Animation', 'cmp-coming-soon-maintenance');?></label><br>
1061
- <select id="niteoCS_heading_animation_<?php echo esc_attr( $themeslug );?>" name="niteoCS_heading_animation_<?php echo esc_attr( $themeslug );?>" class="heading-animation">
1062
- <option value="none" <?php if ( $niteoCS_heading_animation == 'none' ) { echo ' selected="selected"'; } ?>><?php _e('No animation', 'cmp-coming-soon-maintenance');?></option>
1063
- <option value="fadeInDown" <?php if ( $niteoCS_heading_animation == 'fadeInDown' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Down', 'cmp-coming-soon-maintenance');?></option>
1064
- <option value="fadeInUp" <?php if ( $niteoCS_heading_animation == 'fadeInUp' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Up', 'cmp-coming-soon-maintenance');?></option>
1065
- <option value="fadeInLeft" <?php if ( $niteoCS_heading_animation == 'fadeInLeft' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Left', 'cmp-coming-soon-maintenance');?></option>
1066
- <option value="fadeInRight" <?php if ( $niteoCS_heading_animation == 'fadeInRight' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Right', 'cmp-coming-soon-maintenance');?></option>
1067
- </select><br>
1068
- </fieldset>
1069
- <?php
1070
- } ?>
1071
-
1072
- </td>
1073
- </tr>
1074
-
1075
- <tr>
1076
- <th><?php _e('Content Font', 'cmp-coming-soon-maintenance');?></th>
1077
- <td>
1078
-
1079
- <fieldset>
1080
- <label for="niteoCS_font_content_<?php echo esc_attr( $themeslug );?>"><?php _e('Select Font Family from ', 'cmp-coming-soon-maintenance');?><a href="https://fonts.google.com" target="_blank">Google Fonts</a></label><br>
1081
- <select id="niteoCS_font_content_<?php echo esc_attr( $themeslug );?>" class="content-google-font" name="niteoCS_font_content_<?php echo esc_attr( $themeslug );?>">
1082
- <option value="<?php echo esc_attr( $content_font['family'] ); ?>" selected="selected"><?php echo esc_html( $content_font['family'] ); ?></option>
1083
- </select>
1084
- </fieldset>
1085
-
1086
- <fieldset>
1087
- <label for="niteoCS_font_content_variant_<?php echo esc_attr( $themeslug );?>"><?php _e('Variant', 'cmp-coming-soon-maintenance');?></label><br>
1088
- <select id="niteoCS_font_content_variant_<?php echo esc_attr( $themeslug );?>" class="content-google-font-variant" name ="niteoCS_font_content_variant_<?php echo esc_attr( $themeslug );?>">
1089
- <option value="<?php echo esc_attr( $content_font['variant'] ); ?>" selected="selected"><?php echo esc_html( $this->cmp_google_variant_title( $content_font['variant'] ) ); ?></option>
1090
- </select>
1091
- </fieldset>
1092
-
1093
- <fieldset>
1094
- <label for="niteoCS_font_content_size_<?php echo esc_attr( $themeslug );?>"><?php _e('Font Size', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $content_font['size'] ); ?></span>px</label><br>
1095
- <input id="niteoCS_font_content_size_<?php echo esc_attr( $themeslug );?>" type="range" name="niteoCS_font_content_size_<?php echo esc_attr( $themeslug );?>" min="10" max="50" step="1" value="<?php echo esc_attr( $content_font['size'] ); ?>" data-css="font-size" data-type="content" />
1096
- </fieldset>
1097
-
1098
- <fieldset>
1099
- <label for="niteoCS_font_content_spacing_<?php echo esc_attr( $themeslug );?>"><?php _e('Letter Spacing', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $content_font['spacing'] ); ?></span>px</label><br>
1100
- <input id="niteoCS_font_content_spacing_<?php echo esc_attr( $themeslug );?>" type="range" name="niteoCS_font_content_spacing_<?php echo esc_attr( $themeslug );?>" min="0" max="10" step="0.5" value="<?php echo esc_attr( $content_font['spacing'] ); ?>" data-css="letter-spacing" data-type="content" />
1101
- </fieldset>
1102
-
1103
- <fieldset>
1104
- <label for="niteoCS_font_content_lineheight_<?php echo esc_attr( $themeslug );?>"><?php _e('Line Height', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $content_font['line-height'] ); ?></span></label><br>
1105
- <input id="niteoCS_font_content_lineheight_<?php echo esc_attr( $themeslug );?>" type="range" name="niteoCS_font_content_lineheight_<?php echo esc_attr( $themeslug );?>" min="1.3" max="3.0" step="0.1" value="<?php echo esc_attr( $content_font['line-height'] ); ?>" data-css="line-height" data-type="content" />
1106
- </fieldset>
1107
- <?php
1108
- // include theme animation settings
1109
- if ( in_array( $this->cmp_selectedTheme(), $this->cmp_font_animation_themes() ) ) { ?>
1110
-
1111
- <fieldset>
1112
- <label for="niteoCS_content_animation_<?php echo esc_attr( $themeslug );?>"><?php _e('Select Animation', 'cmp-coming-soon-maintenance');?></label><br>
1113
- <select id="niteoCS_content_animation_<?php echo esc_attr( $themeslug );?>" name="niteoCS_content_animation_<?php echo esc_attr( $themeslug );?>" class="content-animation">
1114
- <option value="none" <?php if ( $niteoCS_content_animation == 'none' ) { echo ' selected="selected"'; } ?>><?php _e('No animation', 'cmp-coming-soon-maintenance');?></option>
1115
- <option value="fadeInDown" <?php if ( $niteoCS_content_animation == 'fadeInDown' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Down', 'cmp-coming-soon-maintenance');?></option>
1116
- <option value="fadeInUp" <?php if ( $niteoCS_content_animation == 'fadeInUp' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Up', 'cmp-coming-soon-maintenance');?></option>
1117
- <option value="fadeInLeft" <?php if ( $niteoCS_content_animation == 'fadeInLeft' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Left', 'cmp-coming-soon-maintenance');?></option>
1118
- <option value="fadeInRight" <?php if ( $niteoCS_content_animation == 'fadeInRight' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Right', 'cmp-coming-soon-maintenance');?></option>
1119
- </select><br>
1120
- </fieldset>
1121
- <?php
1122
- } ?>
1123
-
1124
- <p style="margin-bottom:0"><?php _e('Fonts preview', 'cmp-coming-soon-maintenance');?></p>
1125
- <div id="font-example-wrapper">
1126
- <h3 id="heading-example" class="animated <?php echo esc_attr($niteoCS_heading_animation);?>" style="font-size:<?php echo esc_attr( $heading_font['size'] );?>px;letter-spacing:<?php echo esc_attr( $heading_font['spacing'] );?>px">Hello, I am your Headings font!</h3>
1127
- <p id="content-example" class="animated <?php echo esc_attr($niteoCS_content_animation);?>" style="font-size:<?php echo esc_attr( $content_font['size'] );?>px;letter-spacing:<?php echo esc_attr( $content_font['spacing'] );?>px;line-height:<?php echo esc_attr( $content_font['line-height'] );?>">And this is a long paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
1128
- </div>
1129
-
1130
- </td>
1131
-
1132
- </tr>
1133
-
1134
- <?php echo $this->render_settings->submit(); ?>
1135
-
1136
- </tbody>
1137
- </table>
1138
-
1139
- </div>
1140
 
1141
  <div class="table-wrapper seo">
1142
  <h3><?php _e('SEO Settings', 'cmp-coming-soon-maintenance');?></h3>
430
 
431
  // create default social media if they do not exists
432
  if ( !get_option('niteoCS_socialmedia') ) {
433
+ $social_icons = array(
434
+ 'facebook',
435
+ 'google-plus',
436
+ 'twitter',
437
+ 'instagram',
438
+ 'skype',
439
+ '500px',
440
+ 'deviantart',
441
+ 'behance',
442
+ 'dribbble',
443
+ 'pinterest',
444
+ 'linkedin',
445
+ 'tumblr',
446
+ 'youtube',
447
+ 'vimeo',
448
+ 'flickr',
449
+ 'soundcloud',
450
+ 'vk',
451
+ 'envelope-o',
452
+ 'whatsapp',
453
+ 'phone',
454
+ 'telegram',
455
+ 'xing',
456
+ 'github',
457
+ 'snapchat',
458
+ 'spotify'
459
+ );
460
  $i = 0;
461
  $socialmedia = array();
462
  foreach ( $social_icons as $social ) {
478
  $socialmedia = json_decode( $niteoCS_socialmedia, true );
479
  }
480
 
 
 
481
  //include theme defaults
482
  if (file_exists($this->cmp_theme_dir($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php')) {
483
  include ( $this->cmp_theme_dir($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php' );
523
  // define patterns array
524
  $patterns = array('fabric', 'gray_sand', 'green_dust_scratch', 'mirrored_squares', 'noisy', 'photography', 'playstation', 'sakura', 'white_sand', 'white_texture');
525
 
 
 
 
526
  add_thickbox();
527
 
528
  ?>
619
 
620
  </div>
621
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
  <?php
623
+ // add theme selector settings
624
+ if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-theme-selector.php' ) ) {
625
+ require ( dirname(__FILE__) . '/inc/settings/settings-theme-selector.php' );
626
+ }
627
 
628
  // get logo settings
629
  if ( isset( $theme_supports['logo'] ) && $theme_supports['logo'] ) {
656
  <th><?php _e('Message', 'cmp-coming-soon-maintenance');?></th>
657
  <td>
658
  <?php wp_editor( $this->niteo_sanitize_html( $niteoCS_body ), 'niteoCS_body', $settings = array('textarea_name'=>'niteoCS_body', 'editor_height'=>'300') ); ?>
 
659
  <span class="cmp-hint">* <?php _e('WordPress embeds are fully supported. You can also add any custom HTML. No 3rd party shortcodes are currently supported.', 'cmp-coming-soon-maintenance');?></span>
660
  </td>
 
 
 
661
  </tr>
662
 
663
  <?php echo $this->render_settings->submit(); ?>
683
  if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-slider-disabled.php' ) ) {
684
  require ( dirname(__FILE__) . '/inc/settings/settings-slider-disabled.php' );
685
  }
 
686
  }
687
 
688
  // include custom theme content settings
722
  require (dirname(__FILE__) . '/inc/settings/settings-contact_form.php');
723
  }
724
 
725
+ }
726
+
727
+ // get social media settings
728
+ if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-social-media.php' ) ) {
729
+ require_once ( dirname(__FILE__) . '/inc/settings/settings-social-media.php' );
730
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
731
 
 
 
 
 
732
  // get footer
733
  if ( isset( $theme_supports['footer'] ) && $theme_supports['footer'] ) {
734
  if ( file_exists( dirname(__FILE__) . '/inc/settings/settings-footer.php') ) {
742
 
743
  }
744
 
 
745
  // special effects for premium themes
746
  if ( in_array( $this->cmp_selectedTheme(), $this->cmp_premium_themes_installed() ) || ( isset( $theme_supports['special_effects'] ) && $theme_supports['special_effects'] ) ) {
747
 
757
  }
758
  }
759
 
 
 
760
  // include theme related settings
761
  if ( file_exists( $this->cmp_theme_dir( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-settings.php' ) ) {
762
  require ( $this->cmp_theme_dir( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-settings.php' );
763
+ }
764
+
765
+ // font selector settings
766
+ if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-font-selector.php' ) ) {
767
+ require ( dirname(__FILE__) . '/inc/settings/settings-font-selector.php' );
768
+ }
769
+
770
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
771
 
772
  <div class="table-wrapper seo">
773
  <h3><?php _e('SEO Settings', 'cmp-coming-soon-maintenance');?></h3>
cmp-sidebar.php CHANGED
@@ -12,19 +12,18 @@
12
 
13
  <a href="https://niteothemes.com" target="_blank"><img src="<?php echo plugins_url('/img/niteo.png', __FILE__);?>" alt="Niteo Logo" class="niteo-logo"></a>
14
  <p style="margin-top:0">
15
- <img src="<?php echo plugins_url('/img/alex.jpg', __FILE__);?>" alt="Alex, NiteoThemes">
16
- <img src="<?php echo plugins_url('/img/paul.jpg', __FILE__);?>" alt="Paul, NiteoThemes">
17
  </p>
18
 
19
  <p><?php echo sprintf(__('If you really love our CMP plugin you can also donate few bucks by clicking Donate button below.', 'cmp-coming-soon-maintenance'), '<i class="fa fa-usd" aria-hidden="true"></i><i class="fa fa-usd" aria-hidden="true"></i><i class="fa fa-usd" aria-hidden="true"></i>');?> <i class="fa fa-smile-o" aria-hidden="true"></i>
20
  </p>
21
 
22
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
23
- <input type="hidden" name="cmd" value="_s-xclick">
24
- <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHLwYJKoZIhvcNAQcEoIIHIDCCBxwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBJBQ2LnaehhVpQYn5qVhtwXrweyURxj+cT2BsnPUN4RZn/UC7ftqhv6B733Cjh5J2xrEF0MOu7mFxywWPZEpiStKwXEyos6eIx9SRqeiaM3bpjjyPqDRjWuhrXaA2eHb7nRxEv7C/4HjiPaFuyp5RFpT1R0yINRFqVVuDubtYQtDELMAkGBSsOAwIaBQAwgawGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIY1CTgb1/WqKAgYiwcmBIHYF08XkEezhgYklpp5d2J5wi6cOlEJsmxW4jVisb7CieTsadjEDiiLx4X9/IGp7IzRx1K+rx/dh9bpcJbz5NoB3oikfTqpdzqDAh8L0CW5AP0To368X2uDN40XElz4wDiwBXYAAtjsy3kVRH+/TrRIhWaezVUNqO7JmQ9hqxlOOjoMNyoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcwNTIzMTQzOTU0WjAjBgkqhkiG9w0BCQQxFgQUt08IwV3KFygWn0gNImPQ1mMrjAAwDQYJKoZIhvcNAQEBBQAEgYCISWoorrWsDcVzFPdWvmWNgGKcjW/PA4o6J/IYtUU+uMqD5Hg3s5FJO9pNzeGg4VFLB3hGJ5YJJ868qb/3/T2tIcED7CbGMqk/OsedUb2dyucYTCiBYViOOLPu/cxjdXjCLrB7UNTssqd4+3RvW4gzRSMThv98Lh/CA/BxHRZ45g==-----END PKCS7-----
25
- ">
26
- <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
27
- <!-- <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> -->
28
  </form>
29
  </div>
30
 
12
 
13
  <a href="https://niteothemes.com" target="_blank"><img src="<?php echo plugins_url('/img/niteo.png', __FILE__);?>" alt="Niteo Logo" class="niteo-logo"></a>
14
  <p style="margin-top:0">
15
+ <img src="<?php echo plugins_url('/img/alex.jpg', __FILE__);?>" alt="Alex, NiteoThemes">
16
+ <img src="<?php echo plugins_url('/img/paul.jpg', __FILE__);?>" alt="Paul, NiteoThemes">
17
  </p>
18
 
19
  <p><?php echo sprintf(__('If you really love our CMP plugin you can also donate few bucks by clicking Donate button below.', 'cmp-coming-soon-maintenance'), '<i class="fa fa-usd" aria-hidden="true"></i><i class="fa fa-usd" aria-hidden="true"></i><i class="fa fa-usd" aria-hidden="true"></i>');?> <i class="fa fa-smile-o" aria-hidden="true"></i>
20
  </p>
21
 
22
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
23
+ <input type="hidden" name="cmd" value="_s-xclick">
24
+ <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHLwYJKoZIhvcNAQcEoIIHIDCCBxwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBJBQ2LnaehhVpQYn5qVhtwXrweyURxj+cT2BsnPUN4RZn/UC7ftqhv6B733Cjh5J2xrEF0MOu7mFxywWPZEpiStKwXEyos6eIx9SRqeiaM3bpjjyPqDRjWuhrXaA2eHb7nRxEv7C/4HjiPaFuyp5RFpT1R0yINRFqVVuDubtYQtDELMAkGBSsOAwIaBQAwgawGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIY1CTgb1/WqKAgYiwcmBIHYF08XkEezhgYklpp5d2J5wi6cOlEJsmxW4jVisb7CieTsadjEDiiLx4X9/IGp7IzRx1K+rx/dh9bpcJbz5NoB3oikfTqpdzqDAh8L0CW5AP0To368X2uDN40XElz4wDiwBXYAAtjsy3kVRH+/TrRIhWaezVUNqO7JmQ9hqxlOOjoMNyoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcwNTIzMTQzOTU0WjAjBgkqhkiG9w0BCQQxFgQUt08IwV3KFygWn0gNImPQ1mMrjAAwDQYJKoZIhvcNAQEBBQAEgYCISWoorrWsDcVzFPdWvmWNgGKcjW/PA4o6J/IYtUU+uMqD5Hg3s5FJO9pNzeGg4VFLB3hGJ5YJJ868qb/3/T2tIcED7CbGMqk/OsedUb2dyucYTCiBYViOOLPu/cxjdXjCLrB7UNTssqd4+3RvW4gzRSMThv98Lh/CA/BxHRZ45g==-----END PKCS7-----">
25
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
26
+ <!-- <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> -->
 
27
  </form>
28
  </div>
29
 
inc/class-cmp-render_html.php CHANGED
@@ -886,56 +886,56 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
886
  <script>
887
 
888
  var ajaxurl = "<?php echo admin_url('admin-ajax.php');?>";
 
889
 
890
- function AJAXform( formID, buttonID, resultID, emailID, firstnameID, lastnameID ){
891
 
892
- var selectForm = document.getElementById(formID); // Select the form by ID.
893
- var selectButton = document.getElementById(buttonID); // Select the button by ID.
894
- var selectResult = document.getElementById(resultID); // Select result element by ID.
895
- var emailInput = document.getElementById(emailID); // Select email input by ID.
896
- var firstnameInput = document.getElementById(firstnameID); // Select firstname input by ID.
897
- var lastnameInput = document.getElementById(lastnameID); // Select lastname input by ID.
898
 
899
- var firstname;
900
- var lastname;
901
 
902
- function XMLhttp(){
903
-
904
- var httpRequest = new XMLHttpRequest();
905
 
906
- httpRequest.onreadystatechange = function(){
907
- if ( this.readyState == 4 && this.status == 200 ) {
908
- result = JSON.parse( this.responseText );
909
- selectResult.innerHTML = result.message; // Display the result inside result element.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
910
  emailInput.value = '';
911
  selectForm.classList.add('-subscribed');
912
-
913
- if ( result.status == 1 ) {
914
  selectForm.classList.remove('-subscribe-failed');
915
  selectForm.classList.add('-subscribe-successful');
916
 
917
  <?php do_action('cmp-successfull-subscribe-action'); ?>
918
-
919
  } else {
920
  selectForm.classList.add('-subscribe-failed');
921
  }
922
- }
923
-
924
- };
925
-
926
- firstname = ( firstnameInput == null ) ? '' : firstnameInput.value;
927
- lastname = ( lastnameInput == null ) ? '' : lastnameInput.value;
928
-
929
- httpRequest.open('POST', ajaxurl, true);
930
- httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
931
- httpRequest.setRequestHeader("Access-Control-Allow-Origin", "*");
932
-
933
- httpRequest.send('action=niteo_subscribe&ajax=true&form_honeypot=&email=' + emailInput.value + '&firstname=' + firstname + '&lastname=' + lastname);
934
- }
935
-
936
- selectButton.onclick = function(){ // If clicked on the button.
937
- if ( emailInput.value != '' ) {
938
- XMLhttp();
939
  }
940
 
941
  }
@@ -945,10 +945,55 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
945
  }
946
  }
947
 
948
- /* Usage */
949
- window.addEventListener("load",function(event) {
950
- AJAXform( 'subscribe-form', 'submit-subscribe', 'subscribe-response', 'email-subscribe', 'firstname-subscribe', 'lastname-subscribe' );
951
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
952
 
953
  </script>
954
  <?php
@@ -1003,11 +1048,8 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1003
  break;
1004
 
1005
  case 'agency':
1006
- $body = '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ipsum a arcu cursus vitae congue mauris. Eros in cursus turpis massa tincidunt.</p>';
1007
- break;
1008
-
1009
  case 'pluto':
1010
- $body = '';
1011
  break;
1012
 
1013
  default:
886
  <script>
887
 
888
  var ajaxurl = "<?php echo admin_url('admin-ajax.php');?>";
889
+ var msg = '';
890
 
 
891
 
892
+ /* Usage */
893
+ window.addEventListener("load",function(event) {
894
+ subForm( 'subscribe-form', 'submit-subscribe', 'subscribe-response', 'email-subscribe', 'firstname-subscribe', 'lastname-subscribe' );
895
+ });
 
 
896
 
897
+ subForm = function(formID, buttonID, resultID, emailID, firstnameID, lastnameID) {
 
898
 
 
 
 
899
 
900
+ let selectForm = document.getElementById(formID); // Select the form by ID.
901
+ let selectButton = document.getElementById(buttonID); // Select the button by ID.
902
+ let selectResult = document.getElementById(resultID); // Select result element by ID.
903
+ let emailInput = document.getElementById(emailID); // Select email input by ID.
904
+ let firstnameInput = document.getElementById(firstnameID); // Select firstname input by ID.
905
+ let lastnameInput = document.getElementById(lastnameID); // Select lastname input by ID.
906
+
907
+ let firstname;
908
+ let lastname;
909
+
910
+ selectButton.onclick = function(){ // If clicked on the button.
911
+ if ( emailInput.value != '' ) {
912
+ // I'm using the whatwg-fetch polyfill and a polyfill for Promises.
913
+ fetch(ajaxurl, {
914
+ method: 'POST',
915
+ headers: {
916
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
917
+ 'Access-Control-Allow-Origin': '*',
918
+ },
919
+ body: `action=niteo_subscribe&ajax=true&form_honeypot=&email=${emailInput.value}&firstname=${firstname}&lastname=${lastname}`,
920
+ credentials: 'same-origin'
921
+ })
922
+ .then((res) => {
923
+ return res.json();
924
+ })
925
+ .then((data) => {
926
+ selectResult.innerHTML = data.message; // Display the result inside result element.
927
  emailInput.value = '';
928
  selectForm.classList.add('-subscribed');
929
+ if (data.status == 1) {
 
930
  selectForm.classList.remove('-subscribe-failed');
931
  selectForm.classList.add('-subscribe-successful');
932
 
933
  <?php do_action('cmp-successfull-subscribe-action'); ?>
 
934
  } else {
935
  selectForm.classList.add('-subscribe-failed');
936
  }
937
+ })
938
+ .catch(function(error) { console.log(error); });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
939
  }
940
 
941
  }
945
  }
946
  }
947
 
948
+
949
+ // function AJAXform( formID, buttonID, resultID, emailID, firstnameID, lastnameID ){
950
+
951
+
952
+ // function XMLhttp(){
953
+
954
+ // var httpRequest = new XMLHttpRequest();
955
+
956
+ // httpRequest.onreadystatechange = function(){
957
+ // if ( this.readyState == 4 && this.status == 200 ) {
958
+ // result = JSON.parse( this.responseText );
959
+ // selectResult.innerHTML = result.message; // Display the result inside result element.
960
+ // emailInput.value = '';
961
+ // selectForm.classList.add('-subscribed');
962
+
963
+ // if ( result.status == 1 ) {
964
+ // selectForm.classList.remove('-subscribe-failed');
965
+ // selectForm.classList.add('-subscribe-successful');
966
+
967
+ // <?php do_action('cmp-successfull-subscribe-action'); ?>
968
+
969
+ // } else {
970
+ // selectForm.classList.add('-subscribe-failed');
971
+ // }
972
+ // }
973
+
974
+ // };
975
+
976
+ // firstname = ( firstnameInput == null ) ? '' : firstnameInput.value;
977
+ // lastname = ( lastnameInput == null ) ? '' : lastnameInput.value;
978
+
979
+ // httpRequest.open('POST', ajaxurl, true);
980
+ // httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
981
+ // httpRequest.setRequestHeader("Access-Control-Allow-Origin", "*");
982
+
983
+ // httpRequest.send('action=niteo_subscribe&ajax=true&form_honeypot=&email=' + emailInput.value + '&firstname=' + firstname + '&lastname=' + lastname);
984
+ // }
985
+
986
+ // selectButton.onclick = function(){ // If clicked on the button.
987
+ // if ( emailInput.value != '' ) {
988
+ // XMLhttp();
989
+ // }
990
+
991
+ // }
992
+
993
+
994
+ // }
995
+
996
+
997
 
998
  </script>
999
  <?php
1048
  break;
1049
 
1050
  case 'agency':
 
 
 
1051
  case 'pluto':
1052
+ $body = '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ipsum a arcu cursus vitae congue mauris. Eros in cursus turpis massa tincidunt.</p>';
1053
  break;
1054
 
1055
  default:
inc/cmp-update-process.php CHANGED
@@ -46,7 +46,7 @@ if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
46
  'url' => '',
47
  'active' => '1',
48
  'hidden' => '1',
49
- 'order' => '17',
50
  );
51
  array_push( $socialmedia, $soundcloud );
52
  $update = true;
@@ -59,7 +59,7 @@ if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
59
  'url' => '',
60
  'active' => '1',
61
  'hidden' => '1',
62
- 'order' => '18',
63
  );
64
  array_push( $socialmedia, $whatsapp );
65
 
@@ -68,7 +68,7 @@ if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
68
  'url' => '',
69
  'active' => '1',
70
  'hidden' => '1',
71
- 'order' => '19',
72
  );
73
  array_push( $socialmedia, $phone );
74
  $update = true;
@@ -81,7 +81,7 @@ if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
81
  'url' => '',
82
  'active' => '1',
83
  'hidden' => '1',
84
- 'order' => '20',
85
  );
86
  array_push( $socialmedia, $telegram );
87
  $update = true;
@@ -94,7 +94,7 @@ if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
94
  'url' => '',
95
  'active' => '1',
96
  'hidden' => '1',
97
- 'order' => '21',
98
  );
99
  array_push( $socialmedia, $xing );
100
  $update = true;
@@ -107,25 +107,38 @@ if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
107
  'url' => '',
108
  'active' => '1',
109
  'hidden' => '1',
110
- 'order' => '22',
111
  );
112
  array_push( $socialmedia, $github );
113
  $update = true;
114
  }
115
 
116
- // add github social media in 3.1 update
117
  if ( !$this->niteo_in_array_r( 'snapchat', $socialmedia, true ) ) {
118
  $snapchat = array(
119
  'name' => 'snapchat',
120
  'url' => '',
121
  'active' => '1',
122
  'hidden' => '1',
123
- 'order' => '23',
124
  );
125
  array_push( $socialmedia, $snapchat );
126
  $update = true;
127
  }
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  if ( $update == true ) {
130
  update_option('niteoCS_socialmedia', json_encode( $socialmedia) );
131
  }
46
  'url' => '',
47
  'active' => '1',
48
  'hidden' => '1',
49
+ 'order' => 17,
50
  );
51
  array_push( $socialmedia, $soundcloud );
52
  $update = true;
59
  'url' => '',
60
  'active' => '1',
61
  'hidden' => '1',
62
+ 'order' => 18,
63
  );
64
  array_push( $socialmedia, $whatsapp );
65
 
68
  'url' => '',
69
  'active' => '1',
70
  'hidden' => '1',
71
+ 'order' => 19,
72
  );
73
  array_push( $socialmedia, $phone );
74
  $update = true;
81
  'url' => '',
82
  'active' => '1',
83
  'hidden' => '1',
84
+ 'order' => 20,
85
  );
86
  array_push( $socialmedia, $telegram );
87
  $update = true;
94
  'url' => '',
95
  'active' => '1',
96
  'hidden' => '1',
97
+ 'order' => 21,
98
  );
99
  array_push( $socialmedia, $xing );
100
  $update = true;
107
  'url' => '',
108
  'active' => '1',
109
  'hidden' => '1',
110
+ 'order' => 22,
111
  );
112
  array_push( $socialmedia, $github );
113
  $update = true;
114
  }
115
 
116
+ // add snapchat social media in 3.1 update
117
  if ( !$this->niteo_in_array_r( 'snapchat', $socialmedia, true ) ) {
118
  $snapchat = array(
119
  'name' => 'snapchat',
120
  'url' => '',
121
  'active' => '1',
122
  'hidden' => '1',
123
+ 'order' => 23,
124
  );
125
  array_push( $socialmedia, $snapchat );
126
  $update = true;
127
  }
128
 
129
+ // add spotify social media in 3.3.2 update
130
+ if ( !$this->niteo_in_array_r( 'spotify', $socialmedia, true ) ) {
131
+ $spotify = array(
132
+ 'name' => 'spotify',
133
+ 'url' => '',
134
+ 'active' => '1',
135
+ 'hidden' => '1',
136
+ 'order' => 24,
137
+ );
138
+ array_push( $socialmedia, $spotify );
139
+ $update = true;
140
+ }
141
+
142
  if ( $update == true ) {
143
  update_option('niteoCS_socialmedia', json_encode( $socialmedia) );
144
  }
inc/settings/settings-font-selector.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ ?>
5
+
6
+ <div class="table-wrapper theme-setup font-selector">
7
+ <h3><?php _e('Customize Fonts', 'cmp-coming-soon-maintenance');?></h3>
8
+ <table class="theme-setup">
9
+ <tbody>
10
+ <tr>
11
+ <th><?php _e('Headings Font', 'cmp-coming-soon-maintenance');?></th>
12
+ <td>
13
+ <fieldset>
14
+ <label for="niteoCS_font_headings_<?php echo esc_attr( $themeslug );?>"><?php _e('Font Family from ', 'cmp-coming-soon-maintenance');?><a href="https://fonts.google.com" target="_blank"><?php _e('Google Fonts', 'cmp-coming-soon-maintenance');?></a></label><br>
15
+ <select id="niteoCS_font_headings_<?php echo esc_attr( $themeslug );?>" class="headings-google-font" name="niteoCS_font_headings_<?php echo esc_attr( $themeslug );?>">
16
+ <option value="<?php echo esc_attr( $heading_font['family'] ); ?>" selected="selected"><?php echo esc_html( $heading_font['family'] ); ?></option>
17
+ </select>
18
+ </fieldset>
19
+
20
+ <fieldset>
21
+ <label for="niteoCS_font_headings_variant_<?php echo esc_attr( $themeslug );?>"><?php _e('Variant', 'cmp-coming-soon-maintenance');?></label><br>
22
+ <select id="niteoCS_font_headings_variant_<?php echo esc_attr( $themeslug );?>" class="headings-google-font-variant" name="niteoCS_font_headings_variant_<?php echo esc_attr( $themeslug );?>">
23
+ <option value="<?php echo esc_attr( $heading_font['variant'] ); ?>" selected="selected"><?php echo esc_html( $this->cmp_google_variant_title( $heading_font['variant'] ) ); ?></option>
24
+ </select>
25
+ </fieldset>
26
+
27
+ <?php
28
+ if ( $this->cmp_selectedTheme() !== 'mercury' ) { ?>
29
+
30
+ <fieldset>
31
+ <label for="niteoCS_font_headings_size_<?php echo esc_attr( $themeslug );?>"><?php _e('Font Size', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $heading_font['size'] ); ?></span>px</label><br>
32
+ <input type="range" id="niteoCS_font_headings_size_<?php echo esc_attr( $themeslug );?>" name="niteoCS_font_headings_size_<?php echo esc_attr( $themeslug );?>" min="10" max="75" step="1" value="<?php echo esc_attr( $heading_font['size'] ); ?>" data-css="font-size" data-type="heading" />
33
+ </fieldset>
34
+ <?php } ?>
35
+
36
+ <fieldset>
37
+ <label for="niteoCS_font_headings_spacing_<?php echo esc_attr( $themeslug );?>"><?php _e('Letter Spacing', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $heading_font['spacing'] ); ?></span>px</label><br>
38
+ <input type="range" id="niteoCS_font_headings_spacing_<?php echo esc_attr( $themeslug );?>" name="niteoCS_font_headings_spacing_<?php echo esc_attr( $themeslug );?>" min="0" max="10" step="0.5" value="<?php echo esc_attr( $heading_font['spacing'] ); ?>" data-css="letter-spacing" data-type="heading" />
39
+ </fieldset>
40
+
41
+ <?php
42
+ // include theme animation settings
43
+ if ( in_array( $this->cmp_selectedTheme(), $this->cmp_font_animation_themes() ) ) { ?>
44
+
45
+ <fieldset>
46
+ <label for="niteoCS_heading_animation_<?php echo esc_attr( $themeslug );?>"><?php _e('Animation', 'cmp-coming-soon-maintenance');?></label><br>
47
+ <select id="niteoCS_heading_animation_<?php echo esc_attr( $themeslug );?>" name="niteoCS_heading_animation_<?php echo esc_attr( $themeslug );?>" class="heading-animation">
48
+ <option value="none" <?php if ( $niteoCS_heading_animation == 'none' ) { echo ' selected="selected"'; } ?>><?php _e('No animation', 'cmp-coming-soon-maintenance');?></option>
49
+ <option value="fadeInDown" <?php if ( $niteoCS_heading_animation == 'fadeInDown' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Down', 'cmp-coming-soon-maintenance');?></option>
50
+ <option value="fadeInUp" <?php if ( $niteoCS_heading_animation == 'fadeInUp' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Up', 'cmp-coming-soon-maintenance');?></option>
51
+ <option value="fadeInLeft" <?php if ( $niteoCS_heading_animation == 'fadeInLeft' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Left', 'cmp-coming-soon-maintenance');?></option>
52
+ <option value="fadeInRight" <?php if ( $niteoCS_heading_animation == 'fadeInRight' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Right', 'cmp-coming-soon-maintenance');?></option>
53
+ </select><br>
54
+ </fieldset>
55
+ <?php
56
+ } ?>
57
+
58
+ </td>
59
+ </tr>
60
+
61
+ <tr>
62
+ <th><?php _e('Content Font', 'cmp-coming-soon-maintenance');?></th>
63
+ <td>
64
+
65
+ <fieldset>
66
+ <label for="niteoCS_font_content_<?php echo esc_attr( $themeslug );?>"><?php _e('Select Font Family from ', 'cmp-coming-soon-maintenance');?><a href="https://fonts.google.com" target="_blank">Google Fonts</a></label><br>
67
+ <select id="niteoCS_font_content_<?php echo esc_attr( $themeslug );?>" class="content-google-font" name="niteoCS_font_content_<?php echo esc_attr( $themeslug );?>">
68
+ <option value="<?php echo esc_attr( $content_font['family'] ); ?>" selected="selected"><?php echo esc_html( $content_font['family'] ); ?></option>
69
+ </select>
70
+ </fieldset>
71
+
72
+ <fieldset>
73
+ <label for="niteoCS_font_content_variant_<?php echo esc_attr( $themeslug );?>"><?php _e('Variant', 'cmp-coming-soon-maintenance');?></label><br>
74
+ <select id="niteoCS_font_content_variant_<?php echo esc_attr( $themeslug );?>" class="content-google-font-variant" name ="niteoCS_font_content_variant_<?php echo esc_attr( $themeslug );?>">
75
+ <option value="<?php echo esc_attr( $content_font['variant'] ); ?>" selected="selected"><?php echo esc_html( $this->cmp_google_variant_title( $content_font['variant'] ) ); ?></option>
76
+ </select>
77
+ </fieldset>
78
+
79
+ <fieldset>
80
+ <label for="niteoCS_font_content_size_<?php echo esc_attr( $themeslug );?>"><?php _e('Font Size', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $content_font['size'] ); ?></span>px</label><br>
81
+ <input id="niteoCS_font_content_size_<?php echo esc_attr( $themeslug );?>" type="range" name="niteoCS_font_content_size_<?php echo esc_attr( $themeslug );?>" min="10" max="50" step="1" value="<?php echo esc_attr( $content_font['size'] ); ?>" data-css="font-size" data-type="content" />
82
+ </fieldset>
83
+
84
+ <fieldset>
85
+ <label for="niteoCS_font_content_spacing_<?php echo esc_attr( $themeslug );?>"><?php _e('Letter Spacing', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $content_font['spacing'] ); ?></span>px</label><br>
86
+ <input id="niteoCS_font_content_spacing_<?php echo esc_attr( $themeslug );?>" type="range" name="niteoCS_font_content_spacing_<?php echo esc_attr( $themeslug );?>" min="0" max="10" step="0.5" value="<?php echo esc_attr( $content_font['spacing'] ); ?>" data-css="letter-spacing" data-type="content" />
87
+ </fieldset>
88
+
89
+ <fieldset>
90
+ <label for="niteoCS_font_content_lineheight_<?php echo esc_attr( $themeslug );?>"><?php _e('Line Height', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $content_font['line-height'] ); ?></span></label><br>
91
+ <input id="niteoCS_font_content_lineheight_<?php echo esc_attr( $themeslug );?>" type="range" name="niteoCS_font_content_lineheight_<?php echo esc_attr( $themeslug );?>" min="1.3" max="3.0" step="0.1" value="<?php echo esc_attr( $content_font['line-height'] ); ?>" data-css="line-height" data-type="content" />
92
+ </fieldset>
93
+ <?php
94
+ // include theme animation settings
95
+ if ( in_array( $this->cmp_selectedTheme(), $this->cmp_font_animation_themes() ) ) { ?>
96
+
97
+ <fieldset>
98
+ <label for="niteoCS_content_animation_<?php echo esc_attr( $themeslug );?>"><?php _e('Select Animation', 'cmp-coming-soon-maintenance');?></label><br>
99
+ <select id="niteoCS_content_animation_<?php echo esc_attr( $themeslug );?>" name="niteoCS_content_animation_<?php echo esc_attr( $themeslug );?>" class="content-animation">
100
+ <option value="none" <?php if ( $niteoCS_content_animation == 'none' ) { echo ' selected="selected"'; } ?>><?php _e('No animation', 'cmp-coming-soon-maintenance');?></option>
101
+ <option value="fadeInDown" <?php if ( $niteoCS_content_animation == 'fadeInDown' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Down', 'cmp-coming-soon-maintenance');?></option>
102
+ <option value="fadeInUp" <?php if ( $niteoCS_content_animation == 'fadeInUp' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Up', 'cmp-coming-soon-maintenance');?></option>
103
+ <option value="fadeInLeft" <?php if ( $niteoCS_content_animation == 'fadeInLeft' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Left', 'cmp-coming-soon-maintenance');?></option>
104
+ <option value="fadeInRight" <?php if ( $niteoCS_content_animation == 'fadeInRight' ) { echo ' selected="selected"'; } ?>><?php _e('Fade In Right', 'cmp-coming-soon-maintenance');?></option>
105
+ </select><br>
106
+ </fieldset>
107
+ <?php
108
+ } ?>
109
+
110
+ <p style="margin-bottom:0"><?php _e('Fonts preview', 'cmp-coming-soon-maintenance');?></p>
111
+ <div id="font-example-wrapper">
112
+ <h3 id="heading-example" class="animated <?php echo esc_attr($niteoCS_heading_animation);?>" style="font-size:<?php echo esc_attr( $heading_font['size'] );?>px;letter-spacing:<?php echo esc_attr( $heading_font['spacing'] );?>px">Hello, I am your Headings font!</h3>
113
+ <p id="content-example" class="animated <?php echo esc_attr($niteoCS_content_animation);?>" style="font-size:<?php echo esc_attr( $content_font['size'] );?>px;letter-spacing:<?php echo esc_attr( $content_font['spacing'] );?>px;line-height:<?php echo esc_attr( $content_font['line-height'] );?>">And this is a long paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
114
+ </div>
115
+
116
+ </td>
117
+
118
+ </tr>
119
+
120
+ <?php echo $this->render_settings->submit(); ?>
121
+
122
+ </tbody>
123
+ </table>
124
+
125
+ </div>
inc/settings/settings-social-media.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ ?>
5
+
6
+ <div class="table-wrapper content" id="social-section">
7
+ <h3><?php _e('Social Media', 'cmp-coming-soon-maintenance');?></h3>
8
+ <table class="content">
9
+ <tbody>
10
+ <tr>
11
+ <th><?php _e('Social Section Title', 'cmp-coming-soon-maintenance');?></th>
12
+ <td>
13
+ <fieldset>
14
+ <input type="text" name="niteoCS_soc_title" id="niteoCS_soc_title" value="<?php echo esc_attr( $niteoCS_soc_title); ?>" class="regular-text code">
15
+ </fieldset>
16
+ </td>
17
+ </tr>
18
+
19
+ <tr>
20
+ <th><?php _e('Social Media Icons', 'cmp-coming-soon-maintenance');?></th>
21
+ <td>
22
+ <p class="social-description"><?php _e('Click on Social Icons below to enable Social Media settings.', 'cmp-coming-soon-maintenance');?></p>
23
+ <ul class="social-media">
24
+ <?php
25
+ uasort( $socialmedia, array($this,'sort_social') );
26
+
27
+ // render icons
28
+ foreach ( $socialmedia as $social ) {
29
+
30
+ // push soundcloud if missing - pre version 1.13
31
+
32
+ $social_active = '';
33
+
34
+ if ($social['hidden'] == '0') {
35
+ $social_active = 'active';
36
+ }
37
+
38
+ switch ($social['name']) {
39
+ case 'envelope-o':
40
+ $title = __('Email Address', 'cmp-coming-soon-maintenance');
41
+ break;
42
+ case 'phone':
43
+ $title = __('Phone Number', 'cmp-coming-soon-maintenance');
44
+ break;
45
+ case 'whatsapp':
46
+ $title = __('Phone Number', 'cmp-coming-soon-maintenance');
47
+ break;
48
+ default:
49
+ $title = ucfirst( esc_attr($social['name'] ) );
50
+ break;
51
+ } ?>
52
+
53
+ <li>
54
+ <i class="fa fa-<?php echo esc_attr($social['name']) . ' '. $social_active;?>" title="<?php echo esc_attr($title);?>" data-name="<?php echo esc_attr($social['name']);?>" aria-hidden="true"></i>
55
+ </li>
56
+ <?php
57
+ } ?>
58
+ </ul>
59
+
60
+ <ul class="social-inputs">
61
+ <li class="social-labels"><span class="label"><?php _e('Position', 'cmp-coming-soon-maintenance');?></span><span class="label"><?php _e('Active', 'cmp-coming-soon-maintenance');?></span><span class="label"><?php _e('Website URL', 'cmp-coming-soon-maintenance');?></span></li>
62
+ <?php
63
+ foreach ( $socialmedia as $social ) {
64
+
65
+ ( $social['hidden'] == '0' ) ? $active = 'active ' : $active = '';
66
+
67
+ ( $social['active'] == '0' ) ? $disabled = ' disabled' : $disabled = '';
68
+
69
+ $url = '';
70
+
71
+ switch ( $social['name'] ) {
72
+ case 'envelope-o':
73
+ $title = __('Email Address', 'cmp-coming-soon-maintenance');
74
+ $url = 'email@example.com';
75
+ break;
76
+ case 'google-plus':
77
+ $title = ucfirst( $social['name'] );
78
+ $url = 'https://plus.google.com/profile';
79
+ break;
80
+ case 'behance':
81
+ $title = ucfirst( $social['name'] );
82
+ $url = 'https://behance.net/profile';
83
+ break;
84
+ case 'phone':
85
+ $title = __('Phone Number', 'cmp-coming-soon-maintenance');
86
+ $url = '+123456789';
87
+ break;
88
+ case 'whatsapp':
89
+ $title = __('Whatsapp Phone Number', 'cmp-coming-soon-maintenance');
90
+ $url = '+123456789';
91
+ break;
92
+ case 'telegram':
93
+ $title = ucfirst( $social['name'] );
94
+ $url = 'https://telegram.me/username';
95
+ break;
96
+ case 'spotify':
97
+ $title = ucfirst( $social['name'] );
98
+ $url = 'https://open.spotify.com/user/username';
99
+ break;
100
+ default:
101
+ $title = ucfirst( $social['name'] );
102
+ $url = 'https://'.$social['name'].'.com/profile';
103
+ break;
104
+ }
105
+
106
+
107
+ // if no URL set, change it to default profile
108
+ if ( $social['url'] && $social['url'] !== '' ) {
109
+ $url = $social['url'];
110
+ } ?>
111
+
112
+ <li class="<?php echo esc_attr( $active . $social['name'] );?>">
113
+ <p><i class="fa fa-sort" aria-hidden="true"></i>
114
+ <label for="niteoCS_<?php echo esc_attr( $social['name'] );?>" class="<?php echo esc_attr( $social['name'] );?>"><?php echo esc_html( $title );?></label>
115
+ <input type="text" id="niteoCS_<?php echo esc_attr( $social['name'] );?>" value="<?php echo esc_attr( $url );?>" class="regular-text code <?php echo esc_attr( $social['name'] );?>" data-name="<?php echo esc_attr( $social['name'] );?>"<?php echo $disabled;?>/>
116
+ <input type="checkbox" name="niteoCS_<?php echo esc_attr( $social['name'] );?>_checkbox" id="niteoCS_<?php echo esc_attr( $social['name'] );?>_checkbox" class="<?php echo esc_attr( $social['name'] );?>" data-name="<?php echo esc_attr( $social['name'] );?>"<?php checked( '1', $social['active'] ); ?>/>
117
+ </p>
118
+ </li>
119
+ <?php
120
+ } ?>
121
+
122
+ </ul>
123
+
124
+ <fieldset>
125
+ <input type="hidden" name="niteoCS_socialmedia" id="niteoCS_socialmedia" value="<?php echo esc_attr( $niteoCS_socialmedia ); ?>" class="regular-text code active">
126
+ </fieldset>
127
+ </td>
128
+ </tr>
129
+
130
+ <?php
131
+ // include social special settings
132
+ if (file_exists($this->cmp_theme_dir($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-social_settings.php')) {
133
+ include ( $this->cmp_theme_dir($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-social_settings.php' );
134
+ }
135
+
136
+ echo $this->render_settings->submit(); ?>
137
+
138
+ </tbody>
139
+ </table>
140
+ </div>
inc/settings/settings-theme-selector.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ ?>
5
+
6
+ <div class="table-wrapper general">
7
+ <h3><?php _e('Available Themes', 'cmp-coming-soon-maintenance');?></h3>
8
+ <table class="general theme-selector">
9
+ <tr>
10
+ <td class="theme-selector">
11
+ <fieldset>
12
+ <legend class="screen-reader-text">
13
+ <span><?php _e('Free Themes', 'cmp-coming-soon-maintenance');?> </span>
14
+ </legend>
15
+ <?php
16
+ // move active theme to beginning
17
+ $key = array_search ( $this->cmp_selectedTheme(), $this->cmp_themes_available() );
18
+
19
+ $themes = $this->cmp_themes_available();
20
+
21
+ if ( $key ) {
22
+ $active = $themes[$key];
23
+ unset( $themes[$key] );
24
+ array_unshift( $themes, $active );
25
+ }
26
+
27
+ // define what attribute we want from style.css header
28
+ $headers = array('Version');
29
+
30
+ foreach ( $themes as $theme_slug ) {
31
+
32
+ $version = $this->cmp_theme_version( $theme_slug );
33
+ $type = 'standard';
34
+
35
+ // if premium get theme version
36
+ if ( in_array( $theme_slug, $this->cmp_premium_themes_installed() ) ) {
37
+ $type = 'premium';
38
+ }
39
+
40
+ // get thumbnail
41
+ $thumbnail = plugins_url('../../img/thumbnails/'. $theme_slug . '_thumbnail.jpg', __FILE__);
42
+
43
+ // if no thumbnail in CMP plugin folder, check directly in CMP theme folder
44
+ if ( !file_exists( CMP_PLUGIN_DIR . 'img/thumbnails/'. $theme_slug . '_thumbnail.jpg' ) ) {
45
+ $thumbnail = $this->cmp_themeURL( $themeslug ) . $theme_slug . '/img/thumbnail.jpg';
46
+ } ?>
47
+
48
+ <div class="theme-wrapper<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' active'; } ?>" data-security="<?php echo esc_attr($ajax_nonce);?>" data-type="<?php echo esc_attr($type);?>" data-purchased="1" data-slug="<?php echo esc_attr($theme_slug);?>" data-version="<?php echo esc_html($version);?>" data-remote_url="<?php echo esc_url(CMP_UPDATE_URL);?>">
49
+ <div class="thumbnail-holder theme-details" style="background-image:url('<?php echo esc_url( $thumbnail ); ?>')"></div>
50
+
51
+ <div class="buttons-wrapper">
52
+
53
+ <div class="button theme-select hide<?php echo ( $this->cmp_selectedTheme() == $theme_slug ) ? ' activated' : '';?>">
54
+ <input type="radio" name="niteoCS_select_theme" value="<?php echo esc_attr($theme_slug);?>" id="displayOption-<?php echo esc_attr($theme_slug);?>"<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' checked="checked"'; } ?>>
55
+ <span class="input-label"><?php if ( $this->cmp_selectedTheme() == $theme_slug ) { _e('Active', 'cmp-coming-soon-maintenance'); } else { _e('Select', 'cmp-coming-soon-maintenance'); }?></span>
56
+ </div>
57
+
58
+ <a href="<?php echo esc_url( get_site_url().'?cmp_preview=true&cmp_theme='.$theme_slug );?>" target="_blank" class="theme-preview button hide"><i class="fa fa-external-link" aria-hidden="true"></i><?php _e('PREVIEW', 'cmp-coming-soon-maintenance');?></a>
59
+
60
+ <button type="button" class="theme-details button hide"><i class="fa fa-eye" aria-hidden="true"></i><?php _e('DETAILS', 'cmp-coming-soon-maintenance');?></button>
61
+ </div>
62
+
63
+ <div class="theme-inputs">
64
+
65
+ <span class="theme-title"><?php echo ucwords(esc_html(str_replace('_', ' ', $theme_slug)));?></span>
66
+
67
+ <?php echo ( $this->cmp_selectedTheme() == $theme_slug ) ? ' <span class="italic">'.__('Active', 'cmp-coming-soon-maintenance').'</span>' : '';?>
68
+
69
+ <span class="theme-version">ver. <?php echo esc_html( $version );?></span>
70
+
71
+ </div> <!-- theme-inputs -->
72
+ </div> <!-- theme-wrapper -->
73
+
74
+ <?php
75
+ } ?>
76
+ </fieldset>
77
+ </td>
78
+ </tr>
79
+
80
+ <?php echo $this->render_settings->submit(); ?>
81
+
82
+ </tbody>
83
+ </table>
84
+ <div class="theme-overlay cmp"></div>
85
+ </div>
86
+
87
+ <?php
88
+ if ( !empty( $downloadable_themes ) ) { ?>
89
+
90
+ <div class="table-wrapper general">
91
+ <h3><?php _e('Download more CMP Themes', 'cmp-coming-soon-maintenance');?></h3>
92
+ <table class="general theme-selector">
93
+ <tbody>
94
+ <tr>
95
+ <td class="theme-selector">
96
+ <fieldset>
97
+ <legend class="screen-reader-text">
98
+ <span><?php _e('Premium Themes', 'cmp-coming-soon-maintenance');?> </span>
99
+ </legend>
100
+ <?php
101
+
102
+ // build previews for downloadable themes
103
+ foreach ( $downloadable_themes as $premium_theme ) {
104
+ $theme_slug = $premium_theme['name'];
105
+
106
+ switch ( $theme_slug ) {
107
+ case 'pluto':
108
+ $background = '4';
109
+ break;
110
+ default:
111
+ $background = '1';
112
+ break;
113
+ }
114
+
115
+ $thumbnail = plugins_url('../../img/thumbnails/'. $theme_slug . '_thumbnail.jpg', __FILE__); ?>
116
+
117
+ <div class="theme-wrapper premium" data-security="<?php echo esc_attr($ajax_nonce);?>" data-slug="<?php echo esc_attr($theme_slug);?>" data-type="premium">
118
+
119
+ <div class="thumbnail-holder theme-details" style="background-image:url('<?php echo esc_url( $thumbnail ); ?>')"></div>
120
+
121
+ <div class="buttons-wrapper">
122
+
123
+ <a href="<?php echo esc_url ( $premium_theme['url'] );?>" target="_blank" class="theme-purchase button hide"><i class="fa fa-download" aria-hidden="true"></i><?php echo sprintf(__('Get %s', 'cmp-coming-soon-maintenance'), ucwords( esc_html( str_replace('_', ' ', $theme_slug) ) ));?></a>
124
+
125
+ <a href="<?php echo 'http://cmp.niteothemes.com/?cmp_preview=true&selector=true&theme='.$theme_slug.'&background='.$background.'&utm_source=cmp&utm_medium=referral&utm_campaign='.$theme_slug.'';?>" target="_blank" class="theme-preview button hide"><i class="fa fa-external-link" aria-hidden="true"></i><?php _e('PREVIEW', 'cmp-coming-soon-maintenance');?></a>
126
+
127
+ <button type="button" class="theme-details button hide"><i class="fa fa-eye" aria-hidden="true"></i><?php _e('DETAILS', 'cmp-coming-soon-maintenance');?></button>
128
+
129
+ </div>
130
+
131
+ <div class="theme-inputs">
132
+ <span class="theme-title"><?php echo ucwords( esc_html( str_replace('_', ' ', $theme_slug) ) );?></span>
133
+ <?php echo ( $premium_theme['price'] == '0' ) ? '<span class="theme-version"> ('. __('freebie') .')</span>' : ''; ?>
134
+ </div>
135
+ </div>
136
+
137
+ <?php
138
+ } ?>
139
+ </fieldset>
140
+ </td>
141
+ </tr>
142
+
143
+ <?php echo $this->render_settings->submit(); ?>
144
+
145
+ </tbody>
146
+ </table>
147
+ </div>
148
+
149
+ <?php
150
+ } // if !empty($premium_themes
js/settings.js CHANGED
@@ -1,1059 +1,1536 @@
1
- jQuery(document).ready(function($){
2
-
3
- var tab = document.location.hash.substring(1);
4
- var action = jQuery('#csoptions').attr('action');
5
- var settings = $('#csoptions fieldset:not(.skip-preview-validation *)').serialize();
6
-
7
- // function to tab navigation
8
- navtab = function(tab) {
9
- jQuery('.cmp-coming-soon-maintenance .nav-tab-wrapper .nav-tab').removeClass('nav-tab-active');
10
- jQuery('.nav-tab-wrapper .' + tab).addClass('nav-tab-active');
11
-
12
- jQuery('.cmp-coming-soon-maintenance .table-wrapper.' + tab).css('display', 'block');
13
- jQuery('.cmp-coming-soon-maintenance .table-wrapper-css.' + tab).css('display', 'block');
14
- jQuery('.cmp-coming-soon-maintenance .comingsoon.' + tab).css('display', 'block');
15
-
16
- jQuery('.cmp-coming-soon-maintenance .table-wrapper:not(.' + tab + ')').css('display', 'none');
17
- jQuery('.cmp-coming-soon-maintenance .table-wrapper-css:not(.' + tab).css('display', 'none');
18
- jQuery('.cmp-coming-soon-maintenance .comingsoon:not(.' + tab + ')').css('display', 'none');
19
-
20
- if ( tab == 'install' ) {
21
- jQuery('.cmp-coming-soon-maintenance .submit').css('display', 'none');
22
- jQuery('.cmp-coming-soon-maintenance #csoptions').attr('action', action);
23
- } else {
24
- jQuery('.cmp-coming-soon-maintenance .submit').css('display', 'block');
25
- // change form action to display current tab after save
26
- jQuery('.cmp-coming-soon-maintenance #csoptions').attr('action', action + '#' + tab);
27
- }
28
- }
29
-
30
- if ( tab != '' ) {
31
- navtab(tab);
32
- } else {
33
- jQuery('.cmp-coming-soon-maintenance .table-wrapper-css').css('display', 'none');
34
- }
35
-
36
- window.onhashchange = function(){
37
- tab = document.location.hash.substring(1);
38
- navtab(tab);
39
- }
40
-
41
- $('.cmp-coming-soon-maintenance .nav-tab:not(.theme-preview)').click(function(e) {
42
- e.preventDefault();
43
- tab = $(this).data('tab');
44
- document.location.hash = tab;
45
- });
46
-
47
- // update range inputs on change
48
- update_range('.cmp-coming-soon-maintenance .blur-range', 'span', 'html');
49
- update_range('.cmp-coming-soon-maintenance .background-overlay-opacity', 'span', 'html');
50
- update_range('#logo_size_slider', '#niteoCS_logo_size', 'val');
51
- update_range('#niteoCS_logo_size', '#logo_size_slider', 'val');
52
-
53
- // create media upload buttons
54
- // selector, multipe, type, element to render
55
- media_upload_button('logo', false, 'image', 'img');
56
- media_upload_button('favicon', false, 'image', 'img');
57
- media_upload_button('seo_img', false, 'image', 'img');
58
- media_upload_button('images', true, 'image', 'img');
59
- media_upload_button('pattern', false, 'image', 'background');
60
- media_upload_button('video-thumb', false, 'image', 'img');
61
- media_upload_button('video-local', false, 'video', 'video');
62
-
63
- // show / hide settings
64
- toggle_settings( 'analytics' );
65
- toggle_settings( 'contact-form' );
66
- toggle_settings( 'subscribe' );
67
- toggle_settings( 'background-effect' );
68
- toggle_settings( 'special-effect' );
69
- toggle_settings( 'cmp-logo' );
70
- toggle_settings( 'background-type' );
71
- toggle_settings( 'counter' );
72
- toggle_settings( 'overlay-text' );
73
- toggle_settings( 'cmp-logo-size' );
74
-
75
- toggle_select( 'counter-action' );
76
- toggle_select( 'subscribe-method' );
77
- toggle_select( 'background-overlay' );
78
- toggle_select( 'banner-video-source');
79
-
80
- // change all selects to select2
81
- jQuery('.cmp-coming-soon-maintenance select:not(.headings-google-font):not(.content-google-font )').select2({
82
- width: '100%',
83
- minimumResultsForSearch: -1,
84
- placeholder: 'Click to select..',
85
- });
86
-
87
- jQuery('.cmp-coming-soon-maintenance #cmp-status').click(function(){
88
- jQuery('.cmp-coming-soon-maintenance .cmp-status input[type=radio]').prop('disabled', function (_, val) { return ! val; });
89
- jQuery('#cmp-toggle-adminbar').toggleClass('status-1');
90
- });
91
-
92
- cmp_status_inputs();
93
-
94
- function cmp_status_inputs() {
95
-
96
- // Make clickable status radio buttons
97
- jQuery('.cmp-coming-soon-maintenance .cmp-status.switch:not(.disabled)').click(function(){
98
- if ( jQuery('.cmp-coming-soon-maintenance #cmp-status').prop('checked') == false ) {
99
- return;
100
- }
101
- var $children = jQuery(this).children('input');
102
- $children.prop("checked", true);
103
- jQuery('.cmp-coming-soon-maintenance .cmp-status.switch').removeClass('active');
104
- jQuery(this).addClass('active');
105
-
106
- $children.trigger('change');
107
-
108
- if ( $children.val() == '3' ) {
109
- jQuery('.cmp-coming-soon-maintenance .redirect-inputs').fadeIn('fast');
110
- } else {
111
- jQuery('.cmp-coming-soon-maintenance .redirect-inputs').fadeOut('fast');
112
- }
113
- });
114
- }
115
-
116
- // expandable tabs
117
- jQuery('.cmp-coming-soon-maintenance .table-wrapper h3').click(function(){
118
- jQuery(this).parent().toggleClass('closed');
119
- });
120
-
121
- // test unsplash image
122
- jQuery('.cmp-coming-soon-maintenance #test-unsplash').click(function(e){
123
- e.preventDefault();
124
-
125
- var media_wrapper = jQuery('.cmp-coming-soon-maintenance #unsplash-media'),
126
- unsplash_feed = jQuery('.cmp-coming-soon-maintenance .unsplash_banner select[name^="unsplash_feed"] option:selected').val(),
127
- unsp_url = '',
128
- feat = '',
129
- custom_str = '',
130
- security = jQuery(this).data('security');
131
-
132
- // return if not specific unsplash photo selected - throttling due too much requests
133
- if ( unsplash_feed != 0 ) return;
134
-
135
- switch( unsplash_feed ) {
136
- // specific photo
137
- case '0':
138
- unsp_url = jQuery('.cmp-coming-soon-maintenance #niteoCS-unsplash-0').val();
139
- break;
140
-
141
- default:
142
- break;
143
- }
144
-
145
-
146
- if ( unsplash_feed == 3 || unsp_url != '' || custom_str != '' ) {
147
-
148
- var params = {feed: unsplash_feed, url: unsp_url, feat: feat, custom_str: custom_str};
149
-
150
- jQuery(this).prop('disabled', true);
151
- jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>');
152
- // media_wrapper.html('');
153
-
154
- var data = {
155
- action: 'niteo_unsplash',
156
- security: security,
157
- params: params
158
- };
159
-
160
- $.post(ajaxurl, data, function(response) {
161
-
162
- var unsplash = JSON.parse(response);
163
-
164
- jQuery('#unsplash_img').remove();
165
-
166
- var loadingTimeout = setTimeout(function(){
167
- jQuery('#test-unsplash').prop('disabled', false);
168
- jQuery('#test-unsplash').text('Display Unsplash Photo');
169
- jQuery('#unsplash-media').html('<p>It seems <a href="https://status.unsplash.com/" target="_blank">Unsplash API</a> is not responding. Please try again later.</p>');
170
- }, 5000);
171
-
172
- if ( unsplash.response == '200' ) {
173
- var unsplash = jQuery.parseJSON(unsplash.body);
174
-
175
- if ( unsplash[0]) {
176
- var img = unsplash[0]['urls']['raw']+'?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588';
177
- var author = unsplash[0]['user']['name'];
178
- var author_url = unsplash[0]['user']['links']['html'];
179
- var img_url = unsplash[0]['links']['html'];
180
- var img_id = unsplash[0]['id'];
181
- } else {
182
- var img = unsplash['urls']['raw']+'?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588';
183
- var author = unsplash['user']['name'];
184
- var author_url = unsplash['user']['links']['html'];
185
- var img_url = unsplash['links']['html'];
186
- var img_id = unsplash['id'];
187
- }
188
-
189
- jQuery('<img />', {src: img, id: 'unsplash_img'}).
190
- one('load', function() { //Set something to run when it finishes loading
191
- jQuery(this).appendTo(media_wrapper);
192
- jQuery(this).fadeIn();
193
- jQuery('#test-unsplash').prop('disabled', false);
194
- jQuery('#test-unsplash').text('Display Unsplash Photo');
195
- jQuery('.unsplash-id').html('<a href="'+img_url+'" target="_blank">Photo</a> (ID: '+img_id+') by <a href="'+author_url+'" target="_blank">' +author+ '</a> / <a href="https://unsplash.com/" target="_blank">Unsplash</a>')
196
- jQuery( '.blur-range' ).trigger('input');
197
- clearTimeout(loadingTimeout);
198
- });
199
-
200
-
201
-
202
- } else {
203
- jQuery('.cmp-coming-soon-maintenance #test-unsplash').prop('disabled', false);
204
- jQuery('.cmp-coming-soon-maintenance #test-unsplash').text('Display Unsplash Photo');
205
- jQuery('.cmp-coming-soon-maintenance #unsplash-media').html('<p>Error '+unsplash.response+': <span style="text-transform:lowercase;">'+unsplash.body+'</span></p>');
206
- clearTimeout(loadingTimeout);
207
- }
208
-
209
- });
210
- } else {
211
- jQuery('.cmp-coming-soon-maintenance #unsplash_img').remove();
212
- }
213
-
214
- });
215
-
216
-
217
-
218
- videoPreview = function() {
219
-
220
- // return of video background is not selected
221
- if ( jQuery('.cmp-coming-soon-maintenance .background-type:checked' ).val() != '5' ) {
222
- return;
223
- }
224
-
225
- var source = $('.cmp-coming-soon-maintenance .banner-video-source').val();
226
-
227
- if ( source == 'youtube' ) {
228
-
229
- var youtubeURL = $('.cmp-coming-soon-maintenance #niteoCS-youtube-url').val();
230
-
231
- // get YT thumbnail and append it to wrapper
232
- if ( youtubeURL != '' ) {
233
- var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
234
- var ytID = youtubeURL.match(regExp);
235
-
236
- if ( ytID && ytID[7].length == 11 ) {
237
- jQuery('.cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper').html('');
238
- var ytThumb = 'https://img.youtube.com/vi/' + ytID[7] + '/maxresdefault.jpg';
239
- jQuery('.cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper').append('<img src="' + ytThumb + '" alt=""/>');
240
- jQuery( '.cmp-coming-soon-maintenance .blur-range' ).trigger('input');
241
-
242
- } else {
243
- jQuery('.cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper').html('');
244
- }
245
- }
246
- }
247
-
248
- // append local video
249
- if ( source == 'local' ) {
250
- var videoURL = jQuery('#niteoCS-video-local-id').data('url');
251
-
252
- if ( videoURL != '' ) {
253
- $('.cmp-coming-soon-maintenance .video-local-wrapper').html('<video width="600" height="400" controls><source src="'+videoURL+'" type="video/mp4">Your browser does not support the video tag.</video>');
254
- }
255
-
256
- }
257
- };
258
-
259
- // display video on load
260
- videoPreview();
261
-
262
- // display videos on background change to video type
263
- jQuery('.cmp-coming-soon-maintenance .background-type').on('change', function() {
264
- videoPreview();
265
-
266
- });
267
-
268
- // display YT video while inserting YT URL
269
- jQuery('.cmp-coming-soon-maintenance #niteoCS-youtube-url').on('keyup', function() {
270
- videoPreview();
271
- });
272
-
273
- jQuery('.cmp-coming-soon-maintenance .banner-video-source').on('change', function() {
274
- videoPreview();
275
- });
276
-
277
-
278
- // display selected unsplash feed
279
- var unsplashfeed = jQuery('.unsplash_banner select[name^="unsplash_feed"] option:selected').val();
280
- jQuery('.unsplash-feed-' + unsplashfeed).css('display', 'block');
281
-
282
- jQuery('.unsplash_banner select[name^="unsplash_feed"]').on('change', function() {
283
- unsplashfeed = jQuery('.unsplash_banner select[name^="unsplash_feed"] option:selected').val();
284
- jQuery('.unsplash-feed').css('display', 'none');
285
- jQuery('.unsplash-feed-' + unsplashfeed).css('display', 'block');
286
- jQuery('#test-unsplash').trigger('click');
287
- });
288
-
289
- // load unsplash upon load if unsplash is selected
290
- if ( jQuery('#csoptions .niteoCS_banner:checked').val() == 1 ) {
291
- jQuery('#test-unsplash').trigger('click');
292
- }
293
-
294
-
295
- // preview gradient on select change
296
- jQuery('.cmp-coming-soon-maintenance select.background-gradient').on('change', function() {
297
- var gradient = jQuery('.cmp-coming-soon-maintenance select.background-gradient option:selected').val();
298
-
299
- if ( gradient == 'custom' ) {
300
- jQuery('.cmp-coming-soon-maintenance .custom-gradient').css('display', 'block');
301
- jQuery('.cmp-coming-soon-maintenance .gradient-preview').css({'background':'-moz-linear-gradient(-45deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)',
302
- 'background':'-webkit-linear-gradient(-45deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)',
303
- 'background':'linear-gradient(135deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)'});
304
- } else {
305
- colors = gradient.split(':');
306
- jQuery('.cmp-coming-soon-maintenance .custom-gradient').css('display', 'none');
307
- jQuery('.cmp-coming-soon-maintenance .gradient-preview').css({'background':'-moz-linear-gradient(-45deg, '+colors[0]+' 0%, '+colors[1]+' 100%)',
308
- 'background':'-webkit-linear-gradient(-45deg, '+colors[0]+' 0%, '+colors[1]+' 100%)',
309
- 'background':'linear-gradient(135deg, '+colors[0]+' 0%, '+colors[1]+' 100%)'});
310
- }
311
- }).trigger('change');
312
-
313
-
314
-
315
- // banner background colorpicker
316
- jQuery('.cmp-coming-soon-maintenance #niteoCS_banner_color').wpColorPicker({
317
- change: function(event, ui){
318
- jQuery('.color-preview').css('background-color', ui.color.toString());
319
- }
320
- });
321
-
322
- // banner gradient background colorpicker one
323
- jQuery('.cmp-coming-soon-maintenance #niteoCS_gradient_one').wpColorPicker({
324
- change: function(event, ui){
325
- jQuery('.gradient-preview').css({'background':'-moz-linear-gradient(-45deg, '+ui.color.toString()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)',
326
- 'background':'-webkit-linear-gradient(-45deg, '+ui.color.toString()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)',
327
- 'background':'linear-gradient(135deg, '+ui.color.toString()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)'});
328
- }
329
- });
330
-
331
- // banner gradient background colorpicker two
332
- jQuery('.cmp-coming-soon-maintenance #niteoCS_gradient_two').wpColorPicker({
333
- change: function(event, ui){
334
- jQuery('.gradient-preview').css({'background':'-moz-linear-gradient(-45deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+ui.color.toString()+' 100%)',
335
- 'background':'-webkit-linear-gradient(-45deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+ui.color.toString()+' 100%)',
336
- 'background':'linear-gradient(135deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+ui.color.toString()+' 100%)'});
337
- }
338
- });
339
-
340
- // OVERLAY COLOR
341
- jQuery('.cmp-coming-soon-maintenance #niteoCS_overlay_color').wpColorPicker({
342
- change: function(event, ui){
343
- jQuery('.thumbnail-overlay').css('background', ui.color.toString());
344
- }
345
- });
346
-
347
- // get overlay color and apply it to Background thumbnails
348
- jQuery('.cmp-coming-soon-maintenance .thumbnail-overlay').css('background', jQuery('#niteoCS_overlay_color').val() );
349
-
350
- // OVERLAY GRADIENT
351
- jQuery('.cmp-coming-soon-maintenance select.overlay-gradient').on('change', function() {
352
- var overlay_gradient = jQuery('select.overlay-gradient option:selected').val();
353
-
354
- if ( overlay_gradient == 'custom' ) {
355
- jQuery('.cmp-coming-soon-maintenance .custom-overlay-gradient').css('display', 'block');
356
-
357
- var gradient_one = jQuery('#niteoCS_overlay_gradient_one').val();
358
- var gradient_two = jQuery('#niteoCS_overlay_gradient_two').val();
359
-
360
- jQuery('.cmp-coming-soon-maintenance .thumbnail-overlay').css({'background':'-moz-linear-gradient(-45deg, '+ gradient_one +' 0%, '+ gradient_two +' 100%)',
361
- 'background':'-webkit-linear-gradient(-45deg, '+ gradient_one +' 0%, '+ gradient_two +' 100%)',
362
- 'background':'linear-gradient(135deg, '+ gradient_one +' 0%, '+ gradient_two +' 100%)'});
363
- } else {
364
- colors = overlay_gradient.split(':');
365
- jQuery('.cmp-coming-soon-maintenance .custom-overlay-gradient').css('display', 'none');
366
- jQuery('.cmp-coming-soon-maintenance .thumbnail-overlay').css({'background':'-moz-linear-gradient(-45deg, '+colors[0]+' 0%, '+colors[1]+' 100%)',
367
- 'background':'-webkit-linear-gradient(-45deg, '+colors[0]+' 0%, '+colors[1]+' 100%)',
368
- 'background':'linear-gradient(135deg, '+colors[0]+' 0%, '+colors[1]+' 100%)'});
369
- }
370
- });
371
-
372
- // Overlay gradient colorpicker one
373
- jQuery('#niteoCS_overlay_gradient_one').wpColorPicker({
374
- change: function(event, ui){
375
- jQuery('.thumbnail-overlay').css({'background':'-moz-linear-gradient(-45deg, '+ui.color.toString()+' 0%, '+jQuery('#niteoCS_overlay_gradient_two').val()+' 100%)',
376
- 'background':'-webkit-linear-gradient(-45deg, '+ui.color.toString()+' 0%, '+jQuery('#niteoCS_overlay_gradient_two').val()+' 100%)',
377
- 'background':'linear-gradient(135deg, '+ui.color.toString()+' 0%, '+jQuery('#niteoCS_overlay_gradient_two').val()+' 100%)'});
378
- }
379
- });
380
-
381
- // Overlay gradient colorpicker two
382
- jQuery('#niteoCS_overlay_gradient_two').wpColorPicker({
383
- change: function(event, ui){
384
- jQuery('.thumbnail-overlay').css({'background':'-moz-linear-gradient(-45deg, '+jQuery('#niteoCS_overlay_gradient_one').val()+' 0%, '+ui.color.toString()+' 100%)',
385
- 'background':'-webkit-linear-gradient(-45deg, '+jQuery('#niteoCS_overlay_gradient_one').val()+' 0%, '+ui.color.toString()+' 100%)',
386
- 'background':'linear-gradient(135deg, '+jQuery('#niteoCS_overlay_gradient_one').val()+' 0%, '+ui.color.toString()+' 100%)'});
387
- }
388
- });
389
-
390
- // OVERLAY OPACITY
391
- jQuery( '.background-overlay-opacity' ).on('input', function () {
392
- var value = jQuery(this).val();
393
- jQuery('.thumbnail-overlay').css('opacity', value);
394
-
395
- }).trigger('input');
396
-
397
- // OVERLAY SELECTION
398
- gradientIni( jQuery('.cmp-coming-soon-maintenance .background-overlay').val() );
399
-
400
- jQuery('.cmp-coming-soon-maintenance .background-overlay').on('change', function() {
401
- gradientIni( jQuery(this).val() );
402
-
403
- });
404
-
405
- function gradientIni( gradient_type ) {
406
- switch ( gradient_type ) {
407
- case 'solid-color' :
408
- jQuery('.thumbnail-overlay').css('background', jQuery('#niteoCS_overlay_color').val() );
409
- break;
410
-
411
- case 'gradient' :
412
- jQuery('.cmp-coming-soon-maintenance select.overlay-gradient').trigger('change');
413
- break;
414
-
415
- case 'disabled' :
416
- jQuery('.cmp-coming-soon-maintenance .thumbnail-overlay').css('background', 'none');
417
- break;
418
-
419
- default:
420
- break;
421
- }
422
- }
423
-
424
-
425
- // BLUR PREVIEW
426
- jQuery( '.cmp-coming-soon-maintenance .blur-range' ).on('input', function () {
427
- var value = jQuery(this).val();
428
- jQuery('.cmp-coming-soon-maintenance .background-thumb-wrapper img:not(.no-blur)').css('filter', 'blur(' + value + 'px)');
429
-
430
- }).trigger('input');
431
-
432
- // banner pattern on change image preview
433
- jQuery('.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"]').on('change', function() {
434
- var pattern = jQuery('.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"] option:selected').val();
435
-
436
- if (pattern != 'custom') {
437
- var pattern_url = jQuery(this).data('url');
438
- jQuery('.cmp-coming-soon-maintenance #add-pattern').css('display', 'none');
439
- jQuery('.cmp-coming-soon-maintenance .pattern-wrapper').css('background-image', 'url(\''+pattern_url+pattern+'.png\')');
440
-
441
- } else {
442
- var pattern_url = jQuery('.cmp-coming-soon-maintenance #niteoCS_banner_pattern_custom').val();
443
- jQuery('.cmp-coming-soon-maintenance #add-pattern').css('display', 'block');
444
- jQuery('.cmp-coming-soon-maintenance .pattern-wrapper').css('background-image', 'url(\''+pattern_url+'\')');
445
-
446
- }
447
- });
448
-
449
- // preview animation
450
- jQuery('.cmp-coming-soon-maintenance .heading-animation').on('change', function() {
451
- heading_anim = jQuery('.cmp-coming-soon-maintenance .heading-animation option:selected').val();
452
- jQuery('.cmp-coming-soon-maintenance #heading-example').removeClass().addClass('animated ' + heading_anim);
453
- });
454
-
455
- jQuery('.cmp-coming-soon-maintenance .content-animation').on('change', function() {
456
- heading_anim = jQuery('.cmp-coming-soon-maintenance .content-animation option:selected').val();
457
- jQuery('.cmp-coming-soon-maintenance #content-example').removeClass().addClass('animated ' + heading_anim);
458
- });
459
-
460
- // ----------------------- sortable social list -----------------------
461
- // function to update social list
462
- var update_social = function(name, key, val){
463
- var socialmedia = $('.cmp-coming-soon-maintenance #niteoCS_socialmedia').attr('value');
464
- socialmedia = $.parseJSON(socialmedia);
465
-
466
- $.each(socialmedia, function(i, ele){
467
- if (ele['name'] == name) {
468
- ele[key] = val;
469
- }
470
- });
471
-
472
- $('.cmp-coming-soon-maintenance #niteoCS_socialmedia').attr('value', JSON.stringify(socialmedia));
473
- };
474
-
475
-
476
-
477
- // sortable UI - disabled on Mobile phones - input elements where not clickable...
478
- if ( !/Mobi/.test(navigator.userAgent) ) {
479
- var $sortableList = $('.cmp-coming-soon-maintenance .social-inputs');
480
-
481
- var sortEventHandler = function(event, ui){
482
-
483
- var inputs = $sortableList.find('input[type="text"]');
484
-
485
- var order = ui.item.index();
486
-
487
- inputs.each(function(i, ele){
488
- var name = $(ele).data('name');
489
- update_social(name, 'order', i);
490
- });
491
- };
492
-
493
- $sortableList.sortable({
494
- stop: sortEventHandler
495
- });
496
-
497
- $sortableList.on('sortchange', sortEventHandler);
498
- }
499
-
500
- // social checkbox to enable/disable input
501
- (function($) {
502
- $.fn.toggleDisabled = function() {
503
- return this.each(function() {
504
- var $this = $(this);
505
- var active;
506
- var name = $this.data('name');
507
- if ($this.attr('disabled')) {
508
- $this.prop('disabled', false);
509
- active = '1';
510
- } else {
511
- $this.prop('disabled', true);
512
- active = '0';
513
- }
514
- update_social(name, 'active', active);
515
- });
516
- };
517
- })(jQuery);
518
-
519
- jQuery('.cmp-coming-soon-maintenance .social-inputs input[type="text"]').focusout(function(){
520
- var name = jQuery(this).data('name');
521
- var socialurl = jQuery(this).attr('value');
522
- update_social(name, 'url', socialurl);
523
- });
524
-
525
- jQuery('.cmp-coming-soon-maintenance .social-inputs input[type="checkbox"]').click(function(e){
526
- var $this = $(this).siblings('input[type="text"]');
527
- $this.toggleDisabled();
528
- });
529
-
530
- // social icons active/inactive
531
- jQuery('.cmp-coming-soon-maintenance .social-media i').click(function() {
532
- var name = jQuery(this).data('name');
533
- jQuery(this).toggleClass('active');
534
- jQuery('.cmp-coming-soon-maintenance .social-inputs li.' + name).toggleClass('active');
535
- jQuery('.cmp-coming-soon-maintenance .social-inputs li.' + name + ' input').trigger('change');
536
-
537
- if (jQuery(this).hasClass('active')) {
538
- update_social(name, 'hidden', '0');
539
- } else {
540
- update_social(name, 'hidden', '1');
541
- }
542
- // hide/show input labels
543
- if (jQuery('.cmp-coming-soon-maintenance .social-media i.active').length) {
544
- jQuery('.social-inputs .label').css('display', 'block');
545
- } else {
546
- jQuery('.cmp-coming-soon-maintenance .social-inputs .label').css('display', 'none');
547
- }
548
- });
549
-
550
- // hide/show input labels
551
- if (jQuery('.cmp-coming-soon-maintenance .social-media i.active').length) {
552
- jQuery('.cmp-coming-soon-maintenance .social-inputs .label').css('display', 'block');
553
- }
554
-
555
- // theme update admin notice view release notes
556
- // jQuery('.cmp-coming-soon-maintenance .view-release').click(function(e) {
557
- // e.preventDefault();
558
- // $this = jQuery(this);
559
- // var release_url = $this.attr('href');
560
-
561
- // jQuery.get(release_url, function( release ) {
562
- // $this.closest('.notice').find('.release-note .notes').remove();
563
- // $this.closest('.notice').find('.release-note').append('<div class="notes">'+release+'</div>');
564
-
565
- // }).fail(function() {
566
- // $this.closest('.notice').find('.release-note p').remove();
567
- // $this.closest('.notice').find('.release-note').append('<p>There was an error loading release notes. Please try again later.</p>');
568
- // });
569
- // });
570
-
571
- // theme update via admin notice
572
- jQuery('.cmp.update-theme').click(function(e) {
573
- e.preventDefault();
574
- var $this = $(this),
575
- $parent = $this.parents('.notice'),
576
- security = $this.data('security'),
577
- slug = $this.data('slug'),
578
- themeName = $this.data('name'),
579
- remoteUrl = jQuery(this).data('remote_url');
580
- var update = {
581
- 'name': slug,
582
- 'tmp_name': '',
583
- 'url': remoteUrl+'?action=download&slug='+slug,
584
- }
585
-
586
- var data = {
587
- action: 'cmp_theme_update_install',
588
- security: security,
589
- file: update
590
- };
591
-
592
- $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>');
593
-
594
- $.post(ajaxurl, data, function(response) {
595
- response = response.trim();
596
-
597
- if ( response == 'success' ) {
598
- setTimeout(function(){
599
- $parent.removeClass('notice-warning').addClass('notice-success');
600
- $parent.find('.message').html('<span> '+themeName+' CMP theme was updated sucessfully! You can enjoy latest features now :) </span><i class="fa fa-smile-o" aria-hidden="true"></i>');
601
- }, 1500);
602
-
603
- } else {
604
- response = response.slice(0,-1);
605
- var error = $('p', $(response)).text();
606
- $parent.removeClass('notice-warning').addClass('notice-error');
607
- $parent.find('.message').html('<i class="fa fa-frown-o" aria-hidden="true"></i><span> '+error+'</span>');
608
- }
609
- });
610
- });
611
-
612
- // theme-selector scripts
613
- // select theme by click on thumbnail or select button
614
- jQuery('.cmp-coming-soon-maintenance .theme-select').click(function(){
615
- jQuery(this).parent().find('input[name="niteoCS_select_theme"]').prop("checked", true).trigger('change');
616
- jQuery('.cmp-coming-soon-maintenance .theme-select').removeClass('selected');
617
- jQuery(this).parent().find('.theme-select').addClass('selected');
618
- });
619
-
620
- // theme update via theme button
621
- jQuery('.cmp-coming-soon-maintenance .theme-update.button').one('click',function(e) {
622
- e.preventDefault();
623
- var $this = $(this),
624
- $wrapper = $this.closest('.theme-wrapper'),
625
- security = $wrapper.data('security'),
626
- slug = $wrapper.data('slug'),
627
- remoteUrl = $wrapper.data('remote_url');
628
-
629
- var update = {
630
- 'name': slug,
631
- 'tmp_name': '',
632
- 'url': remoteUrl+'?action=download&slug='+slug,
633
- }
634
-
635
- var data = {
636
- action: 'cmp_theme_update_install',
637
- security: security,
638
- file: update
639
- };
640
-
641
- $this.html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>');
642
-
643
- $.post(ajaxurl, data, function(response) {
644
- if ( response == 'success' ) {
645
- setTimeout(function(){
646
- $this.html('<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>');
647
- setTimeout(function(){
648
- $this.fadeOut();
649
- }, 1500);
650
- }, 1500);
651
-
652
- } else {
653
- response = response.slice(0,-1);
654
- $this.html('<i class="fa fa-frown-o" aria-hidden="true"></i><span>Update Failed!</span>');
655
- }
656
- });
657
- });
658
-
659
- // display theme details overlay
660
- jQuery('.cmp-coming-soon-maintenance .theme-details').click(function() {
661
-
662
- var $this = $(this),
663
- $wrapper = $this.closest('.theme-wrapper'),
664
- slug = $wrapper.data('slug'),
665
- version = $wrapper.data('version'),
666
- remoteUrl = $wrapper.data('remote_url'),
667
- type = $wrapper.data('type'),
668
- purchased = $wrapper.data('purchased'),
669
- freebie = $wrapper.data('freebie'),
670
- noticeHtml = '',
671
- security = jQuery('.update-theme').data('security'),
672
- price = $wrapper.data('price'),
673
- i = 0;
674
-
675
- var data = {
676
- action: 'niteo_themeinfo',
677
- security: jQuery('.theme-wrapper').data('security'),
678
- theme_slug: jQuery(this).parents('.theme-wrapper').data('slug'),
679
- };
680
-
681
- $.post(ajaxurl, data, function(response) {
682
- var buttonDisabled = '';
683
- var buyButton = '';
684
- var versionInfo = '';
685
- var noticeHtml = '';
686
- // parse JSON data to array
687
- response = jQuery.parseJSON(response);
688
-
689
- if ( response.result == 'true' ) {
690
- // overflow body hidden
691
- jQuery('body').addClass('modal-open');
692
-
693
- // if installed display version info
694
- if ( purchased == '1') {
695
-
696
- versionInfo = '<span class="theme-version">Version: '+version+'</span>';
697
- noticeHtml = '<div class="notice notice-success notice-alt notice-large"><p>Theme is up to date.</p></div>';
698
- if ( jQuery('.update-theme').length ) {
699
-
700
- var updateSlug = jQuery('.update-theme').data('slug');
701
-
702
- if ( slug == updateSlug ) {
703
- var newVer = jQuery('.update-theme').data('new_ver');
704
- 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+'" class="update-theme" data-security="'+security+'" data-slug="'+slug+'" data-remote_url="'+remoteUrl+'">Update now.</a></strong></p><div class="release-note"></div></div>';
705
- }
706
- }
707
- }
708
-
709
- // if premium and not installed, display buy button
710
- if ( purchased != '1' && type == 'premium' ){
711
- var buttonDisabled = 'disabled ';
712
- var buyURL = $wrapper.find('a').attr('href');
713
- 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>Get Theme</a></button>';
714
- }
715
-
716
- // get screenshots
717
- var screenshots = response.screenshots;
718
- var arrows = '';
719
- // if we have more screenshots, generate navigation arrows
720
- if ( Object.keys(screenshots).length > 1 ) {
721
- 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>';
722
- }
723
-
724
- // generate html to append to theme-overlay
725
- var html = $([
726
- '<div class="theme-backdrop">',
727
- ' <div class="theme-wrap">',
728
- ' <div class="theme-header">',
729
- ' <button class="close dashicons dashicons-no"><span class="screen-reader-text">Close details dialog</span></button>',
730
- ' </div>',
731
- ' <div class="theme-about">',
732
- ' <div class="theme-screenshots">',
733
- ' <div class="screenshot" style="background-image:url(\''+screenshots['0']+'\')">'+arrows+'</div>',
734
- ' </div>',
735
- ' <div class="theme-info">',
736
- ' <h2 class="theme-name">'+response['name'] + versionInfo + '</h2>',
737
- ' <p class="theme-author">By <a href="'+response['author_homepage']+'" target="_blank">'+response['author']+'</a></p>',
738
- noticeHtml,
739
- buyButton,
740
- ' <div class="theme-description">'+response['description']+'</div>',
741
- ' </div>',
742
- ' </div>',
743
- ' <div class="theme-actions">',
744
- ' <button type="submit" '+buttonDisabled+'class="button activate" name="Submit" aria-label="Select '+response['name']+'">Activate</button>',
745
- ' <a href="http://cmp.niteothemes.com/?cmp_preview=true&selector=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>',
746
- ' </div>',
747
- ' </div>',
748
- '</div>',
749
- ].join("\n"));
750
-
751
- // append html to overlay
752
- jQuery('.theme-overlay.cmp').append(html);
753
-
754
- // attach view-release handler
755
- jQuery('.theme-overlay.cmp .view-release').click(function(e) {
756
- e.preventDefault();
757
- $this = jQuery(this);
758
- var release_url = $this.attr('href');
759
- jQuery.get(release_url, function( release ) {
760
- $this.closest('.notice').find('.release-note .notes').remove();
761
- $this.closest('.notice').find('.release-note').append('<div class="notes">'+release+'</div>');
762
- }).fail(function() {
763
- $this.closest('.notice').find('.release-note p').remove();
764
- $this.closest('.notice').find('.release-note').append('<p>There was an error loading release notes. Please try again later.</p>');
765
- });
766
- });
767
-
768
- // attach close button handler
769
- jQuery('.theme-overlay.cmp .close').click(function(e) {
770
- e.preventDefault();
771
- // overflow body hidden
772
- jQuery('body').removeClass('modal-open');
773
- jQuery('.theme-overlay.cmp .theme-backdrop').fadeOut('fast');
774
- });
775
-
776
- // attach select theme handler
777
- jQuery('.theme-overlay.cmp .activate').click(function(e) {
778
- e.preventDefault();
779
- // select theme
780
- jQuery('.cmp-coming-soon-maintenance input[name="niteoCS_select_theme"]').each(function() {
781
- if ( jQuery(this).val() == slug ) {
782
- jQuery(this).prop('checked', true);
783
- jQuery('.theme-select').removeClass('selected');
784
- jQuery(this).parent().addClass('selected');
785
- }
786
- });
787
-
788
- jQuery( this ).submit();
789
- });
790
-
791
- // attach arrows navigation handler
792
- jQuery('.screenshots-nav .right').click(function() {
793
- i++;
794
-
795
- if (i == Object.keys(screenshots).length) {
796
- i = 0;
797
- }
798
-
799
- if ((i in screenshots)) {
800
- jQuery('.screenshot').css('background-image', 'url(\''+screenshots[i]+'\')');
801
- }
802
- });
803
-
804
- // attach arrows navigation handler
805
- jQuery('.screenshots-nav .left').click(function() {
806
- i--;
807
-
808
- if (i < 0) {
809
- i = Object.keys(screenshots).length - 1;
810
- }
811
-
812
- if ((i in screenshots)) {
813
- jQuery('.screenshot').css('background-image', 'url(\''+screenshots[i]+'\')');
814
- }
815
- });
816
- }
817
- });
818
-
819
- });
820
-
821
- // define functions //
822
- function ucwords (str) {
823
- return (str + '').replace(/^([a-z])|\s+([a-z])/g, function ($1) {
824
- return $1.toUpperCase();
825
- });
826
- }
827
-
828
- function strtolower (str) {
829
- return (str+'').toLowerCase();
830
- }
831
-
832
- function media_upload_button (name, multiple, type, element) {
833
- // define var
834
- var $container = jQuery('.'+name+'-wrapper');
835
- var $add_button = jQuery('#add-'+name);
836
- var $delete_button = jQuery('#delete-'+name);
837
- var image;
838
- var imgID = '';
839
- var title = name.replace('-', ' ');
840
- title = title[0].toUpperCase() + title.slice(1);
841
-
842
- if ( jQuery('#niteoCS-'+name+'-id').val() != '' ) {
843
- // Display Delete button
844
- $delete_button.css( 'display', 'block' );
845
- }
846
-
847
- $add_button.click(function(e) {
848
- e.preventDefault();
849
- // If the media frame already exists, reopen it.
850
- if ( media_uploader ) {
851
- media_uploader.open();
852
- return;
853
- }
854
-
855
- var media_uploader = wp.media({
856
- title: 'Select '+ title,
857
- button: {
858
- text: 'Insert '+ title
859
- },
860
- multiple: multiple, // Set this to true to allow multiple files to be selected
861
- library: {
862
- type: [ type ]
863
- },
864
- })
865
- .on('select', function() {
866
- // Get media attachment details from the frame state
867
- var attachment = media_uploader.state().get('selection').toJSON();
868
-
869
- if ( attachment.length > 0 ) {
870
- $container.find('img').remove();
871
-
872
- // remove and add gallery count class
873
- $container.attr('class', name + '-wrapper custom-gallery');
874
- $container.addClass('gallery-' + attachment.length);
875
-
876
- // get images ID, append thumbnail and store IDs in hidden input
877
- jQuery(attachment).each(function(i) {
878
- if (attachment[i].sizes && attachment[i].sizes.large) {
879
- image = attachment[i].sizes.large.url;
880
- } else {
881
- image = attachment[i].url;
882
- }
883
-
884
- // add image ID and url to comma-separated variable
885
- var comma = ( i === 0 ) ? '' : ',';
886
- imgID += ( comma + attachment[i].id );
887
-
888
- // Send the attachment URL to our custom image input field.
889
- switch ( element ) {
890
- case 'video':
891
- $container.append( '<video width="600" height="400" controls><source src="'+image+'" type="video/mp4">Your browser does not support the video tag.</video>' );
892
- break;
893
-
894
- case 'background':
895
- $container.css('background-image', 'url(\''+image+'\')');
896
- break;
897
-
898
- case 'img':
899
- default:
900
- // if gallery - more than one image, it must be a graphic background, attach the first image to big coontainer
901
- if ( attachment.length > 1 && i == 0 ) {
902
- jQuery('.big-thumb').append( '<img src="' + image + '" alt=""/>' );
903
-
904
- // if gallery - more than one image, it must be a graphic background, attach all others images to normal wrapper
905
- } else if ( attachment.length > 1 && i !== 0 ) {
906
- $container.append( '<img src="' + image + '" alt="" class="no-blur"/>' );
907
-
908
- // if single image, and it is a background image, attach it to big container as well
909
- } else if ( $container.find('.big-thumb').length ) {
910
- jQuery('.big-thumb').append( '<img src="' + image + '" alt=""/>' );
911
-
912
- // all others images
913
- } else {
914
- $container.append( '<img src="' + image + '" alt=""/>' );
915
- }
916
-
917
- jQuery( '.blur-range' ).trigger('input');
918
- break;
919
- }
920
-
921
- });
922
-
923
- // Display Delete button
924
- $delete_button.css( 'display', 'block' );
925
-
926
- }
927
- // update hidden input with media id and trigger change
928
- jQuery('#niteoCS-'+name+'-id').val( imgID ).trigger('change');
929
-
930
- })
931
- .open();
932
- });
933
-
934
- $delete_button.click(function(e) {
935
- jQuery(this).css('display', 'none');
936
- $container.find('img').remove();
937
- jQuery('#niteoCS-'+name+'-id').val('');
938
- jQuery('#niteoCS-'+name+'-id').trigger('change');
939
- });
940
- }
941
-
942
- // Retrieve Mailchimp lists
943
- jQuery('.cmp-coming-soon-maintenance #connect-mailchimp').click(function(e){
944
- e.preventDefault();
945
-
946
- var apikey = jQuery('.cmp-coming-soon-maintenance input[name="niteoCS_mailchimp_apikey"]').val(),
947
- security = jQuery(this).data('security'),
948
- button = jQuery(this);
949
-
950
- if ( apikey != '' ) {
951
-
952
- var params = {apikey: apikey, security: security};
953
-
954
- jQuery(this).prop('disabled', true);
955
-
956
- jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> retrieving lists..</span>');
957
-
958
- var data = {
959
- action: 'cmp_mailchimp_list_ajax',
960
- security: security,
961
- params: params,
962
- };
963
-
964
- $.post(ajaxurl, data, function(response) {
965
- var lists = JSON.parse(response);
966
-
967
- if ( lists.response == 200 ) {
968
-
969
- $('#niteoCS_mailchimp_list').empty().prop('disabled', false);
970
- $.each(lists.lists, function(i,val) {
971
- $('#niteoCS_mailchimp_list').append('<option value="'+val.id+'">'+val.name+'</option>');
972
- });
973
-
974
- } else {
975
- $('#niteoCS_mailchimp_list').empty().prop('disabled', true).html('<option value="error">'+lists.message+'</option>').trigger('change');
976
- }
977
-
978
- button.html('Retrieve Lists');
979
- button.prop('disabled', false);
980
-
981
- }).fail(function() {
982
-
983
- button.html('Retrieve Lists');
984
- button.prop('disabled', false);
985
- });
986
- }
987
- });
988
-
989
- function toggle_settings ( classname ) {
990
- // Logo type inputs
991
- jQuery('.cmp-coming-soon-maintenance .' + classname).change(function() {
992
-
993
- var value = jQuery('.cmp-coming-soon-maintenance .' + classname + ':checked' ).val();
994
- value = ( jQuery.isNumeric(value) ) ? 'x' + value : value;
995
- value = ( value === undefined ) ? 'off' : value;
996
-
997
- jQuery('.cmp-coming-soon-maintenance .' + classname + '-switch.' + value).css('display','block');
998
- jQuery('.cmp-coming-soon-maintenance .' + classname + '-switch:not(.' + value + ')').css('display','none');
999
-
1000
- });
1001
-
1002
- jQuery('.cmp-coming-soon-maintenance .'+classname).first().trigger('change');
1003
- }
1004
-
1005
- function toggle_select ( classname ) {
1006
-
1007
- jQuery('.cmp-coming-soon-maintenance .'+classname).change(function() {
1008
- var value = jQuery('.'+classname ).val();
1009
- value = ( jQuery.isNumeric(value) ) ? 'x' + value : value;
1010
-
1011
- jQuery('.cmp-coming-soon-maintenance .' + classname + '.' + value).css('display','block');
1012
- jQuery('.cmp-coming-soon-maintenance .' + classname + ':not(.' + value + ')').css('display','none');
1013
-
1014
- });
1015
-
1016
- jQuery('.'+classname).first().trigger('change');
1017
- }
1018
-
1019
- function update_range ( selector, target, method ) {
1020
- jQuery( selector ).on('input', function () {
1021
- var value = jQuery(this).val();
1022
- // change label value
1023
- if ( method === 'html' ) {
1024
- jQuery(this).parent().find(target).html(value);
1025
- }
1026
-
1027
- if ( method === 'val' ) {
1028
- jQuery(this).parent().find(target).val(value);
1029
- }
1030
- });
1031
- }
1032
-
1033
- // delete overlay color from premium themes after update 2.8
1034
- jQuery('.cmp-coming-soon-maintenance .table-wrapper.theme-setup h4').each( function() {
1035
- if ( jQuery(this).html() == 'Overlay Color' ) {
1036
- jQuery(this).parents('tr').remove();
1037
- return false;
1038
- }
1039
- });
1040
-
1041
- // ini custom css textarea to codeEditor
1042
- if ( wp.codeEditor ) {
1043
- wp.codeEditor.initialize('niteoCS_custom_css');
1044
- }
1045
-
1046
- // warn users about unsaved changes for preview
1047
- $('.nav-tab-wrapper').on('click', '.theme-preview', function(e) {
1048
- if ( $('#csoptions fieldset:not(.skip-preview-validation *)').serialize() != settings) {
1049
-
1050
- if (!confirm('You have made changes that will not be visible in the preview until you save them. Please save changes first.\nContinue anyway?')) {
1051
- e.preventDefault();
1052
- return false;
1053
- }
1054
- }
1055
-
1056
- return true;
1057
-
1058
- });
1059
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+ var tab = document.location.hash.substring(1);
3
+ var action = jQuery("#csoptions").attr("action");
4
+ var settings = $(
5
+ "#csoptions fieldset:not(.skip-preview-validation *)"
6
+ ).serialize();
7
+
8
+ // function to tab navigation
9
+ navtab = function(tab) {
10
+ jQuery(
11
+ ".cmp-coming-soon-maintenance .nav-tab-wrapper .nav-tab"
12
+ ).removeClass("nav-tab-active");
13
+ jQuery(".nav-tab-wrapper ." + tab).addClass("nav-tab-active");
14
+
15
+ jQuery(".cmp-coming-soon-maintenance .table-wrapper." + tab).css(
16
+ "display",
17
+ "block"
18
+ );
19
+ jQuery(".cmp-coming-soon-maintenance .table-wrapper-css." + tab).css(
20
+ "display",
21
+ "block"
22
+ );
23
+ jQuery(".cmp-coming-soon-maintenance .comingsoon." + tab).css(
24
+ "display",
25
+ "block"
26
+ );
27
+
28
+ jQuery(".cmp-coming-soon-maintenance .table-wrapper:not(." + tab + ")").css(
29
+ "display",
30
+ "none"
31
+ );
32
+ jQuery(".cmp-coming-soon-maintenance .table-wrapper-css:not(." + tab).css(
33
+ "display",
34
+ "none"
35
+ );
36
+ jQuery(".cmp-coming-soon-maintenance .comingsoon:not(." + tab + ")").css(
37
+ "display",
38
+ "none"
39
+ );
40
+
41
+ if (tab == "install") {
42
+ jQuery(".cmp-coming-soon-maintenance .submit").css("display", "none");
43
+ jQuery(".cmp-coming-soon-maintenance #csoptions").attr("action", action);
44
+ } else {
45
+ jQuery(".cmp-coming-soon-maintenance .submit").css("display", "block");
46
+ // change form action to display current tab after save
47
+ jQuery(".cmp-coming-soon-maintenance #csoptions").attr(
48
+ "action",
49
+ action + "#" + tab
50
+ );
51
+ }
52
+ };
53
+
54
+ if (tab != "") {
55
+ navtab(tab);
56
+ } else {
57
+ jQuery(".cmp-coming-soon-maintenance .table-wrapper-css").css(
58
+ "display",
59
+ "none"
60
+ );
61
+ }
62
+
63
+ window.onhashchange = function() {
64
+ tab = document.location.hash.substring(1);
65
+ navtab(tab);
66
+ };
67
+
68
+ $(".cmp-coming-soon-maintenance .nav-tab:not(.theme-preview)").click(function(
69
+ e
70
+ ) {
71
+ e.preventDefault();
72
+ tab = $(this).data("tab");
73
+ document.location.hash = tab;
74
+ });
75
+
76
+ // update range inputs on change
77
+ update_range(".cmp-coming-soon-maintenance .blur-range", "span", "html");
78
+ update_range(
79
+ ".cmp-coming-soon-maintenance .background-overlay-opacity",
80
+ "span",
81
+ "html"
82
+ );
83
+ update_range("#logo_size_slider", "#niteoCS_logo_size", "val");
84
+ update_range("#niteoCS_logo_size", "#logo_size_slider", "val");
85
+
86
+ // create media upload buttons
87
+ // selector, multipe, type, element to render
88
+ media_upload_button("logo", false, "image", "img");
89
+ media_upload_button("favicon", false, "image", "img");
90
+ media_upload_button("seo_img", false, "image", "img");
91
+ media_upload_button("images", true, "image", "img");
92
+ media_upload_button("pattern", false, "image", "background");
93
+ media_upload_button("video-thumb", false, "image", "img");
94
+ media_upload_button("video-local", false, "video", "video");
95
+
96
+ // show / hide settings
97
+ toggle_settings("analytics");
98
+ toggle_settings("contact-form");
99
+ toggle_settings("subscribe");
100
+ toggle_settings("background-effect");
101
+ toggle_settings("special-effect");
102
+ toggle_settings("cmp-logo");
103
+ toggle_settings("background-type");
104
+ toggle_settings("counter");
105
+ toggle_settings("overlay-text");
106
+ toggle_settings("cmp-logo-size");
107
+
108
+ toggle_select("counter-action");
109
+ toggle_select("subscribe-method");
110
+ toggle_select("background-overlay");
111
+ toggle_select("banner-video-source");
112
+
113
+ // change all selects to select2
114
+ jQuery(
115
+ ".cmp-coming-soon-maintenance select:not(.headings-google-font):not(.content-google-font )"
116
+ ).select2({
117
+ width: "100%",
118
+ minimumResultsForSearch: -1,
119
+ placeholder: "Click to select.."
120
+ });
121
+
122
+ jQuery(".cmp-coming-soon-maintenance #cmp-status").click(function() {
123
+ jQuery(".cmp-coming-soon-maintenance .cmp-status input[type=radio]").prop(
124
+ "disabled",
125
+ function(_, val) {
126
+ return !val;
127
+ }
128
+ );
129
+ jQuery("#cmp-toggle-adminbar").toggleClass("status-1");
130
+ });
131
+
132
+ cmp_status_inputs();
133
+
134
+ function cmp_status_inputs() {
135
+ // Make clickable status radio buttons
136
+ jQuery(
137
+ ".cmp-coming-soon-maintenance .cmp-status.switch:not(.disabled)"
138
+ ).click(function() {
139
+ if (
140
+ jQuery(".cmp-coming-soon-maintenance #cmp-status").prop("checked") ==
141
+ false
142
+ ) {
143
+ return;
144
+ }
145
+ var $children = jQuery(this).children("input");
146
+ $children.prop("checked", true);
147
+ jQuery(".cmp-coming-soon-maintenance .cmp-status.switch").removeClass(
148
+ "active"
149
+ );
150
+ jQuery(this).addClass("active");
151
+
152
+ $children.trigger("change");
153
+
154
+ if ($children.val() == "3") {
155
+ jQuery(".cmp-coming-soon-maintenance .redirect-inputs").fadeIn("fast");
156
+ } else {
157
+ jQuery(".cmp-coming-soon-maintenance .redirect-inputs").fadeOut("fast");
158
+ }
159
+ });
160
+ }
161
+
162
+ // expandable tabs
163
+ jQuery(".cmp-coming-soon-maintenance .table-wrapper h3").click(function() {
164
+ jQuery(this)
165
+ .parent()
166
+ .toggleClass("closed");
167
+ });
168
+
169
+ // test unsplash image
170
+ jQuery(".cmp-coming-soon-maintenance #test-unsplash").click(function(e) {
171
+ e.preventDefault();
172
+
173
+ var media_wrapper = jQuery(".cmp-coming-soon-maintenance #unsplash-media"),
174
+ unsplash_feed = jQuery(
175
+ '.cmp-coming-soon-maintenance .unsplash_banner select[name^="unsplash_feed"] option:selected'
176
+ ).val(),
177
+ unsp_url = "",
178
+ feat = "",
179
+ custom_str = "",
180
+ security = jQuery(this).data("security");
181
+
182
+ // return if not specific unsplash photo selected - throttling due too much requests
183
+ if (unsplash_feed != 0) return;
184
+
185
+ switch (unsplash_feed) {
186
+ // specific photo
187
+ case "0":
188
+ unsp_url = jQuery(
189
+ ".cmp-coming-soon-maintenance #niteoCS-unsplash-0"
190
+ ).val();
191
+ break;
192
+
193
+ default:
194
+ break;
195
+ }
196
+
197
+ if (unsplash_feed == 3 || unsp_url != "" || custom_str != "") {
198
+ var params = {
199
+ feed: unsplash_feed,
200
+ url: unsp_url,
201
+ feat: feat,
202
+ custom_str: custom_str
203
+ };
204
+
205
+ jQuery(this).prop("disabled", true);
206
+ jQuery(this).html(
207
+ '<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>'
208
+ );
209
+ // media_wrapper.html('');
210
+
211
+ var data = {
212
+ action: "niteo_unsplash",
213
+ security: security,
214
+ params: params
215
+ };
216
+
217
+ $.post(ajaxurl, data, function(response) {
218
+ var unsplash = JSON.parse(response);
219
+
220
+ jQuery("#unsplash_img").remove();
221
+
222
+ var loadingTimeout = setTimeout(function() {
223
+ jQuery("#test-unsplash").prop("disabled", false);
224
+ jQuery("#test-unsplash").text("Display Unsplash Photo");
225
+ jQuery("#unsplash-media").html(
226
+ '<p>It seems <a href="https://status.unsplash.com/" target="_blank">Unsplash API</a> is not responding. Please try again later.</p>'
227
+ );
228
+ }, 5000);
229
+
230
+ if (unsplash.response == "200") {
231
+ var unsplash = jQuery.parseJSON(unsplash.body);
232
+
233
+ if (unsplash[0]) {
234
+ var img =
235
+ unsplash[0]["urls"]["raw"] +
236
+ "?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588";
237
+ var author = unsplash[0]["user"]["name"];
238
+ var author_url = unsplash[0]["user"]["links"]["html"];
239
+ var img_url = unsplash[0]["links"]["html"];
240
+ var img_id = unsplash[0]["id"];
241
+ } else {
242
+ var img =
243
+ unsplash["urls"]["raw"] +
244
+ "?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588";
245
+ var author = unsplash["user"]["name"];
246
+ var author_url = unsplash["user"]["links"]["html"];
247
+ var img_url = unsplash["links"]["html"];
248
+ var img_id = unsplash["id"];
249
+ }
250
+
251
+ jQuery("<img />", { src: img, id: "unsplash_img" }).one(
252
+ "load",
253
+ function() {
254
+ //Set something to run when it finishes loading
255
+ jQuery(this).appendTo(media_wrapper);
256
+ jQuery(this).fadeIn();
257
+ jQuery("#test-unsplash").prop("disabled", false);
258
+ jQuery("#test-unsplash").text("Display Unsplash Photo");
259
+ jQuery(".unsplash-id").html(
260
+ '<a href="' +
261
+ img_url +
262
+ '" target="_blank">Photo</a> (ID: ' +
263
+ img_id +
264
+ ') by <a href="' +
265
+ author_url +
266
+ '" target="_blank">' +
267
+ author +
268
+ '</a> / <a href="https://unsplash.com/" target="_blank">Unsplash</a>'
269
+ );
270
+ jQuery(".blur-range").trigger("input");
271
+ clearTimeout(loadingTimeout);
272
+ }
273
+ );
274
+ } else {
275
+ jQuery(".cmp-coming-soon-maintenance #test-unsplash").prop(
276
+ "disabled",
277
+ false
278
+ );
279
+ jQuery(".cmp-coming-soon-maintenance #test-unsplash").text(
280
+ "Display Unsplash Photo"
281
+ );
282
+ jQuery(".cmp-coming-soon-maintenance #unsplash-media").html(
283
+ "<p>Error " +
284
+ unsplash.response +
285
+ ': <span style="text-transform:lowercase;">' +
286
+ unsplash.body +
287
+ "</span></p>"
288
+ );
289
+ clearTimeout(loadingTimeout);
290
+ }
291
+ });
292
+ } else {
293
+ jQuery(".cmp-coming-soon-maintenance #unsplash_img").remove();
294
+ }
295
+ });
296
+
297
+ videoPreview = function() {
298
+ // return of video background is not selected
299
+ if (
300
+ jQuery(".cmp-coming-soon-maintenance .background-type:checked").val() !=
301
+ "5"
302
+ ) {
303
+ return;
304
+ }
305
+
306
+ var source = $(".cmp-coming-soon-maintenance .banner-video-source").val();
307
+
308
+ if (source == "youtube") {
309
+ var youtubeURL = $(
310
+ ".cmp-coming-soon-maintenance #niteoCS-youtube-url"
311
+ ).val();
312
+
313
+ // get YT thumbnail and append it to wrapper
314
+ if (youtubeURL != "") {
315
+ var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
316
+ var ytID = youtubeURL.match(regExp);
317
+
318
+ if (ytID && ytID[7].length == 11) {
319
+ jQuery(
320
+ ".cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper"
321
+ ).html("");
322
+ var ytThumb =
323
+ "https://img.youtube.com/vi/" + ytID[7] + "/maxresdefault.jpg";
324
+ jQuery(
325
+ ".cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper"
326
+ ).append('<img src="' + ytThumb + '" alt=""/>');
327
+ jQuery(".cmp-coming-soon-maintenance .blur-range").trigger("input");
328
+ } else {
329
+ jQuery(
330
+ ".cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper"
331
+ ).html("");
332
+ }
333
+ }
334
+ }
335
+
336
+ // append local video
337
+ if (source == "local") {
338
+ var videoURL = jQuery("#niteoCS-video-local-id").data("url");
339
+
340
+ if (videoURL != "") {
341
+ $(".cmp-coming-soon-maintenance .video-local-wrapper").html(
342
+ '<video width="600" height="400" controls><source src="' +
343
+ videoURL +
344
+ '" type="video/mp4">Your browser does not support the video tag.</video>'
345
+ );
346
+ }
347
+ }
348
+ };
349
+
350
+ // display video on load
351
+ videoPreview();
352
+
353
+ // display videos on background change to video type
354
+ jQuery(".cmp-coming-soon-maintenance .background-type").on(
355
+ "change",
356
+ function() {
357
+ videoPreview();
358
+ }
359
+ );
360
+
361
+ // display YT video while inserting YT URL
362
+ jQuery(".cmp-coming-soon-maintenance #niteoCS-youtube-url").on(
363
+ "keyup",
364
+ function() {
365
+ videoPreview();
366
+ }
367
+ );
368
+
369
+ jQuery(".cmp-coming-soon-maintenance .banner-video-source").on(
370
+ "change",
371
+ function() {
372
+ videoPreview();
373
+ }
374
+ );
375
+
376
+ // display selected unsplash feed
377
+ var unsplashfeed = jQuery(
378
+ '.unsplash_banner select[name^="unsplash_feed"] option:selected'
379
+ ).val();
380
+ jQuery(".unsplash-feed-" + unsplashfeed).css("display", "block");
381
+
382
+ jQuery('.unsplash_banner select[name^="unsplash_feed"]').on(
383
+ "change",
384
+ function() {
385
+ unsplashfeed = jQuery(
386
+ '.unsplash_banner select[name^="unsplash_feed"] option:selected'
387
+ ).val();
388
+ jQuery(".unsplash-feed").css("display", "none");
389
+ jQuery(".unsplash-feed-" + unsplashfeed).css("display", "block");
390
+ jQuery("#test-unsplash").trigger("click");
391
+ }
392
+ );
393
+
394
+ // load unsplash upon load if unsplash is selected
395
+ if (jQuery("#csoptions .niteoCS_banner:checked").val() == 1) {
396
+ jQuery("#test-unsplash").trigger("click");
397
+ }
398
+
399
+ // preview gradient on select change
400
+ jQuery(".cmp-coming-soon-maintenance select.background-gradient")
401
+ .on("change", function() {
402
+ var gradient = jQuery(
403
+ ".cmp-coming-soon-maintenance select.background-gradient option:selected"
404
+ ).val();
405
+
406
+ if (gradient == "custom") {
407
+ jQuery(".cmp-coming-soon-maintenance .custom-gradient").css(
408
+ "display",
409
+ "block"
410
+ );
411
+ jQuery(".cmp-coming-soon-maintenance .gradient-preview").css({
412
+ background:
413
+ "-moz-linear-gradient(-45deg, " +
414
+ jQuery("#niteoCS_gradient_one").val() +
415
+ " 0%, " +
416
+ jQuery("#niteoCS_gradient_two").val() +
417
+ " 100%)",
418
+ background:
419
+ "-webkit-linear-gradient(-45deg, " +
420
+ jQuery("#niteoCS_gradient_one").val() +
421
+ " 0%, " +
422
+ jQuery("#niteoCS_gradient_two").val() +
423
+ " 100%)",
424
+ background:
425
+ "linear-gradient(135deg, " +
426
+ jQuery("#niteoCS_gradient_one").val() +
427
+ " 0%, " +
428
+ jQuery("#niteoCS_gradient_two").val() +
429
+ " 100%)"
430
+ });
431
+ } else {
432
+ colors = gradient.split(":");
433
+ jQuery(".cmp-coming-soon-maintenance .custom-gradient").css(
434
+ "display",
435
+ "none"
436
+ );
437
+ jQuery(".cmp-coming-soon-maintenance .gradient-preview").css({
438
+ background:
439
+ "-moz-linear-gradient(-45deg, " +
440
+ colors[0] +
441
+ " 0%, " +
442
+ colors[1] +
443
+ " 100%)",
444
+ background:
445
+ "-webkit-linear-gradient(-45deg, " +
446
+ colors[0] +
447
+ " 0%, " +
448
+ colors[1] +
449
+ " 100%)",
450
+ background:
451
+ "linear-gradient(135deg, " +
452
+ colors[0] +
453
+ " 0%, " +
454
+ colors[1] +
455
+ " 100%)"
456
+ });
457
+ }
458
+ })
459
+ .trigger("change");
460
+
461
+ // banner background colorpicker
462
+ jQuery(".cmp-coming-soon-maintenance #niteoCS_banner_color").wpColorPicker({
463
+ change: function(event, ui) {
464
+ jQuery(".color-preview").css("background-color", ui.color.toString());
465
+ }
466
+ });
467
+
468
+ // banner gradient background colorpicker one
469
+ jQuery(".cmp-coming-soon-maintenance #niteoCS_gradient_one").wpColorPicker({
470
+ change: function(event, ui) {
471
+ jQuery(".gradient-preview").css({
472
+ background:
473
+ "-moz-linear-gradient(-45deg, " +
474
+ ui.color.toString() +
475
+ " 0%, " +
476
+ jQuery("#niteoCS_gradient_two").val() +
477
+ " 100%)",
478
+ background:
479
+ "-webkit-linear-gradient(-45deg, " +
480
+ ui.color.toString() +
481
+ " 0%, " +
482
+ jQuery("#niteoCS_gradient_two").val() +
483
+ " 100%)",
484
+ background:
485
+ "linear-gradient(135deg, " +
486
+ ui.color.toString() +
487
+ " 0%, " +
488
+ jQuery("#niteoCS_gradient_two").val() +
489
+ " 100%)"
490
+ });
491
+ }
492
+ });
493
+
494
+ // banner gradient background colorpicker two
495
+ jQuery(".cmp-coming-soon-maintenance #niteoCS_gradient_two").wpColorPicker({
496
+ change: function(event, ui) {
497
+ jQuery(".gradient-preview").css({
498
+ background:
499
+ "-moz-linear-gradient(-45deg, " +
500
+ jQuery("#niteoCS_gradient_one").val() +
501
+ " 0%, " +
502
+ ui.color.toString() +
503
+ " 100%)",
504
+ background:
505
+ "-webkit-linear-gradient(-45deg, " +
506
+ jQuery("#niteoCS_gradient_one").val() +
507
+ " 0%, " +
508
+ ui.color.toString() +
509
+ " 100%)",
510
+ background:
511
+ "linear-gradient(135deg, " +
512
+ jQuery("#niteoCS_gradient_one").val() +
513
+ " 0%, " +
514
+ ui.color.toString() +
515
+ " 100%)"
516
+ });
517
+ }
518
+ });
519
+
520
+ // OVERLAY COLOR
521
+ jQuery(".cmp-coming-soon-maintenance #niteoCS_overlay_color").wpColorPicker({
522
+ change: function(event, ui) {
523
+ jQuery(".thumbnail-overlay").css("background", ui.color.toString());
524
+ }
525
+ });
526
+
527
+ // get overlay color and apply it to Background thumbnails
528
+ jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css(
529
+ "background",
530
+ jQuery("#niteoCS_overlay_color").val()
531
+ );
532
+
533
+ // OVERLAY GRADIENT
534
+ jQuery(".cmp-coming-soon-maintenance select.overlay-gradient").on(
535
+ "change",
536
+ function() {
537
+ var overlay_gradient = jQuery(
538
+ "select.overlay-gradient option:selected"
539
+ ).val();
540
+
541
+ if (overlay_gradient == "custom") {
542
+ jQuery(".cmp-coming-soon-maintenance .custom-overlay-gradient").css(
543
+ "display",
544
+ "block"
545
+ );
546
+
547
+ var gradient_one = jQuery("#niteoCS_overlay_gradient_one").val();
548
+ var gradient_two = jQuery("#niteoCS_overlay_gradient_two").val();
549
+
550
+ jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css({
551
+ background:
552
+ "-moz-linear-gradient(-45deg, " +
553
+ gradient_one +
554
+ " 0%, " +
555
+ gradient_two +
556
+ " 100%)",
557
+ background:
558
+ "-webkit-linear-gradient(-45deg, " +
559
+ gradient_one +
560
+ " 0%, " +
561
+ gradient_two +
562
+ " 100%)",
563
+ background:
564
+ "linear-gradient(135deg, " +
565
+ gradient_one +
566
+ " 0%, " +
567
+ gradient_two +
568
+ " 100%)"
569
+ });
570
+ } else {
571
+ colors = overlay_gradient.split(":");
572
+ jQuery(".cmp-coming-soon-maintenance .custom-overlay-gradient").css(
573
+ "display",
574
+ "none"
575
+ );
576
+ jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css({
577
+ background:
578
+ "-moz-linear-gradient(-45deg, " +
579
+ colors[0] +
580
+ " 0%, " +
581
+ colors[1] +
582
+ " 100%)",
583
+ background:
584
+ "-webkit-linear-gradient(-45deg, " +
585
+ colors[0] +
586
+ " 0%, " +
587
+ colors[1] +
588
+ " 100%)",
589
+ background:
590
+ "linear-gradient(135deg, " +
591
+ colors[0] +
592
+ " 0%, " +
593
+ colors[1] +
594
+ " 100%)"
595
+ });
596
+ }
597
+ }
598
+ );
599
+
600
+ // Overlay gradient colorpicker one
601
+ jQuery("#niteoCS_overlay_gradient_one").wpColorPicker({
602
+ change: function(event, ui) {
603
+ jQuery(".thumbnail-overlay").css({
604
+ background:
605
+ "-moz-linear-gradient(-45deg, " +
606
+ ui.color.toString() +
607
+ " 0%, " +
608
+ jQuery("#niteoCS_overlay_gradient_two").val() +
609
+ " 100%)",
610
+ background:
611
+ "-webkit-linear-gradient(-45deg, " +
612
+ ui.color.toString() +
613
+ " 0%, " +
614
+ jQuery("#niteoCS_overlay_gradient_two").val() +
615
+ " 100%)",
616
+ background:
617
+ "linear-gradient(135deg, " +
618
+ ui.color.toString() +
619
+ " 0%, " +
620
+ jQuery("#niteoCS_overlay_gradient_two").val() +
621
+ " 100%)"
622
+ });
623
+ }
624
+ });
625
+
626
+ // Overlay gradient colorpicker two
627
+ jQuery("#niteoCS_overlay_gradient_two").wpColorPicker({
628
+ change: function(event, ui) {
629
+ jQuery(".thumbnail-overlay").css({
630
+ background:
631
+ "-moz-linear-gradient(-45deg, " +
632
+ jQuery("#niteoCS_overlay_gradient_one").val() +
633
+ " 0%, " +
634
+ ui.color.toString() +
635
+ " 100%)",
636
+ background:
637
+ "-webkit-linear-gradient(-45deg, " +
638
+ jQuery("#niteoCS_overlay_gradient_one").val() +
639
+ " 0%, " +
640
+ ui.color.toString() +
641
+ " 100%)",
642
+ background:
643
+ "linear-gradient(135deg, " +
644
+ jQuery("#niteoCS_overlay_gradient_one").val() +
645
+ " 0%, " +
646
+ ui.color.toString() +
647
+ " 100%)"
648
+ });
649
+ }
650
+ });
651
+
652
+ // OVERLAY OPACITY
653
+ jQuery(".background-overlay-opacity")
654
+ .on("input", function() {
655
+ var value = jQuery(this).val();
656
+ jQuery(".thumbnail-overlay").css("opacity", value);
657
+ })
658
+ .trigger("input");
659
+
660
+ // OVERLAY SELECTION
661
+ gradientIni(jQuery(".cmp-coming-soon-maintenance .background-overlay").val());
662
+
663
+ jQuery(".cmp-coming-soon-maintenance .background-overlay").on(
664
+ "change",
665
+ function() {
666
+ gradientIni(jQuery(this).val());
667
+ }
668
+ );
669
+
670
+ function gradientIni(gradient_type) {
671
+ switch (gradient_type) {
672
+ case "solid-color":
673
+ jQuery(".thumbnail-overlay").css(
674
+ "background",
675
+ jQuery("#niteoCS_overlay_color").val()
676
+ );
677
+ break;
678
+
679
+ case "gradient":
680
+ jQuery(".cmp-coming-soon-maintenance select.overlay-gradient").trigger(
681
+ "change"
682
+ );
683
+ break;
684
+
685
+ case "disabled":
686
+ jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css(
687
+ "background",
688
+ "none"
689
+ );
690
+ break;
691
+
692
+ default:
693
+ break;
694
+ }
695
+ }
696
+
697
+ // BLUR PREVIEW
698
+ jQuery(".cmp-coming-soon-maintenance .blur-range")
699
+ .on("input", function() {
700
+ var value = jQuery(this).val();
701
+ jQuery(
702
+ ".cmp-coming-soon-maintenance .background-thumb-wrapper img:not(.no-blur)"
703
+ ).css("filter", "blur(" + value + "px)");
704
+ })
705
+ .trigger("input");
706
+
707
+ // banner pattern on change image preview
708
+ jQuery(
709
+ '.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"]'
710
+ ).on("change", function() {
711
+ var pattern = jQuery(
712
+ '.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"] option:selected'
713
+ ).val();
714
+
715
+ if (pattern != "custom") {
716
+ var pattern_url = jQuery(this).data("url");
717
+ jQuery(".cmp-coming-soon-maintenance #add-pattern").css(
718
+ "display",
719
+ "none"
720
+ );
721
+ jQuery(".cmp-coming-soon-maintenance .pattern-wrapper").css(
722
+ "background-image",
723
+ "url('" + pattern_url + pattern + ".png')"
724
+ );
725
+ } else {
726
+ var pattern_url = jQuery(
727
+ ".cmp-coming-soon-maintenance #niteoCS_banner_pattern_custom"
728
+ ).val();
729
+ jQuery(".cmp-coming-soon-maintenance #add-pattern").css(
730
+ "display",
731
+ "block"
732
+ );
733
+ jQuery(".cmp-coming-soon-maintenance .pattern-wrapper").css(
734
+ "background-image",
735
+ "url('" + pattern_url + "')"
736
+ );
737
+ }
738
+ });
739
+
740
+ // preview animation
741
+ jQuery(".cmp-coming-soon-maintenance .heading-animation").on(
742
+ "change",
743
+ function() {
744
+ heading_anim = jQuery(
745
+ ".cmp-coming-soon-maintenance .heading-animation option:selected"
746
+ ).val();
747
+ jQuery(".cmp-coming-soon-maintenance #heading-example")
748
+ .removeClass()
749
+ .addClass("animated " + heading_anim);
750
+ }
751
+ );
752
+
753
+ jQuery(".cmp-coming-soon-maintenance .content-animation").on(
754
+ "change",
755
+ function() {
756
+ heading_anim = jQuery(
757
+ ".cmp-coming-soon-maintenance .content-animation option:selected"
758
+ ).val();
759
+ jQuery(".cmp-coming-soon-maintenance #content-example")
760
+ .removeClass()
761
+ .addClass("animated " + heading_anim);
762
+ }
763
+ );
764
+
765
+ // ----------------------- sortable social list -----------------------
766
+ // function to update social list
767
+ var update_social = function(name, key, val) {
768
+ var socialmedia = $(
769
+ ".cmp-coming-soon-maintenance #niteoCS_socialmedia"
770
+ ).attr("value");
771
+ socialmedia = $.parseJSON(socialmedia);
772
+
773
+ $.each(socialmedia, function(i, ele) {
774
+ if (ele["name"] == name) {
775
+ ele[key] = val;
776
+ }
777
+ });
778
+
779
+ $(".cmp-coming-soon-maintenance #niteoCS_socialmedia").attr(
780
+ "value",
781
+ JSON.stringify(socialmedia)
782
+ );
783
+ };
784
+
785
+ // sortable UI - disabled on Mobile phones - input elements where not clickable...
786
+ if (!/Mobi/.test(navigator.userAgent)) {
787
+ var $sortableList = $(".cmp-coming-soon-maintenance .social-inputs");
788
+
789
+ var sortEventHandler = function(event, ui) {
790
+ var inputs = $sortableList.find('input[type="text"]');
791
+
792
+ var order = ui.item.index();
793
+
794
+ inputs.each(function(i, ele) {
795
+ var name = $(ele).data("name");
796
+ update_social(name, "order", i);
797
+ });
798
+ };
799
+
800
+ $sortableList.sortable({
801
+ stop: sortEventHandler
802
+ });
803
+
804
+ $sortableList.on("sortchange", sortEventHandler);
805
+ }
806
+
807
+ // social checkbox to enable/disable input
808
+ (function($) {
809
+ $.fn.toggleDisabled = function() {
810
+ return this.each(function() {
811
+ var $this = $(this);
812
+ var active;
813
+ var name = $this.data("name");
814
+ if ($this.attr("disabled")) {
815
+ $this.prop("disabled", false);
816
+ active = "1";
817
+ } else {
818
+ $this.prop("disabled", true);
819
+ active = "0";
820
+ }
821
+ update_social(name, "active", active);
822
+ });
823
+ };
824
+ })(jQuery);
825
+
826
+ jQuery(
827
+ '.cmp-coming-soon-maintenance .social-inputs input[type="text"]'
828
+ ).focusout(function() {
829
+ var name = jQuery(this).data("name");
830
+ var socialurl = jQuery(this).attr("value");
831
+ update_social(name, "url", socialurl);
832
+ });
833
+
834
+ jQuery(
835
+ '.cmp-coming-soon-maintenance .social-inputs input[type="checkbox"]'
836
+ ).click(function(e) {
837
+ var $this = $(this).siblings('input[type="text"]');
838
+ $this.toggleDisabled();
839
+ });
840
+
841
+ // social icons active/inactive
842
+ jQuery(".cmp-coming-soon-maintenance .social-media i").click(function() {
843
+ var name = jQuery(this).data("name");
844
+ jQuery(this).toggleClass("active");
845
+ jQuery(
846
+ ".cmp-coming-soon-maintenance .social-inputs li." + name
847
+ ).toggleClass("active");
848
+ jQuery(
849
+ ".cmp-coming-soon-maintenance .social-inputs li." + name + " input"
850
+ ).trigger("change");
851
+
852
+ if (jQuery(this).hasClass("active")) {
853
+ update_social(name, "hidden", "0");
854
+ } else {
855
+ update_social(name, "hidden", "1");
856
+ }
857
+ // hide/show input labels
858
+ if (jQuery(".cmp-coming-soon-maintenance .social-media i.active").length) {
859
+ jQuery(".social-inputs .label").css("display", "block");
860
+ } else {
861
+ jQuery(".cmp-coming-soon-maintenance .social-inputs .label").css(
862
+ "display",
863
+ "none"
864
+ );
865
+ }
866
+ });
867
+
868
+ // hide/show input labels
869
+ if (jQuery(".cmp-coming-soon-maintenance .social-media i.active").length) {
870
+ jQuery(".cmp-coming-soon-maintenance .social-inputs .label").css(
871
+ "display",
872
+ "block"
873
+ );
874
+ }
875
+
876
+ // theme update admin notice view release notes
877
+ // jQuery('.cmp-coming-soon-maintenance .view-release').click(function(e) {
878
+ // e.preventDefault();
879
+ // $this = jQuery(this);
880
+ // var release_url = $this.attr('href');
881
+
882
+ // jQuery.get(release_url, function( release ) {
883
+ // $this.closest('.notice').find('.release-note .notes').remove();
884
+ // $this.closest('.notice').find('.release-note').append('<div class="notes">'+release+'</div>');
885
+
886
+ // }).fail(function() {
887
+ // $this.closest('.notice').find('.release-note p').remove();
888
+ // $this.closest('.notice').find('.release-note').append('<p>There was an error loading release notes. Please try again later.</p>');
889
+ // });
890
+ // });
891
+
892
+ // theme update via admin notice
893
+ jQuery(".cmp.update-theme").click(function(e) {
894
+ e.preventDefault();
895
+ var $this = $(this),
896
+ $parent = $this.parents(".notice"),
897
+ security = $this.data("security"),
898
+ slug = $this.data("slug"),
899
+ themeName = $this.data("name"),
900
+ remoteUrl = jQuery(this).data("remote_url");
901
+ var update = {
902
+ name: slug,
903
+ tmp_name: "",
904
+ url: remoteUrl + "?action=download&slug=" + slug
905
+ };
906
+
907
+ var data = {
908
+ action: "cmp_theme_update_install",
909
+ security: security,
910
+ file: update
911
+ };
912
+
913
+ $parent
914
+ .find(".message")
915
+ .html(
916
+ '<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>'
917
+ );
918
+
919
+ $.post(ajaxurl, data, function(response) {
920
+ response = response.trim();
921
+
922
+ if (response == "success") {
923
+ setTimeout(function() {
924
+ $parent.removeClass("notice-warning").addClass("notice-success");
925
+ $parent
926
+ .find(".message")
927
+ .html(
928
+ "<span> " +
929
+ themeName +
930
+ ' CMP theme was updated sucessfully! You can enjoy latest features now :) </span><i class="fa fa-smile-o" aria-hidden="true"></i>'
931
+ );
932
+ }, 1500);
933
+ } else {
934
+ response = response.slice(0, -1);
935
+ var error = $("p", $(response)).text();
936
+ $parent.removeClass("notice-warning").addClass("notice-error");
937
+ $parent
938
+ .find(".message")
939
+ .html(
940
+ '<i class="fa fa-frown-o" aria-hidden="true"></i><span> ' +
941
+ error +
942
+ "</span>"
943
+ );
944
+ }
945
+ });
946
+ });
947
+
948
+ // theme-selector scripts
949
+ // select theme by click on thumbnail or select button
950
+ jQuery(".cmp-coming-soon-maintenance .theme-select").click(function() {
951
+ jQuery(this)
952
+ .parent()
953
+ .find('input[name="niteoCS_select_theme"]')
954
+ .prop("checked", true)
955
+ .trigger("change");
956
+ jQuery(".cmp-coming-soon-maintenance .theme-select").removeClass(
957
+ "selected"
958
+ );
959
+ jQuery(this)
960
+ .parent()
961
+ .find(".theme-select")
962
+ .addClass("selected");
963
+ });
964
+
965
+ // theme update via theme button
966
+ jQuery(".cmp-coming-soon-maintenance .theme-update.button").one(
967
+ "click",
968
+ function(e) {
969
+ e.preventDefault();
970
+ var $this = $(this),
971
+ $wrapper = $this.closest(".theme-wrapper"),
972
+ security = $wrapper.data("security"),
973
+ slug = $wrapper.data("slug"),
974
+ remoteUrl = $wrapper.data("remote_url");
975
+
976
+ var update = {
977
+ name: slug,
978
+ tmp_name: "",
979
+ url: remoteUrl + "?action=download&slug=" + slug
980
+ };
981
+
982
+ var data = {
983
+ action: "cmp_theme_update_install",
984
+ security: security,
985
+ file: update
986
+ };
987
+
988
+ $this.html(
989
+ '<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'
990
+ );
991
+
992
+ $.post(ajaxurl, data, function(response) {
993
+ if (response == "success") {
994
+ setTimeout(function() {
995
+ $this.html(
996
+ '<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>'
997
+ );
998
+ setTimeout(function() {
999
+ $this.fadeOut();
1000
+ }, 1500);
1001
+ }, 1500);
1002
+ } else {
1003
+ response = response.slice(0, -1);
1004
+ $this.html(
1005
+ '<i class="fa fa-frown-o" aria-hidden="true"></i><span>Update Failed!</span>'
1006
+ );
1007
+ }
1008
+ });
1009
+ }
1010
+ );
1011
+
1012
+ // display theme details overlay
1013
+ jQuery(".cmp-coming-soon-maintenance .theme-details").click(function() {
1014
+ var $this = $(this),
1015
+ $wrapper = $this.closest(".theme-wrapper"),
1016
+ slug = $wrapper.data("slug"),
1017
+ version = $wrapper.data("version"),
1018
+ remoteUrl = $wrapper.data("remote_url"),
1019
+ type = $wrapper.data("type"),
1020
+ purchased = $wrapper.data("purchased"),
1021
+ freebie = $wrapper.data("freebie"),
1022
+ noticeHtml = "",
1023
+ security = jQuery(".update-theme").data("security"),
1024
+ price = $wrapper.data("price"),
1025
+ i = 0;
1026
+
1027
+ var data = {
1028
+ action: "niteo_themeinfo",
1029
+ security: jQuery(".theme-wrapper").data("security"),
1030
+ theme_slug: jQuery(this)
1031
+ .parents(".theme-wrapper")
1032
+ .data("slug")
1033
+ };
1034
+
1035
+ $.post(ajaxurl, data, function(response) {
1036
+ var buttonDisabled = "";
1037
+ var buyButton = "";
1038
+ var versionInfo = "";
1039
+ var noticeHtml = "";
1040
+ // parse JSON data to array
1041
+ response = jQuery.parseJSON(response);
1042
+
1043
+ if (response.result == "true") {
1044
+ // overflow body hidden
1045
+ jQuery("body").addClass("modal-open");
1046
+
1047
+ // if installed display version info
1048
+ if (purchased == "1") {
1049
+ versionInfo =
1050
+ '<span class="theme-version">Version: ' + version + "</span>";
1051
+ noticeHtml =
1052
+ '<div class="notice notice-success notice-alt notice-large"><p>Theme is up to date.</p></div>';
1053
+ if (jQuery(".update-theme").length) {
1054
+ var updateSlug = jQuery(".update-theme").data("slug");
1055
+
1056
+ if (slug == updateSlug) {
1057
+ var newVer = jQuery(".update-theme").data("new_ver");
1058
+ noticeHtml =
1059
+ '<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 ' +
1060
+ response["name"] +
1061
+ ' theme available. <a href="' +
1062
+ remoteUrl +
1063
+ "readme/" +
1064
+ slug +
1065
+ '-readme.php" class="view-release">View update ' +
1066
+ newVer +
1067
+ ' notes</a> or <a href="' +
1068
+ window.location.href +
1069
+ "&action=update-cmp-theme&theme=" +
1070
+ slug +
1071
+ '" class="update-theme" data-security="' +
1072
+ security +
1073
+ '" data-slug="' +
1074
+ slug +
1075
+ '" data-remote_url="' +
1076
+ remoteUrl +
1077
+ '">Update now.</a></strong></p><div class="release-note"></div></div>';
1078
+ }
1079
+ }
1080
+ }
1081
+
1082
+ // if premium and not installed, display buy button
1083
+ if (purchased != "1" && type == "premium") {
1084
+ var buttonDisabled = "disabled ";
1085
+ var buyURL = $wrapper.find("a").attr("href");
1086
+ var buyButton =
1087
+ '<button type="button" class="theme-purchase button hide"><a href="' +
1088
+ buyURL +
1089
+ '" target="_blank"><i class="fa fa-cart-arrow-down" aria-hidden="true"></i>Get Theme</a></button>';
1090
+ }
1091
+
1092
+ // get screenshots
1093
+ var screenshots = response.screenshots;
1094
+ var arrows = "";
1095
+ // if we have more screenshots, generate navigation arrows
1096
+ if (Object.keys(screenshots).length > 1) {
1097
+ arrows =
1098
+ '<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>';
1099
+ }
1100
+
1101
+ // generate html to append to theme-overlay
1102
+ var html = $(
1103
+ [
1104
+ '<div class="theme-backdrop">',
1105
+ ' <div class="theme-wrap">',
1106
+ ' <div class="theme-header">',
1107
+ ' <button class="close dashicons dashicons-no"><span class="screen-reader-text">Close details dialog</span></button>',
1108
+ " </div>",
1109
+ ' <div class="theme-about">',
1110
+ ' <div class="theme-screenshots">',
1111
+ ' <div class="screenshot" style="background-image:url(\'' +
1112
+ screenshots["0"] +
1113
+ "')\">" +
1114
+ arrows +
1115
+ "</div>",
1116
+ " </div>",
1117
+ ' <div class="theme-info">',
1118
+ ' <h2 class="theme-name">' +
1119
+ response["name"] +
1120
+ versionInfo +
1121
+ "</h2>",
1122
+ ' <p class="theme-author">By <a href="' +
1123
+ response["author_homepage"] +
1124
+ '" target="_blank">' +
1125
+ response["author"] +
1126
+ "</a></p>",
1127
+ noticeHtml,
1128
+ buyButton,
1129
+ ' <div class="theme-description">' +
1130
+ response["description"] +
1131
+ "</div>",
1132
+ " </div>",
1133
+ " </div>",
1134
+ ' <div class="theme-actions">',
1135
+ ' <button type="submit" ' +
1136
+ buttonDisabled +
1137
+ 'class="button activate" name="Submit" aria-label="Select ' +
1138
+ response["name"] +
1139
+ '">Activate</button>',
1140
+ ' <a href="http://cmp.niteothemes.com/?cmp_preview=true&selector=true&theme=' +
1141
+ slug +
1142
+ "&utm_source=cmp&utm_medium=referral&utm_campaign=" +
1143
+ slug +
1144
+ '" class="button cmp-preview" target="_blank" aria-label="Preview ' +
1145
+ response["name"] +
1146
+ '">Live Preview</a>',
1147
+ " </div>",
1148
+ " </div>",
1149
+ "</div>"
1150
+ ].join("\n")
1151
+ );
1152
+
1153
+ // append html to overlay
1154
+ jQuery(".theme-overlay.cmp").append(html);
1155
+
1156
+ // attach view-release handler
1157
+ jQuery(".theme-overlay.cmp .view-release").click(function(e) {
1158
+ e.preventDefault();
1159
+ $this = jQuery(this);
1160
+ var release_url = $this.attr("href");
1161
+ jQuery
1162
+ .get(release_url, function(release) {
1163
+ $this
1164
+ .closest(".notice")
1165
+ .find(".release-note .notes")
1166
+ .remove();
1167
+ $this
1168
+ .closest(".notice")
1169
+ .find(".release-note")
1170
+ .append('<div class="notes">' + release + "</div>");
1171
+ })
1172
+ .fail(function() {
1173
+ $this
1174
+ .closest(".notice")
1175
+ .find(".release-note p")
1176
+ .remove();
1177
+ $this
1178
+ .closest(".notice")
1179
+ .find(".release-note")
1180
+ .append(
1181
+ "<p>There was an error loading release notes. Please try again later.</p>"
1182
+ );
1183
+ });
1184
+ });
1185
+
1186
+ // attach close button handler
1187
+ jQuery(".theme-overlay.cmp .close").click(function(e) {
1188
+ e.preventDefault();
1189
+ // overflow body hidden
1190
+ jQuery("body").removeClass("modal-open");
1191
+ jQuery(".theme-overlay.cmp .theme-backdrop").fadeOut("fast");
1192
+ });
1193
+
1194
+ // attach select theme handler
1195
+ jQuery(".theme-overlay.cmp .activate").click(function(e) {
1196
+ e.preventDefault();
1197
+ // select theme
1198
+ jQuery(
1199
+ '.cmp-coming-soon-maintenance input[name="niteoCS_select_theme"]'
1200
+ ).each(function() {
1201
+ if (jQuery(this).val() == slug) {
1202
+ jQuery(this).prop("checked", true);
1203
+ jQuery(".theme-select").removeClass("selected");
1204
+ jQuery(this)
1205
+ .parent()
1206
+ .addClass("selected");
1207
+ }
1208
+ });
1209
+
1210
+ jQuery(this).submit();
1211
+ });
1212
+
1213
+ // attach arrows navigation handler
1214
+ jQuery(".screenshots-nav .right").click(function() {
1215
+ i++;
1216
+
1217
+ if (i == Object.keys(screenshots).length) {
1218
+ i = 0;
1219
+ }
1220
+
1221
+ if (i in screenshots) {
1222
+ jQuery(".screenshot").css(
1223
+ "background-image",
1224
+ "url('" + screenshots[i] + "')"
1225
+ );
1226
+ }
1227
+ });
1228
+
1229
+ // attach arrows navigation handler
1230
+ jQuery(".screenshots-nav .left").click(function() {
1231
+ i--;
1232
+
1233
+ if (i < 0) {
1234
+ i = Object.keys(screenshots).length - 1;
1235
+ }
1236
+
1237
+ if (i in screenshots) {
1238
+ jQuery(".screenshot").css(
1239
+ "background-image",
1240
+ "url('" + screenshots[i] + "')"
1241
+ );
1242
+ }
1243
+ });
1244
+ }
1245
+ });
1246
+ });
1247
+
1248
+ // define functions //
1249
+ function ucwords(str) {
1250
+ return (str + "").replace(/^([a-z])|\s+([a-z])/g, function($1) {
1251
+ return $1.toUpperCase();
1252
+ });
1253
+ }
1254
+
1255
+ function strtolower(str) {
1256
+ return (str + "").toLowerCase();
1257
+ }
1258
+
1259
+ function media_upload_button(name, multiple, type, element) {
1260
+ // define var
1261
+ var $container = jQuery("." + name + "-wrapper");
1262
+ var $add_button = jQuery("#add-" + name);
1263
+ var $delete_button = jQuery("#delete-" + name);
1264
+ var image;
1265
+ var imgID = "";
1266
+ var title = name.replace("-", " ");
1267
+ title = title[0].toUpperCase() + title.slice(1);
1268
+
1269
+ if (jQuery("#niteoCS-" + name + "-id").val() != "") {
1270
+ // Display Delete button
1271
+ $delete_button.css("display", "block");
1272
+ }
1273
+
1274
+ $add_button.click(function(e) {
1275
+ e.preventDefault();
1276
+ // If the media frame already exists, reopen it.
1277
+ if (media_uploader) {
1278
+ media_uploader.open();
1279
+ return;
1280
+ }
1281
+
1282
+ var media_uploader = wp
1283
+ .media({
1284
+ title: "Select " + title,
1285
+ button: {
1286
+ text: "Insert " + title
1287
+ },
1288
+ multiple: multiple, // Set this to true to allow multiple files to be selected
1289
+ library: {
1290
+ type: [type]
1291
+ }
1292
+ })
1293
+ .on("select", function() {
1294
+ // Get media attachment details from the frame state
1295
+ var attachment = media_uploader
1296
+ .state()
1297
+ .get("selection")
1298
+ .toJSON();
1299
+
1300
+ if (attachment.length > 0) {
1301
+ $container.find("img").remove();
1302
+
1303
+ // remove and add gallery count class
1304
+ $container.attr("class", name + "-wrapper custom-gallery");
1305
+ $container.addClass("gallery-" + attachment.length);
1306
+
1307
+ // get images ID, append thumbnail and store IDs in hidden input
1308
+ jQuery(attachment).each(function(i) {
1309
+ if (attachment[i].sizes && attachment[i].sizes.large) {
1310
+ image = attachment[i].sizes.large.url;
1311
+ } else {
1312
+ image = attachment[i].url;
1313
+ }
1314
+
1315
+ // add image ID and url to comma-separated variable
1316
+ var comma = i === 0 ? "" : ",";
1317
+ imgID += comma + attachment[i].id;
1318
+
1319
+ // Send the attachment URL to our custom image input field.
1320
+ switch (element) {
1321
+ case "video":
1322
+ $container.append(
1323
+ '<video width="600" height="400" controls><source src="' +
1324
+ image +
1325
+ '" type="video/mp4">Your browser does not support the video tag.</video>'
1326
+ );
1327
+ break;
1328
+
1329
+ case "background":
1330
+ $container.css("background-image", "url('" + image + "')");
1331
+ break;
1332
+
1333
+ case "img":
1334
+ default:
1335
+ // if gallery - more than one image, it must be a graphic background, attach the first image to big coontainer
1336
+ if (attachment.length > 1 && i == 0) {
1337
+ jQuery(".big-thumb").append(
1338
+ '<img src="' + image + '" alt=""/>'
1339
+ );
1340
+
1341
+ // if gallery - more than one image, it must be a graphic background, attach all others images to normal wrapper
1342
+ } else if (attachment.length > 1 && i !== 0) {
1343
+ $container.append(
1344
+ '<img src="' + image + '" alt="" class="no-blur"/>'
1345
+ );
1346
+
1347
+ // if single image, and it is a background image, attach it to big container as well
1348
+ } else if ($container.find(".big-thumb").length) {
1349
+ jQuery(".big-thumb").append(
1350
+ '<img src="' + image + '" alt=""/>'
1351
+ );
1352
+
1353
+ // all others images
1354
+ } else {
1355
+ $container.append('<img src="' + image + '" alt=""/>');
1356
+ }
1357
+
1358
+ jQuery(".blur-range").trigger("input");
1359
+ break;
1360
+ }
1361
+ });
1362
+
1363
+ // Display Delete button
1364
+ $delete_button.css("display", "block");
1365
+ }
1366
+ // update hidden input with media id and trigger change
1367
+ jQuery("#niteoCS-" + name + "-id")
1368
+ .val(imgID)
1369
+ .trigger("change");
1370
+ })
1371
+ .open();
1372
+ });
1373
+
1374
+ $delete_button.click(function(e) {
1375
+ jQuery(this).css("display", "none");
1376
+ $container.find("img").remove();
1377
+ jQuery("#niteoCS-" + name + "-id").val("");
1378
+ jQuery("#niteoCS-" + name + "-id").trigger("change");
1379
+ });
1380
+ }
1381
+
1382
+ // Retrieve Mailchimp lists
1383
+ jQuery(".cmp-coming-soon-maintenance #connect-mailchimp").click(function(e) {
1384
+ e.preventDefault();
1385
+
1386
+ var apikey = jQuery(
1387
+ '.cmp-coming-soon-maintenance input[name="niteoCS_mailchimp_apikey"]'
1388
+ ).val(),
1389
+ security = jQuery(this).data("security"),
1390
+ button = jQuery(this);
1391
+
1392
+ if (apikey != "") {
1393
+ var params = { apikey: apikey, security: security };
1394
+
1395
+ jQuery(this).prop("disabled", true);
1396
+
1397
+ jQuery(this).html(
1398
+ '<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> retrieving lists..</span>'
1399
+ );
1400
+
1401
+ var data = {
1402
+ action: "cmp_mailchimp_list_ajax",
1403
+ security: security,
1404
+ params: params
1405
+ };
1406
+
1407
+ $.post(ajaxurl, data, function(response) {
1408
+ var lists = JSON.parse(response);
1409
+
1410
+ if (lists.response == 200) {
1411
+ $("#niteoCS_mailchimp_list")
1412
+ .empty()
1413
+ .prop("disabled", false);
1414
+ $.each(lists.lists, function(i, val) {
1415
+ $("#niteoCS_mailchimp_list").append(
1416
+ '<option value="' + val.id + '">' + val.name + "</option>"
1417
+ );
1418
+ });
1419
+ } else {
1420
+ $("#niteoCS_mailchimp_list")
1421
+ .empty()
1422
+ .prop("disabled", true)
1423
+ .html('<option value="error">' + lists.message + "</option>")
1424
+ .trigger("change");
1425
+ }
1426
+
1427
+ button.html("Retrieve Lists");
1428
+ button.prop("disabled", false);
1429
+ }).fail(function() {
1430
+ button.html("Retrieve Lists");
1431
+ button.prop("disabled", false);
1432
+ });
1433
+ }
1434
+ });
1435
+
1436
+ function toggle_settings(classname) {
1437
+ // Logo type inputs
1438
+ jQuery(".cmp-coming-soon-maintenance ." + classname).change(function() {
1439
+ var value = jQuery(
1440
+ ".cmp-coming-soon-maintenance ." + classname + ":checked"
1441
+ ).val();
1442
+ value = jQuery.isNumeric(value) ? "x" + value : value;
1443
+ value = value === undefined ? "off" : value;
1444
+
1445
+ jQuery(
1446
+ ".cmp-coming-soon-maintenance ." + classname + "-switch." + value
1447
+ ).css("display", "block");
1448
+ jQuery(
1449
+ ".cmp-coming-soon-maintenance ." +
1450
+ classname +
1451
+ "-switch:not(." +
1452
+ value +
1453
+ ")"
1454
+ ).css("display", "none");
1455
+ });
1456
+
1457
+ jQuery(".cmp-coming-soon-maintenance ." + classname)
1458
+ .first()
1459
+ .trigger("change");
1460
+ }
1461
+
1462
+ function toggle_select(classname) {
1463
+ jQuery(".cmp-coming-soon-maintenance ." + classname).change(function() {
1464
+ var value = jQuery("." + classname).val();
1465
+ value = jQuery.isNumeric(value) ? "x" + value : value;
1466
+
1467
+ jQuery(".cmp-coming-soon-maintenance ." + classname + "." + value).css(
1468
+ "display",
1469
+ "block"
1470
+ );
1471
+ jQuery(
1472
+ ".cmp-coming-soon-maintenance ." + classname + ":not(." + value + ")"
1473
+ ).css("display", "none");
1474
+ });
1475
+
1476
+ jQuery("." + classname)
1477
+ .first()
1478
+ .trigger("change");
1479
+ }
1480
+
1481
+ function update_range(selector, target, method) {
1482
+ jQuery(selector).on("input", function() {
1483
+ var value = jQuery(this).val();
1484
+ // change label value
1485
+ if (method === "html") {
1486
+ jQuery(this)
1487
+ .parent()
1488
+ .find(target)
1489
+ .html(value);
1490
+ }
1491
+
1492
+ if (method === "val") {
1493
+ jQuery(this)
1494
+ .parent()
1495
+ .find(target)
1496
+ .val(value);
1497
+ }
1498
+ });
1499
+ }
1500
+
1501
+ // delete overlay color from premium themes after update 2.8
1502
+ jQuery(".cmp-coming-soon-maintenance .table-wrapper.theme-setup h4").each(
1503
+ function() {
1504
+ if (jQuery(this).html() == "Overlay Color") {
1505
+ jQuery(this)
1506
+ .parents("tr")
1507
+ .remove();
1508
+ return false;
1509
+ }
1510
+ }
1511
+ );
1512
+
1513
+ // ini custom css textarea to codeEditor
1514
+ if (wp.codeEditor) {
1515
+ wp.codeEditor.initialize("niteoCS_custom_css");
1516
+ }
1517
+
1518
+ // warn users about unsaved changes for preview
1519
+ $(".nav-tab-wrapper").on("click", ".theme-preview", function(e) {
1520
+ if (
1521
+ $("#csoptions fieldset:not(.skip-preview-validation *)").serialize() !=
1522
+ settings
1523
+ ) {
1524
+ if (
1525
+ !confirm(
1526
+ "You have made changes that will not be visible in the preview until you save them. Please save changes first.\nContinue anyway?"
1527
+ )
1528
+ ) {
1529
+ e.preventDefault();
1530
+ return false;
1531
+ }
1532
+ }
1533
+
1534
+ return true;
1535
+ });
1536
+ });
niteo-cmp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: CMP - Coming Soon & Maintenance Plugin
4
  Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
5
  Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
6
- Version: 3.3.1
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
@@ -65,7 +65,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
65
 
66
  private function constants() {
67
  // define constants
68
- $this->define( 'CMP_VERSION', '3.3.1' );
69
  $this->define( 'CMP_DEBUG', FALSE );
70
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
71
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
3
  Plugin Name: CMP - Coming Soon & Maintenance Plugin
4
  Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
5
  Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
6
+ Version: 3.3.2
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
65
 
66
  private function constants() {
67
  // define constants
68
+ $this->define( 'CMP_VERSION', '3.3.2' );
69
  $this->define( 'CMP_DEBUG', FALSE );
70
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
71
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JF
4
  Tags: coming soon, landing page, launch page, maintenance mode, under construction
5
  Requires at least: 3.0
6
  Tested up to: 5.1
7
- Stable tag: 3.3.1
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -124,12 +124,18 @@ Packed with functions like Whitelist/Blacklist to enable CMP only on specific pa
124
  <p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
125
 
126
  == Changelog ==
 
 
 
 
 
 
 
127
  <h4>CMP 3.3.1 - 27-Feb-19</h4>
128
  <ul>
129
  <li>Updated downloadable CMP Themes URL Links.</li>
130
  </ul>
131
 
132
-
133
  <h4>CMP 3.3 - 27-Feb-19</h4>
134
  <ul>
135
  <li>New CMP Theme: Pluto! Minimalist Theme with beautiful typography, supports Countdown, Subscribe form and Image slider!</li>
4
  Tags: coming soon, landing page, launch page, maintenance mode, under construction
5
  Requires at least: 3.0
6
  Tested up to: 5.1
7
+ Stable tag: 3.3.2
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
124
  <p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
125
 
126
  == Changelog ==
127
+ <h4>CMP 3.3.2 - 27-Feb-19</h4>
128
+ <ul>
129
+ <li>Added Spotify to social media icons as requested.</li>
130
+ <li>Re-written JavaScript code for Email subscription, to resolve the issue with Subscription on some Nginx servers.</li>
131
+ </ul>
132
+
133
+
134
  <h4>CMP 3.3.1 - 27-Feb-19</h4>
135
  <ul>
136
  <li>Updated downloadable CMP Themes URL Links.</li>
137
  </ul>
138
 
 
139
  <h4>CMP 3.3 - 27-Feb-19</h4>
140
  <ul>
141
  <li>New CMP Theme: Pluto! Minimalist Theme with beautiful typography, supports Countdown, Subscribe form and Image slider!</li>