Cleanup: Remoción masiva de restos de WordPress y consolidación de archivos GKACHELE™

This commit is contained in:
komkida91
2026-01-27 18:00:16 +01:00
parent d9aad67066
commit 7083aa3893
874 changed files with 137670 additions and 137443 deletions

View File

@@ -0,0 +1,749 @@
/**
* File customizer.js.
*
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/
( function( $ ) {
/**
* Outputs custom css for responsive controls
* @param {[string]} setting customizer setting
* @param {[string]} css_selector
* @param {[array]} css_prop css property to write
* @param {String} ext css value extension eg: px, in
* @return {[string]} css output
*/
function range_live_media_load( setting, css_selector, css_prop, ext = '' ) {
wp.customize(
setting, function( value ) {
'use strict';
value.bind(
function( to ){
var values = JSON.parse( to );
var desktop_value = JSON.parse( values.desktop );
var tablet_value = JSON.parse( values.tablet );
var mobile_value = JSON.parse( values.mobile );
var class_name = 'customizer-' + setting;
var css_class = $( '.' + class_name );
var selector_name = css_selector;
var property_name = css_prop;
var desktop_css = '';
var tablet_css = '';
var mobile_css = '';
if ( property_name.length == 1 ) {
var desktop_css = property_name[0] + ': ' + desktop_value + ext + ';';
var tablet_css = property_name[0] + ': ' + tablet_value + ext + ';';
var mobile_css = property_name[0] + ': ' + mobile_value + ext + ';';
} else if ( property_name.length == 2 ) {
var desktop_css = property_name[0] + ': ' + desktop_value + ext + ';';
var desktop_css = desktop_css + property_name[1] + ': ' + desktop_value + ext + ';';
var tablet_css = property_name[0] + ': ' + tablet_value + ext + ';';
var tablet_css = tablet_css + property_name[1] + ': ' + tablet_value + ext + ';';
var mobile_css = property_name[0] + ': ' + mobile_value + ext + ';';
var mobile_css = mobile_css + property_name[1] + ': ' + mobile_value + ext + ';';
}
var head_append = '<style class="' + class_name + '">@media (min-width: 320px){ ' + selector_name + ' { ' + mobile_css + ' } } @media (min-width: 720px){ ' + selector_name + ' { ' + tablet_css + ' } } @media (min-width: 960px){ ' + selector_name + ' { ' + desktop_css + ' } }</style>';
if ( css_class.length ) {
css_class.replaceWith( head_append );
} else {
$( "head" ).append( head_append );
}
}
);
}
);
}
// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title' ).text( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );
// Header text color.
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
if ( 'blank' === to ) {
$( '.site-title, .site-description' ).css( {
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
} );
} else {
$( '.site-title, .site-description' ).css( {
'clip': 'auto',
'position': 'relative'
} );
$( '.site-title, .site-description' ).css( {
'color': to
} );
}
} );
} );
$(document).ready(function ($) {
$('input[data-input-type]').on('input change', function () {
var val = $(this).val();
$(this).prev('.cs-range-value').html(val);
$(this).val(val);
});
})
/**
* hdr_logo_size
*/
range_live_media_load( 'hdr_logo_size', '.site--logo img', [ 'max-width' ], 'px !important' );
/**
* hdr_site_title_size
*/
range_live_media_load( 'hdr_site_title_size', '.site--logo .site-title', [ 'font-size' ], 'px !important' );
/**
* hdr_site_desc_size
*/
range_live_media_load( 'hdr_site_desc_size', '.site--logo .site-description', [ 'font-size' ], 'px !important' );
//chromax_hdr_email_title
wp.customize(
'chromax_hdr_email_title', function( value ) {
value.bind(
function( newval ) {
$( '.dt_header .dt_header-topbar .widget_contact.email .contact__body .title a' ).text( newval );
}
);
}
);
//chromax_hdr_top_ads_title
wp.customize(
'chromax_hdr_top_ads_title', function( value ) {
value.bind(
function( newval ) {
$( '.dt_header .dt_header-topbar .widget_contact.address .contact__body h6' ).text( newval );
}
);
}
);
//chromax_hdr_time_title
wp.customize(
'chromax_hdr_time_title', function( value ) {
value.bind(
function( newval ) {
$( '.dt_header .dt_header-topbar .widget_contact.time .contact__body .title' ).text( newval );
}
);
}
);
//chromax_hdr_btn_lbl
wp.customize(
'chromax_hdr_btn_lbl', function( value ) {
value.bind(
function( newval ) {
$( '.dt_header .dt_navbar-button-item .dt-btn' ).text( newval );
}
);
}
);
//chromax_hdr_contact_ttl
wp.customize(
'chromax_hdr_contact_ttl', function( value ) {
value.bind(
function( newval ) {
$( '.dt_header .dt_navbar-info-contact .contact__body.one .title' ).text( newval );
}
);
}
);
//chromax_hdr_contact_txt
wp.customize(
'chromax_hdr_contact_txt', function( value ) {
value.bind(
function( newval ) {
$( '.dt_header .dt_navbar-info-contact .contact__body.one .description' ).text( newval );
}
);
}
);
//chromax_footer_mid_ttl
wp.customize(
'chromax_footer_mid_ttl', function( value ) {
value.bind(
function( newval ) {
$( '.dt_footer_middle .bounce-text a' ).text( newval );
}
);
}
);
//chromax_about_left_ttl
wp.customize(
'chromax_about_left_ttl', function( value ) {
value.bind(
function( newval ) {
$( '.front-about .section-title .sub-title .text-animate' ).text( newval );
}
);
}
);
//chromax_about_left_subttl
wp.customize(
'chromax_about_left_subttl', function( value ) {
value.bind(
function( newval ) {
$( '.front-about .section-title .title' ).text( newval );
}
);
}
);
//chromax_service_ttl
wp.customize(
'chromax_service_ttl', function( value ) {
value.bind(
function( newval ) {
$( '.front-service .section-title .sub-title .text-animate' ).text( newval );
}
);
}
);
//chromax_service_subttl
wp.customize(
'chromax_service_subttl', function( value ) {
value.bind(
function( newval ) {
$( '.front-service .section-title .title' ).text( newval );
}
);
}
);
//chromax_service_text
wp.customize(
'chromax_service_text', function( value ) {
value.bind(
function( newval ) {
$( '.front-service .dt-mt-5.dt-text-center .text' ).text( newval );
}
);
}
);
//chromax_service_btn_lbl
wp.customize(
'chromax_service_btn_lbl', function( value ) {
value.bind(
function( newval ) {
$( '.front-service .dt-mt-5.dt-text-center .dt-btn' ).text( newval );
}
);
}
);
//chromax_why_choose_left_ttl
wp.customize(
'chromax_why_choose_left_ttl', function( value ) {
value.bind(
function( newval ) {
$( '.front-whychooseus .section-title .sub-title .text-animate' ).text( newval );
}
);
}
);
//chromax_why_choose_left_subttl
wp.customize(
'chromax_why_choose_left_subttl', function( value ) {
value.bind(
function( newval ) {
$( '.front-whychooseus .section-title .title' ).text( newval );
}
);
}
);
//chromax_why_choose_left_text
wp.customize(
'chromax_why_choose_left_text', function( value ) {
value.bind(
function( newval ) {
$( '.front-clients .section-title .desc' ).text( newval );
}
);
}
);
//chromax_blog_ttl
wp.customize(
'chromax_blog_ttl', function( value ) {
value.bind(
function( newval ) {
$( '.front-posts .section-title .sub-title .text-animate' ).text( newval );
}
);
}
);
//chromax_blog_subttl
wp.customize(
'chromax_blog_subttl', function( value ) {
value.bind(
function( newval ) {
$( '.front-posts .section-title .title' ).text( newval );
}
);
}
);
/**
* Container Width
*/
wp.customize( 'chromax_site_container_width', function( value ) {
value.bind( function( chromax_site_container_width ) {
var class_name = 'chromax_site_container_width'; // Used as id in gfont link
var css_class = $( '.' + class_name );
if (chromax_site_container_width >= 768 && chromax_site_container_width < 2000){
var head_append = '<style class="' + class_name + '">.dt-container,.dt_slider .dt_owl_carousel.owl-carousel .owl-nav,.dt_slider .dt_owl_carousel.owl-carousel .owl-dots{ max-width: ' + chromax_site_container_width + 'px;}.header--eight .dt-container{ max-width: calc(' + chromax_site_container_width + 'px + 7.15rem);}</style>';
}
if ( css_class.length ) {
css_class.replaceWith( head_append );
} else {
$( 'head' ).append( head_append );
}
});
} );
/**
* Breadcrumb Typography
*/
range_live_media_load( 'chromax_breadcrumb_title_size', '.dt_pagetitle .dt_pagetitle_content .title>*, .dt_pagetitle .dt_pagetitle_bigtitle', [ 'font-size' ], 'rem' );
range_live_media_load( 'chromax_breadcrumb_content_size', '.dt_pagetitle .dt_pagetitle_content .dt_pagetitle_breadcrumb li', [ 'font-size' ], 'rem' );
/**
* Sidebar width.
*/
wp.customize( 'chromax_sidebar_width', function( value ) {
'use strict';
value.bind(
function( to ){
var class_name = 'customizer-sidebar-width'; // Used as id in gfont link
var css_class = $( '.' + class_name );
var sidebar_width = to;
var content_width = ( 100 - to );
var head_append = '<style class="' + class_name + '">@media (min-width: 992px){#dt-sidebar { max-width: ' + sidebar_width + '%;flex-basis: ' + sidebar_width + '%; } #dt-main { max-width: ' + content_width + '%;flex-basis: ' + content_width + '%; }}</style>';
if ( css_class.length ) {
css_class.replaceWith( head_append );
} else {
$( 'head' ).append( head_append );
}
}
);
}
);
/**
* chromax_widget_ttl_size
*/
range_live_media_load( 'chromax_widget_ttl_size', '.dt_widget-area .widget .widget-title,.dt_widget-area .widget .wp-block-heading', [ 'font-size' ], 'px' );
/**
* Body font size
*/
range_live_media_load( 'chromax_body_font_size_option', 'body', [ 'font-size' ], 'px' );
/**
* Body Letter Spacing
*/
range_live_media_load( 'chromax_body_ltr_space_option', 'body', [ 'letter-spacing' ], 'px' );
/**
* Body font weight
*/
wp.customize( 'chromax_body_font_weight_option', function( value ) {
value.bind( function( font_weight_option ) {
jQuery( 'body' ).css( 'font-weight', font_weight_option );
} );
} );
/**
* Body font style
*/
wp.customize( 'chromax_body_font_style_option', function( value ) {
value.bind( function( font_style_option ) {
jQuery( 'body' ).css( 'font-style', font_style_option );
} );
} );
/**
* Body Text Decoration
*/
wp.customize( 'chromax_body_txt_decoration_option', function( value ) {
value.bind( function( decoration ) {
jQuery( 'body, a' ).css( 'text-decoration', decoration );
} );
} );
/**
* Body text tranform
*/
wp.customize( 'chromax_body_text_transform_option', function( value ) {
value.bind( function( text_tranform ) {
jQuery( 'body' ).css( 'text-transform', text_tranform );
} );
} );
/**
* chromax_body_line_height
*/
range_live_media_load( 'chromax_body_line_height_option', 'body', [ 'line-height' ] );
/**
* H1 font size
*/
range_live_media_load( 'chromax_h1_font_size_option', 'h1', [ 'font-size' ], 'px' );
/**
* H1 font style
*/
wp.customize( 'chromax_h1_font_style_option', function( value ) {
value.bind( function( font_style_option ) {
jQuery( 'h1' ).css( 'font-style', font_style_option );
} );
} );
/**
* H1 Text Decoration
*/
wp.customize( 'chromax_h1_txt_decoration_option', function( value ) {
value.bind( function( decoration ) {
jQuery( 'h1' ).css( 'text-decoration', decoration );
} );
} );
/**
* H1 font weight
*/
wp.customize( 'chromax_h1_font_weight_option', function( value ) {
value.bind( function( font_weight_option ) {
jQuery( 'h1' ).css( 'font-weight', font_weight_option );
} );
} );
/**
* H1 text tranform
*/
wp.customize( 'chromax_h1_text_transform_option', function( value ) {
value.bind( function( text_tranform ) {
jQuery( 'h1' ).css( 'text-transform', text_tranform );
} );
} );
/**
* H1 line height
*/
range_live_media_load( 'chromax_h1_line_height_option', 'h1', [ 'line-height' ] );
/**
* H1 Letter Spacing
*/
range_live_media_load( 'chromax_h1_ltr_space_option', 'h1', [ 'letter-spacing' ], 'px' );
/**
* H2 font size
*/
range_live_media_load( 'chromax_h2_font_size_option', 'h2', [ 'font-size' ], 'px' );
/**
* H2 font style
*/
wp.customize( 'chromax_h2_font_style_option', function( value ) {
value.bind( function( font_style_option ) {
jQuery( 'h2' ).css( 'font-style', font_style_option );
} );
} );
/**
* H2 Text Decoration
*/
wp.customize( 'chromax_h2_txt_decoration_option', function( value ) {
value.bind( function( decoration ) {
jQuery( 'h2' ).css( 'text-decoration', decoration );
} );
} );
/**
* H2 font weight
*/
wp.customize( 'chromax_h2_font_weight_option', function( value ) {
value.bind( function( font_weight_option ) {
jQuery( 'h2' ).css( 'font-weight', font_weight_option );
} );
} );
/**
* H2 text tranform
*/
wp.customize( 'chromax_h2_text_transform_option', function( value ) {
value.bind( function( text_tranform ) {
jQuery( 'h2' ).css( 'text-transform', text_tranform );
} );
} );
/**
* H2 line height
*/
range_live_media_load( 'chromax_h2_line_height_option', 'h2', [ 'line-height' ]);
/**
* H2 Letter Spacing
*/
range_live_media_load( 'chromax_h2_ltr_space_option', 'h2', [ 'letter-spacing' ], 'px' );
/**
* H3 font size
*/
range_live_media_load( 'chromax_h3_font_size_option', 'h3', [ 'font-size' ], 'px' );
/**
* H3 font style
*/
wp.customize( 'chromax_h3_font_style_option', function( value ) {
value.bind( function( font_style_option ) {
jQuery( 'h3' ).css( 'font-style', font_style_option );
} );
} );
/**
* H3 Text Decoration
*/
wp.customize( 'chromax_h3_txt_decoration_option', function( value ) {
value.bind( function( decoration ) {
jQuery( 'h3' ).css( 'text-decoration', decoration );
} );
} );
/**
* H3 font weight
*/
wp.customize( 'chromax_h3_font_weight_option', function( value ) {
value.bind( function( font_weight_option ) {
jQuery( 'h3' ).css( 'font-weight', font_weight_option );
} );
} );
/**
* H3 text tranform
*/
wp.customize( 'chromax_h3_text_transform_option', function( value ) {
value.bind( function( text_tranform ) {
jQuery( 'h3' ).css( 'text-transform', text_tranform );
} );
} );
/**
* H3 line height
*/
range_live_media_load( 'chromax_h3_line_height_option', 'h3', [ 'line-height' ]);
/**
* H3 Letter Spacing
*/
range_live_media_load( 'chromax_h3_ltr_space_option', 'h3', [ 'letter-spacing' ], 'px' );
/**
* H4 font size
*/
range_live_media_load( 'chromax_h4_font_size_option', 'h4', [ 'font-size' ], 'px' );
/**
* H4 font style
*/
wp.customize( 'chromax_h4_font_style_option', function( value ) {
value.bind( function( font_style_option ) {
jQuery( 'h4' ).css( 'font-style', font_style_option );
} );
} );
/**
* H4 Text Decoration
*/
wp.customize( 'chromax_h4_txt_decoration_option', function( value ) {
value.bind( function( decoration ) {
jQuery( 'h4' ).css( 'text-decoration', decoration );
} );
} );
/**
* H4 font weight
*/
wp.customize( 'chromax_h4_font_weight_option', function( value ) {
value.bind( function( font_weight_option ) {
jQuery( 'h4' ).css( 'font-weight', font_weight_option );
} );
} );
/**
* H4 text tranform
*/
wp.customize( 'chromax_h4_text_transform_option', function( value ) {
value.bind( function( text_tranform ) {
jQuery( 'h4' ).css( 'text-transform', text_tranform );
} );
} );
/**
* H4 line height
*/
range_live_media_load( 'chromax_h4_line_height_option', 'h4', [ 'line-height' ]);
/**
* H4 Letter Spacing
*/
range_live_media_load( 'chromax_h4_ltr_space_option', 'h4', [ 'letter-spacing' ], 'px' );
/**
* H5 font size
*/
range_live_media_load( 'chromax_h5_font_size_option', 'h5', [ 'font-size' ], 'px' );
/**
* H5 font style
*/
wp.customize( 'chromax_h5_font_style_option', function( value ) {
value.bind( function( font_style_option ) {
jQuery( 'h5' ).css( 'font-style', font_style_option );
} );
} );
/**
* H5 Text Decoration
*/
wp.customize( 'chromax_h5_txt_decoration_option', function( value ) {
value.bind( function( decoration ) {
jQuery( 'h5' ).css( 'text-decoration', decoration );
} );
} );
/**
* H5 font weight
*/
wp.customize( 'chromax_h5_font_weight_option', function( value ) {
value.bind( function( font_weight_option ) {
jQuery( 'h5' ).css( 'font-weight', font_weight_option );
} );
} );
/**
* H5 text tranform
*/
wp.customize( 'chromax_h5_text_transform_option', function( value ) {
value.bind( function( text_tranform ) {
jQuery( 'h5' ).css( 'text-transform', text_tranform );
} );
} );
/**
* H5 line height
*/
range_live_media_load( 'chromax_h5_line_height_option', 'h5', [ 'line-height' ]);
/**
* H5 Letter Spacing
*/
range_live_media_load( 'chromax_h5_ltr_space_option', 'h5', [ 'letter-spacing' ], 'px' );
/**
* H6 font size
*/
range_live_media_load( 'chromax_h6_font_size_option', 'h6', [ 'font-size' ], 'px' );
/**
* H6 font style
*/
wp.customize( 'chromax_h6_font_style_option', function( value ) {
value.bind( function( font_style_option ) {
jQuery( 'h6' ).css( 'font-style', font_style_option );
} );
} );
/**
* H6 Text Decoration
*/
wp.customize( 'chromax_h6_txt_decoration_option', function( value ) {
value.bind( function( decoration ) {
jQuery( 'h6' ).css( 'text-decoration', decoration );
} );
} );
/**
* H6 font weight
*/
wp.customize( 'chromax_h6_font_weight_option', function( value ) {
value.bind( function( font_weight_option ) {
jQuery( 'h6' ).css( 'font-weight', font_weight_option );
} );
} );
/**
* H6 text tranform
*/
wp.customize( 'chromax_h6_text_transform_option', function( value ) {
value.bind( function( text_tranform ) {
jQuery( 'h6' ).css( 'text-transform', text_tranform );
} );
} );
/**
* H6 line height
*/
range_live_media_load( 'chromax_h6_line_height_option', 'h6', [ 'line-height' ]);
/**
* H6 Letter Spacing
*/
range_live_media_load( 'chromax_h6_ltr_space_option', 'h6', [ 'letter-spacing' ], 'px' );
} )( jQuery );

View File

@@ -0,0 +1,58 @@
( function( api ) {
// Extends our custom "example-1" section.
api.sectionConstructor['plugin-section'] = api.Section.extend( {
// No events for this type of section.
attachEvents: function () {},
// Always make the section active.
isContextuallyActive: function () {
return true;
}
} );
} )( wp.customize );
function chromaxfrontpagesectionsscroll( chromax_section_id ){
var navigation_id = "dt_slider";
var $contents = jQuery('#customize-preview iframe').contents();
switch ( chromax_section_id ) {
case 'accordion-section-information_options':
navigation_id = "dt_information";
break;
case 'accordion-section-about_options':
navigation_id = "dt_about";
break;
case 'accordion-section-service_options':
navigation_id = "dt_service";
break;
case 'accordion-section-why_choose_options':
navigation_id = "dt_why_choose_us";
break;
case 'accordion-section-blog_options':
navigation_id = "dt_posts";
break;
}
if( $contents.find('#'+navigation_id).length > 0 ){
$contents.find("html, body").animate({
scrollTop: $contents.find( "#" + navigation_id ).offset().top
}, 1000);
}
}
jQuery('body').on('click', '#sub-accordion-panel-chromax_frontpage_options .control-subsection .accordion-section-title', function(event) {
var chromax_section_id = jQuery(this).parent('.control-subsection').attr('id');
chromaxfrontpagesectionsscroll( chromax_section_id );
});

View File

@@ -0,0 +1,90 @@
<?php
/**
* Chromax Customizer Class
*
* @package Chromax
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
if ( ! class_exists( 'Chromax_Customizer' ) ) :
class Chromax_Customizer {
// Constructor customizer
public function __construct() {
add_action( 'customize_register',array( $this, 'chromax_customizer_register' ) );
add_action( 'customize_register',array( $this, 'chromax_customizer_sainitization_selective_refresh' ) );
add_action( 'customize_register',array( $this, 'chromax_customizer_control' ) );
add_action( 'customize_preview_init',array( $this, 'chromax_customize_preview_js' ) );
add_action( 'customize_controls_enqueue_scripts',array( $this, 'chromax_customizer_navigation_script' ) );
add_action( 'after_setup_theme',array( $this, 'chromax_customizer_settings' ) );
}
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public function chromax_customizer_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
$wp_customize->get_setting( 'background_color' )->transport = 'postMessage';
$wp_customize->get_setting('custom_logo')->transport = 'refresh';
}
// Register custom controls
public function chromax_customizer_control( $wp_customize ) {
$chromax_control_dir = CHROMAX_THEME_INC_DIR . '/customizer/controls';
// Load custom control classes.
$wp_customize->register_control_type( 'Chromax_Customizer_Range_Control' );
require $chromax_control_dir . '/code/chromax-slider-control.php';
require $chromax_control_dir . '/code/chromax-icon-picker-control.php';
require $chromax_control_dir . '/code/chromax-category-dropdown-control.php';
require $chromax_control_dir . '/code/editor/class/class-chromax-page-editor.php';
}
// selective refresh.
public function chromax_customizer_sainitization_selective_refresh() {
require CHROMAX_THEME_INC_DIR . '/customizer/sanitization.php';
}
// Theme Customizer preview reload changes asynchronously.
public function chromax_customize_preview_js() {
wp_enqueue_script( 'chromax-customizer', CHROMAX_THEME_INC_URI . '/customizer/assets/js/customizer-preview.js', array( 'customize-preview' ), CHROMAX_THEME_VERSION, true );
}
public function chromax_customizer_navigation_script() {
wp_enqueue_script( 'chromax-customizer-section', CHROMAX_THEME_INC_URI .'/customizer/assets/js/customizer-section.js', array("jquery"),'', true );
}
// Include customizer settings.
public function chromax_customizer_settings() {
// Recommended Plugin
require CHROMAX_THEME_INC_DIR . '/customizer/customizer-plugin-notice/chromax-notify-plugin.php';
// Upsale
require CHROMAX_THEME_INC_DIR . '/customizer/controls/code/upgrade/class-customize.php';
$chromax_customize_dir = CHROMAX_THEME_INC_DIR . '/customizer/customizer-settings';
require $chromax_customize_dir . '/chromax-header-customize-setting.php';
require $chromax_customize_dir . '/chromax-footer-customize-setting.php';
require $chromax_customize_dir . '/chromax-theme-customize-setting.php';
require $chromax_customize_dir . '/chromax-typography-customize-setting.php';
require CHROMAX_THEME_INC_DIR . '/customizer/chromax-selective-partial.php';
require CHROMAX_THEME_INC_DIR . '/customizer/chromax-selective-refresh.php';
}
}
endif;
new Chromax_Customizer();

View File

@@ -0,0 +1,40 @@
<?php
// chromax_hdr_email_title
function chromax_hdr_email_title_render_callback() {
return get_theme_mod( 'chromax_hdr_email_title' );
}
// chromax_hdr_top_ads_title
function chromax_hdr_top_ads_title_render_callback() {
return get_theme_mod( 'chromax_hdr_top_ads_title' );
}
// chromax_hdr_time_title
function chromax_hdr_time_title_render_callback() {
return get_theme_mod( 'chromax_hdr_time_title' );
}
// chromax_hdr_btn_lbl
function chromax_hdr_btn_lbl_render_callback() {
return get_theme_mod( 'chromax_hdr_btn_lbl' );
}
// chromax_hdr_contact_ttl
function chromax_hdr_contact_ttl_render_callback() {
return get_theme_mod( 'chromax_hdr_contact_ttl' );
}
// chromax_hdr_contact_txt
function chromax_hdr_contact_txt_render_callback() {
return get_theme_mod( 'chromax_hdr_contact_txt' );
}
// chromax_footer_mid_ttl
function chromax_footer_mid_ttl_render_callback() {
return get_theme_mod( 'chromax_footer_mid_ttl' );
}
// chromax_footer_copyright_text
function chromax_footer_copyright_text_render_callback() {
return get_theme_mod( 'chromax_footer_copyright_text' );
}

View File

@@ -0,0 +1,59 @@
<?php
function chromax_site_selective_partials( $wp_customize ){
// chromax_hdr_email_title
$wp_customize->selective_refresh->add_partial( 'chromax_hdr_email_title', array(
'selector' => '.dt_header .dt_header-topbar .widget_contact.email .contact__body .title a',
'settings' => 'chromax_hdr_email_title',
'render_callback' => 'chromax_hdr_email_title_render_callback',
) );
// chromax_hdr_top_ads_title
$wp_customize->selective_refresh->add_partial( 'chromax_hdr_top_ads_title', array(
'selector' => '.dt_header .dt_header-topbar .widget_contact.address .contact__body h6',
'settings' => 'chromax_hdr_top_ads_title',
'render_callback' => 'chromax_hdr_top_ads_title_render_callback',
) );
// chromax_hdr_time_title
$wp_customize->selective_refresh->add_partial( 'chromax_hdr_time_title', array(
'selector' => '.dt_header .dt_header-topbar .widget_contact.time .contact__body .title',
'settings' => 'chromax_hdr_time_title',
'render_callback' => 'chromax_hdr_time_title_render_callback',
) );
// chromax_hdr_btn_lbl
$wp_customize->selective_refresh->add_partial( 'chromax_hdr_btn_lbl', array(
'selector' => '.dt_header .dt_navbar-button-item .dt-btn',
'settings' => 'chromax_hdr_btn_lbl',
'render_callback' => 'chromax_hdr_btn_lbl_render_callback',
) );
// chromax_hdr_contact_ttl
$wp_customize->selective_refresh->add_partial( 'chromax_hdr_contact_ttl', array(
'selector' => '.dt_header .dt_navbar-info-contact .contact__body.one .title',
'settings' => 'chromax_hdr_contact_ttl',
'render_callback' => 'chromax_hdr_contact_ttl_render_callback',
) );
// chromax_hdr_contact_txt
$wp_customize->selective_refresh->add_partial( 'chromax_hdr_contact_txt', array(
'selector' => '.dt_header .dt_navbar-info-contact .contact__body.one .description',
'settings' => 'chromax_hdr_contact_txt',
'render_callback' => 'chromax_hdr_contact_txt_render_callback',
) );
// chromax_footer_mid_ttl
$wp_customize->selective_refresh->add_partial( 'chromax_footer_mid_ttl', array(
'selector' => '.dt_footer_middle .bounce-text a',
'settings' => 'chromax_footer_mid_ttl',
'render_callback' => 'chromax_footer_mid_ttl_render_callback',
) );
// chromax_footer_copyright_text
$wp_customize->selective_refresh->add_partial( 'chromax_footer_copyright_text', array(
'selector' => '.dt_footer_copyright-text',
'settings' => 'chromax_footer_copyright_text',
'render_callback' => 'chromax_footer_copyright_text_render_callback',
) );
}
add_action( 'customize_register', 'chromax_site_selective_partials' );

View File

@@ -0,0 +1,48 @@
<?php
if ( ! class_exists( 'WP_Customize_Control' ) )
return NULL;
/**
* A class to create a dropdown for all categories in your WordPress site
*/
class Chromax_Post_Category_Control extends WP_Customize_Control
{
private $cats = false;
public function __construct($manager, $id, $args = array(), $options = array())
{
$this->cats = get_categories($options);
parent::__construct( $manager, $id, $args );
}
/**
* Render the content of the category dropdown
*
* @return HTML
*/
public function render_content()
{
if(!empty($this->cats))
{
?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<select <?php $this->link(); ?>>
<?php
printf( '<option value="%s" %s>%s</option>', 0, selected( $this->value(), '', false ), esc_html( 'All', 'chromax' ) );
?>
<?php
foreach ( $this->cats as $cat )
{
printf('<option value="%s">%s</option>', $cat->term_id, $cat->name);
}
?>
</select>
</label>
<?php
}
}
}

View File

@@ -0,0 +1,952 @@
<?php
if ( ! class_exists( 'WP_Customize_Control' ) ) {
return;
}
/** A class to add a fontawesome icons selector */
class Chromax_Icon_Picker_Control extends WP_Customize_Control
{
private $icons = false;
public function __construct( $manager, $id, $args = array(), $options = array() ) {
$this->icons = $this->Chromax_get_icons();
parent::__construct( $manager, $id, $args );
}
/**
* Enqueue scripts
*/
public function enqueue() {
wp_enqueue_style( 'chromax-icon-picker-css', CHROMAX_THEME_INC_URI . '/customizer/controls/js/fonticonpicker/jquery.fonticonpicker.css', false );
wp_enqueue_script( 'chromax-icon-picker-js', CHROMAX_THEME_INC_URI .'/customizer/controls/js/fonticonpicker/jquery.fonticonpicker.js', array( 'jquery', 'jquery-ui-sortable' ) );
}
/**
* Render the content of the dropdown
*
* Adding the font-family styling to the select so that the font renders
* @return HTML
*/
public function render_content() {
if ( ! empty( $this->icons ) ) { ?>
<label>
<span class="customize-control-title" style="flex: 2 0 0; vertical-align: middle;"><?php echo esc_html( $this->label ); ?></span>
<select <?php $this->link(); ?> style="font-family: 'Font Awesome 6 Free', Arial;" class="contact-icon-picker iconPicker">
<?php
foreach ( $this->icons as $k=>$v ) {
printf('<option value="%s" %s>%s</option>', $k, selected($this->value(), $k, false), $v);
}
?>
</select>
</label>
<?php }
}
/**
* Get the list of Icons
*
* @return string
*/
function chromax_get_icons() {
/* populate with a list of icons you want to show */
$icons = array(
'fab fa-500px' => 'fab fa-500px',
'fab fa-accessible-icon' => 'fab fa-accessible-icon',
'fab fa-accusoft' => 'fab fa-accusoft',
'fas fa-address-book' => 'fas fa-address-book',
'far fa-address-book' => 'far fa-address-book',
'fas fa-address-card' => 'fas fa-address-card',
'far fa-address-card' => 'far fa-address-card',
'fas fa-adjust' => 'fas fa-adjust',
'fab fa-adn' => 'fab fa-adn',
'fab fa-adversal' => 'fab fa-adversal',
'fab fa-affiliatetheme' => 'fab fa-affiliatetheme',
'fab fa-algolia' => 'fab fa-algolia',
'fas fa-align-center' => 'fas fa-align-center',
'fas fa-align-justify' => 'fas fa-align-justify',
'fas fa-align-left' => 'fas fa-align-left',
'fas fa-align-right' => 'fas fa-align-right',
'fab fa-amazon' => 'fab fa-amazon',
'fas fa-ambulance' => 'fas fa-ambulance',
'fas fa-american-sign-language-interpreting' => 'fas fa-american-sign-language-interpreting',
'fab fa-amilia' => 'fab fa-amilia',
'fas fa-anchor' => 'fas fa-anchor',
'fab fa-android' => 'fab fa-android',
'fab fa-angellist' => 'fab fa-angellist',
'fas fa-angle-double-down' => 'fas fa-angle-double-down',
'fas fa-angle-double-left' => 'fas fa-angle-double-left',
'fas fa-angle-double-right' => 'fas fa-angle-double-right',
'fas fa-angle-double-up' => 'fas fa-angle-double-up',
'fas fa-angle-down' => 'fas fa-angle-down',
'fas fa-angle-left' => 'fas fa-angle-left',
'fas fa-angle-right' => 'fas fa-angle-right',
'fas fa-angle-up' => 'fas fa-angle-up',
'fab fa-angrycreative' => 'fab fa-angrycreative',
'fab fa-angular' => 'fab fa-angular',
'fab fa-app-store' => 'fab fa-app-store',
'fab fa-app-store-ios' => 'fab fa-app-store-ios',
'fab fa-apper' => 'fab fa-apper',
'fab fa-apple' => 'fab fa-apple',
'fab fa-apple-pay' => 'fab fa-apple-pay',
'fas fa-archive' => 'fas fa-archive',
'fas fa-arrow-alt-circle-down' => 'fas fa-arrow-alt-circle-down',
'far fa-arrow-alt-circle-down' => 'far fa-arrow-alt-circle-down',
'fas fa-arrow-alt-circle-left' => 'fas fa-arrow-alt-circle-left',
'far fa-arrow-alt-circle-left' => 'far fa-arrow-alt-circle-left',
'fas fa-arrow-alt-circle-right' => 'fas fa-arrow-alt-circle-right',
'far fa-arrow-alt-circle-right' => 'far fa-arrow-alt-circle-right',
'fas fa-arrow-alt-circle-up' => 'fas fa-arrow-alt-circle-up',
'far fa-arrow-alt-circle-up' => 'far fa-arrow-alt-circle-up',
'fas fa-arrow-circle-down' => 'fas fa-arrow-circle-down',
'fas fa-arrow-circle-left' => 'fas fa-arrow-circle-left',
'fas fa-arrow-circle-right' => 'fas fa-arrow-circle-right',
'fas fa-arrow-circle-up' => 'fas fa-arrow-circle-up',
'fas fa-arrow-down' => 'fas fa-arrow-down',
'fas fa-arrow-left' => 'fas fa-arrow-left',
'fas fa-arrow-right' => 'fas fa-arrow-right', 'fas fa-arrow-up' => 'fas fa-arrow-up',
'fas fa-arrows-alt' => 'fas fa-arrows-alt',
'fas fa-arrows-alt-h' => 'fas fa-arrows-alt-h',
'fas fa-arrows-alt-v' => 'fas fa-arrows-alt-v',
'fas fa-assistive-listening-systems' => 'fas fa-assistive-listening-systems',
'fas fa-asterisk' => 'fas fa-asterisk',
'fab fa-asymmetrik' => 'fab fa-asymmetrik',
'fas fa-at' => 'fas fa-at',
'fab fa-audible' => 'fab fa-audible',
'fas fa-audio-description' => 'fas fa-audio-description',
'fab fa-autoprefixer' => 'fab fa-autoprefixer',
'fab fa-avianex' => 'fab fa-avianex',
'fab fa-aviato' => 'fab fa-aviato',
'fab fa-aws' => 'fab fa-aws',
'fas fa-backward' => 'fas fa-backward',
'fas fa-balance-scale' => 'fas fa-balance-scale',
'fas fa-ban' => 'fas fa-ban',
'fab fa-bandcamp' => 'fab fa-bandcamp',
'fas fa-barcode' => 'fas fa-barcode',
'fas fa-bars' => 'fas fa-bars',
'fas fa-bath' => 'fas fa-bath',
'fas fa-battery-empty' => 'fas fa-battery-empty',
'fas fa-battery-full' => 'fas fa-battery-full',
'fas fa-battery-half' => 'fas fa-battery-half',
'fas fa-battery-quarter' => 'fas fa-battery-quarter',
'fas fa-battery-three-quarters' => 'fas fa-battery-three-quarters',
'fas fa-bed' => 'fas fa-bed',
'fas fa-beer' => 'fas fa-beer',
'fab fa-behance' => 'fab fa-behance',
'fab fa-behance-square' => 'fab fa-behance-square',
'fas fa-bell' => 'fas fa-bell',
'far fa-bell' => 'far fa-bell',
'fas fa-bell-slash' => 'fas fa-bell-slash',
'far fa-bell-slash' => 'far fa-bell-slash',
'fas fa-bicycle' => 'fas fa-bicycle',
'fab fa-bimobject' => 'fab fa-bimobject',
'fas fa-binoculars' => 'fas fa-binoculars',
'fas fa-birthday-cake' => 'fas fa-birthday-cake',
'fab fa-bitbucket' => 'fab fa-bitbucket',
'fab fa-bitcoin' => 'fab fa-bitcoin',
'fab fa-bity' => 'fab fa-bity',
'fab fa-black-tie' => 'fab fa-black-tie',
'fab fa-blackberry' => 'fab fa-blackberry',
'fas fa-blind' => 'fas fa-blind',
'fab fa-blogger' => 'fab fa-blogger',
'fab fa-blogger-b' => 'fab fa-blogger-b',
'fab fa-bluetooth' => 'fab fa-bluetooth',
'fab fa-bluetooth-b' => 'fab fa-bluetooth-b',
'fas fa-bold' => 'fas fa-bold',
'fas fa-bolt' => 'fas fa-bolt',
'fas fa-bomb' => 'fas fa-bomb',
'fas fa-book' => 'fas fa-book',
'fas fa-bookmark' => 'fas fa-bookmark',
'far fa-bookmark' => 'far fa-bookmark',
'fas fa-braille' => 'fas fa-braille',
'fas fa-briefcase' => 'fas fa-briefcase',
'fab fa-btc' => 'fab fa-btc',
'fas fa-bug' => 'fas fa-bug',
'fas fa-building' => 'fas fa-building',
'far fa-building' => 'far fa-building',
'fas fa-bullhorn' => 'fas fa-bullhorn',
'fas fa-bullseye' => 'fas fa-bullseye',
'fab fa-buromobelexperte' => 'fab fa-buromobelexperte',
'fas fa-bus' => 'fas fa-bus',
'fab fa-buysellads' => 'fab fa-buysellads',
'fas fa-calculator' => 'fas fa-calculator',
'fas fa-calendar' => 'fas fa-calendar',
'far fa-calendar' => 'far fa-calendar',
'fas fa-calendar-alt' => 'fas fa-calendar-alt',
'far fa-calendar-alt' => 'far fa-calendar-alt',
'fas fa-calendar-check' => 'fas fa-calendar-check',
'far fa-calendar-check' => 'far fa-calendar-check',
'fas fa-calendar-minus' => 'fas fa-calendar-minus',
'far fa-calendar-minus' => 'far fa-calendar-minus',
'fas fa-calendar-plus' => 'fas fa-calendar-plus',
'far fa-calendar-plus' => 'far fa-calendar-plus',
'fas fa-calendar-times' => 'fas fa-calendar-times',
'far fa-calendar-times' => 'far fa-calendar-times',
'fas fa-camera' => 'fas fa-camera',
'fas fa-camera-retro' => 'fas fa-camera-retro',
'fas fa-car' => 'fas fa-car',
'fas fa-caret-down' => 'fas fa-caret-down',
'fas fa-caret-left' => 'fas fa-caret-left',
'fas fa-caret-right' => 'fas fa-caret-right',
'fas fa-caret-square-down' => 'fas fa-caret-square-down',
'far fa-caret-square-down' => 'far fa-caret-square-down',
'fas fa-caret-square-left' => 'fas fa-caret-square-left',
'far fa-caret-square-left' => 'far fa-caret-square-left',
'fas fa-caret-square-right' => 'fas fa-caret-square-right',
'far fa-caret-square-right' => 'far fa-caret-square-right',
'fas fa-caret-square-up' => 'fas fa-caret-square-up',
'far fa-caret-square-up' => 'far fa-caret-square-up',
'fas fa-caret-up' => 'fas fa-caret-up',
'fas fa-cart-arrow-down' => 'fas fa-cart-arrow-down',
'fas fa-cart-plus' => 'fas fa-cart-plus',
'fab fa-cc-amex' => 'fab fa-cc-amex',
'fab fa-cc-apple-pay' => 'fab fa-cc-apple-pay',
'fab fa-cc-diners-club' => 'fab fa-cc-diners-club',
'fab fa-cc-discover' => 'fab fa-cc-discover',
'fab fa-cc-jcb' => 'fab fa-cc-jcb',
'fab fa-cc-mastercard' => 'fab fa-cc-mastercard',
'fab fa-cc-paypal' => 'fab fa-cc-paypal',
'fab fa-cc-stripe' => 'fab fa-cc-stripe',
'fab fa-cc-visa' => 'fab fa-cc-visa',
'fab fa-centercode' => 'fab fa-centercode',
'fas fa-certificate' => 'fas fa-certificate',
'fas fa-chart-area' => 'fas fa-chart-area', 'fas fa-chart-bar' => 'fas fa-chart-bar',
'far fa-chart-bar' => 'far fa-chart-bar',
'fas fa-chart-line' => 'fas fa-chart-line',
'fas fa-chart-pie' => 'fas fa-chart-pie',
'fas fa-check' => 'fas fa-check',
'fas fa-check-circle' => 'fas fa-check-circle',
'far fa-check-circle' => 'far fa-check-circle',
'fas fa-check-square' => 'fas fa-check-square',
'far fa-check-square' => 'far fa-check-square',
'fas fa-chevron-circle-down' => 'fas fa-chevron-circle-down',
'fas fa-chevron-circle-left' => 'fas fa-chevron-circle-left',
'fas fa-chevron-circle-right' => 'fas fa-chevron-circle-right',
'fas fa-chevron-circle-up' => 'fas fa-chevron-circle-up',
'fas fa-chevron-down' => 'fas fa-chevron-down',
'fas fa-chevron-left' => 'fas fa-chevron-left',
'fas fa-chevron-right' => 'fas fa-chevron-right',
'fas fa-chevron-up' => 'fas fa-chevron-up',
'fas fa-child' => 'fas fa-child',
'fab fa-chrome' => 'fab fa-chrome',
'fas fa-circle' => 'fas fa-circle',
'far fa-circle' => 'far fa-circle',
'fas fa-circle-notch' => 'fas fa-circle-notch',
'fas fa-clipboard' => 'fas fa-clipboard',
'far fa-clipboard' => 'far fa-clipboard',
'fas fa-clock' => 'fas fa-clock',
'far fa-clock' => 'far fa-clock',
'fas fa-clone' => 'fas fa-clone',
'far fa-clone' => 'far fa-clone',
'fas fa-closed-captioning' => 'fas fa-closed-captioning',
'far fa-closed-captioning' => 'far fa-closed-captioning',
'fas fa-cloud' => 'fas fa-cloud',
'fas fa-cloud-download-alt' => 'fas fa-cloud-download-alt',
'fas fa-cloud-upload-alt' => 'fas fa-cloud-upload-alt',
'fab fa-cloudscale' => 'fab fa-cloudscale',
'fab fa-cloudsmith' => 'fab fa-cloudsmith',
'fab fa-cloudversify' => 'fab fa-cloudversify',
'fas fa-code' => 'fas fa-code',
'fas fa-code-branch' => 'fas fa-code-branch',
'fab fa-codepen' => 'fab fa-codepen',
'fab fa-codiepie' => 'fab fa-codiepie',
'fas fa-coffee' => 'fas fa-coffee',
'fas fa-cog' => 'fas fa-cog',
'fas fa-cogs' => 'fas fa-cogs',
'fas fa-columns' => 'fas fa-columns',
'fas fa-comment' => 'fas fa-comment',
'far fa-comment' => 'far fa-comment',
'fas fa-comment-alt' => 'fas fa-comment-alt',
'far fa-comment-alt' => 'far fa-comment-alt',
'fas fa-comments' => 'fas fa-comments',
'far fa-comments' => 'far fa-comments',
'fas fa-compass' => 'fas fa-compass',
'far fa-compass' => 'far fa-compass',
'fas fa-compress' => 'fas fa-compress',
'fab fa-connectdevelop' => 'fab fa-connectdevelop',
'fab fa-contao' => 'fab fa-contao',
'fas fa-copy' => 'fas fa-copy',
'far fa-copy' => 'far fa-copy',
'fas fa-copyright' => 'fas fa-copyright',
'far fa-copyright' => 'far fa-copyright',
'fab fa-cpanel' => 'fab fa-cpanel',
'fab fa-creative-commons' => 'fab fa-creative-commons',
'fas fa-credit-card' => 'fas fa-credit-card',
'far fa-credit-card' => 'far fa-credit-card',
'fas fa-crop' => 'fas fa-crop',
'fas fa-crosshairs' => 'fas fa-crosshairs',
'fab fa-css3' => 'fab fa-css3',
'fab fa-css3-alt' => 'fab fa-css3-alt',
'fas fa-cube' => 'fas fa-cube',
'fas fa-cubes' => 'fas fa-cubes',
'fas fa-cut' => 'fas fa-cut',
'fab fa-cuttlefish' => 'fab fa-cuttlefish',
'fab fa-d-and-d' => 'fab fa-d-and-d',
'fab fa-dashcube' => 'fab fa-dashcube',
'fas fa-database' => 'fas fa-database',
'fas fa-deaf' => 'fas fa-deaf',
'fab fa-delicious' => 'fab fa-delicious',
'fab fa-deploydog' => 'fab fa-deploydog',
'fab fa-deskpro' => 'fab fa-deskpro',
'fas fa-desktop' => 'fas fa-desktop',
'fab fa-deviantart' => 'fab fa-deviantart',
'fab fa-digg' => 'fab fa-digg',
'fab fa-digital-ocean' => 'fab fa-digital-ocean',
'fab fa-discord' => 'fab fa-discord',
'fab fa-discourse' => 'fab fa-discourse',
'fab fa-dochub' => 'fab fa-dochub',
'fab fa-docker' => 'fab fa-docker',
'fas fa-dollar-sign' => 'fas fa-dollar-sign',
'fas fa-dot-circle' => 'fas fa-dot-circle',
'far fa-dot-circle' => 'far fa-dot-circle',
'fas fa-download' => 'fas fa-download',
'fab fa-draft2digital' => 'fab fa-draft2digital',
'fab fa-dribbble' => 'fab fa-dribbble',
'fab fa-dribbble-square' => 'fab fa-dribbble-square', 'fab fa-dropbox' => 'fab fa-dropbox',
'fab fa-drupal' => 'fab fa-drupal',
'fab fa-dyalog' => 'fab fa-dyalog',
'fab fa-earlybirds' => 'fab fa-earlybirds',
'fab fa-edge' => 'fab fa-edge',
'fas fa-edit' => 'fas fa-edit',
'far fa-edit' => 'far fa-edit',
'fas fa-eject' => 'fas fa-eject',
'fas fa-ellipsis-h' => 'fas fa-ellipsis-h',
'fas fa-ellipsis-v' => 'fas fa-ellipsis-v',
'fab fa-ember' => 'fab fa-ember',
'fab fa-empire' => 'fab fa-empire',
'fas fa-envelope' => 'fas fa-envelope',
'far fa-envelope' => 'far fa-envelope',
'fas fa-envelope-open' => 'fas fa-envelope-open',
'far fa-envelope-open' => 'far fa-envelope-open',
'fas fa-envelope-square' => 'fas fa-envelope-square',
'fab fa-envira' => 'fab fa-envira',
'fas fa-eraser' => 'fas fa-eraser',
'fab fa-erlang' => 'fab fa-erlang',
'fab fa-etsy' => 'fab fa-etsy',
'fas fa-euro-sign' => 'fas fa-euro-sign',
'fas fa-exchange-alt' => 'fas fa-exchange-alt',
'fas fa-exclamation' => 'fas fa-exclamation',
'fas fa-exclamation-circle' => 'fas fa-exclamation-circle',
'fas fa-exclamation-triangle' => 'fas fa-exclamation-triangle',
'fas fa-expand' => 'fas fa-expand',
'fas fa-expand-arrows-alt' => 'fas fa-expand-arrows-alt',
'fab fa-expeditedssl' => 'fab fa-expeditedssl',
'fas fa-external-link-alt' => 'fas fa-external-link-alt',
'fas fa-external-link-square-alt' => 'fas fa-external-link-square-alt',
'fas fa-eye' => 'fas fa-eye',
'fas fa-eye-dropper' => 'fas fa-eye-dropper',
'fas fa-eye-slash' => 'fas fa-eye-slash',
'far fa-eye-slash' => 'far fa-eye-slash',
'fab fa-facebook' => 'fab fa-facebook',
'fab fa-facebook-f' => 'fab fa-facebook-f',
'fab fa-facebook-messenger' => 'fab fa-facebook-messenger',
'fab fa-facebook-square' => 'fab fa-facebook-square',
'fas fa-fast-backward' => 'fas fa-fast-backward',
'fas fa-fast-forward' => 'fas fa-fast-forward',
'fas fa-fax' => 'fas fa-fax',
'fas fa-female' => 'fas fa-female',
'fas fa-fighter-jet' => 'fas fa-fighter-jet',
'fas fa-file' => 'fas fa-file',
'far fa-file' => 'far fa-file',
'fas fa-file-alt' => 'fas fa-file-alt',
'far fa-file-alt' => 'far fa-file-alt',
'fas fa-file-archive' => 'fas fa-file-archive',
'far fa-file-archive' => 'far fa-file-archive',
'fas fa-file-audio' => 'fas fa-file-audio',
'far fa-file-audio' => 'far fa-file-audio',
'fas fa-file-code' => 'fas fa-file-code',
'far fa-file-code' => 'far fa-file-code',
'fas fa-file-excel' => 'fas fa-file-excel',
'far fa-file-excel' => 'far fa-file-excel',
'fas fa-file-image' => 'fas fa-file-image',
'far fa-file-image' => 'far fa-file-image',
'fas fa-file-pdf' => 'fas fa-file-pdf',
'far fa-file-pdf' => 'far fa-file-pdf',
'fas fa-file-powerpoint' => 'fas fa-file-powerpoint',
'far fa-file-powerpoint' => 'far fa-file-powerpoint',
'fas fa-file-video' => 'fas fa-file-video',
'far fa-file-video' => 'far fa-file-video',
'fas fa-file-word' => 'fas fa-file-word',
'far fa-file-word' => 'far fa-file-word',
'fas fa-film' => 'fas fa-film',
'fas fa-filter' => 'fas fa-filter',
'fas fa-fire' => 'fas fa-fire',
'fas fa-fire-extinguisher' => 'fas fa-fire-extinguisher',
'fab fa-firefox' => 'fab fa-firefox',
'fab fa-first-order' => 'fab fa-first-order',
'fab fa-firstdraft' => 'fab fa-firstdraft',
'fas fa-flag' => 'fas fa-flag',
'far fa-flag' => 'far fa-flag',
'fas fa-flag-checkered' => 'fas fa-flag-checkered',
'fas fa-flask' => 'fas fa-flask',
'fab fa-flickr' => 'fab fa-flickr',
'fab fa-fly' => 'fab fa-fly',
'fas fa-folder' => 'fas fa-folder',
'far fa-folder' => 'far fa-folder',
'fas fa-folder-open' => 'fas fa-folder-open',
'far fa-folder-open' => 'far fa-folder-open',
'fas fa-font' => 'fas fa-font',
'fab fa-font-awesome' => 'fab fa-font-awesome',
'fab fa-font-awesome-alt' => 'fab fa-font-awesome-alt',
'fab fa-font-awesome-flag' => 'fab fa-font-awesome-flag',
'fab fa-fonticons' => 'fab fa-fonticons',
'fab fa-fonticons-fi' => 'fab fa-fonticons-fi',
'fab fa-fort-awesome' => 'fab fa-fort-awesome',
'fab fa-fort-awesome-alt' => 'fab fa-fort-awesome-alt',
'fab fa-forumbee' => 'fab fa-forumbee',
'fas fa-forward' => 'fas fa-forward',
'fab fa-foursquare' => 'fab fa-foursquare',
'fab fa-free-code-camp' => 'fab fa-free-code-camp',
'fab fa-freebsd' => 'fab fa-freebsd',
'fas fa-frown' => 'fas fa-frown',
'far fa-frown' => 'far fa-frown',
'fas fa-futbol' => 'fas fa-futbol',
'far fa-futbol' => 'far fa-futbol',
'fas fa-gamepad' => 'fas fa-gamepad',
'fas fa-gavel' => 'fas fa-gavel',
'fas fa-gem' => 'fas fa-gem',
'far fa-gem' => 'far fa-gem',
'fas fa-genderless' => 'fas fa-genderless',
'fab fa-get-pocket' => 'fab fa-get-pocket',
'fab fa-gg' => 'fab fa-gg',
'fab fa-gg-circle' => 'fab fa-gg-circle',
'fas fa-gift' => 'fas fa-gift',
'fab fa-git' => 'fab fa-git',
'fab fa-git-square' => 'fab fa-git-square',
'fab fa-github' => 'fab fa-github',
'fab fa-github-alt' => 'fab fa-github-alt',
'fab fa-github-square' => 'fab fa-github-square',
'fab fa-gitkraken' => 'fab fa-gitkraken',
'fab fa-gitlab' => 'fab fa-gitlab',
'fab fa-gitter' => 'fab fa-gitter',
'fas fa-glass-martini' => 'fas fa-glass-martini',
'fab fa-glide' => 'fab fa-glide',
'fab fa-glide-g' => 'fab fa-glide-g',
'fas fa-globe' => 'fas fa-globe',
'fab fa-gofore' => 'fab fa-gofore',
'fab fa-goodreads' => 'fab fa-goodreads',
'fab fa-goodreads-g' => 'fab fa-goodreads-g',
'fab fa-google' => 'fab fa-google',
'fab fa-google-drive' => 'fab fa-google-drive',
'fab fa-google-play' => 'fab fa-google-play',
'fab fa-google-plus' => 'fab fa-google-plus',
'fab fa-google-plus-g' => 'fab fa-google-plus-g',
'fab fa-google-plus-square' => 'fab fa-google-plus-square',
'fab fa-google-wallet' => 'fab fa-google-wallet',
'fas fa-graduation-cap' => 'fas fa-graduation-cap',
'fab fa-gratipay' => 'fab fa-gratipay',
'fab fa-grav' => 'fab fa-grav',
'fab fa-gripfire' => 'fab fa-gripfire',
'fab fa-grunt' => 'fab fa-grunt',
'fab fa-gulp' => 'fab fa-gulp',
'fas fa-h-square' => 'fas fa-h-square',
'fab fa-hacker-news' => 'fab fa-hacker-news',
'fab fa-hacker-news-square' => 'fab fa-hacker-news-square',
'fas fa-hand-lizard' => 'fas fa-hand-lizard',
'far fa-hand-lizard' => 'far fa-hand-lizard',
'fas fa-hand-paper' => 'fas fa-hand-paper',
'far fa-hand-paper' => 'far fa-hand-paper',
'fas fa-hand-peace' => 'fas fa-hand-peace',
'far fa-hand-peace' => 'far fa-hand-peace',
'fas fa-hand-point-down' => 'fas fa-hand-point-down',
'far fa-hand-point-down' => 'far fa-hand-point-down',
'fas fa-hand-point-left' => 'fas fa-hand-point-left',
'far fa-hand-point-left' => 'far fa-hand-point-left',
'fas fa-hand-point-right' => 'fas fa-hand-point-right',
'far fa-hand-point-right' => 'far fa-hand-point-right',
'fas fa-hand-point-up' => 'fas fa-hand-point-up',
'far fa-hand-point-up' => 'far fa-hand-point-up',
'fas fa-hand-pointer' => 'fas fa-hand-pointer',
'far fa-hand-pointer' => 'far fa-hand-pointer',
'fas fa-hand-rock' => 'fas fa-hand-rock',
'far fa-hand-rock' => 'far fa-hand-rock',
'fas fa-hand-scissors' => 'fas fa-hand-scissors',
'far fa-hand-scissors' => 'far fa-hand-scissors',
'fas fa-hand-spock' => 'fas fa-hand-spock',
'far fa-hand-spock' => 'far fa-hand-spock',
'fas fa-handshake' => 'fas fa-handshake',
'far fa-handshake' => 'far fa-handshake',
'fas fa-hashtag' => 'fas fa-hashtag',
'fas fa-hdd' => 'fas fa-hdd',
'far fa-hdd' => 'far fa-hdd',
'fas fa-heading' => 'fas fa-heading',
'fas fa-headphones' => 'fas fa-headphones',
'fas fa-heart' => 'fas fa-heart',
'far fa-heart' => 'far fa-heart',
'fas fa-heartbeat' => 'fas fa-heartbeat',
'fab fa-hire-a-helper' => 'fab fa-hire-a-helper',
'fas fa-history' => 'fas fa-history',
'fas fa-home' => 'fas fa-home',
'fab fa-hooli' => 'fab fa-hooli',
'fas fa-hospital' => 'fas fa-hospital',
'far fa-hospital' => 'far fa-hospital',
'fab fa-hotjar' => 'fab fa-hotjar',
'fas fa-hourglass' => 'fas fa-hourglass',
'far fa-hourglass' => 'far fa-hourglass',
'fas fa-hourglass-end' => 'fas fa-hourglass-end',
'fas fa-hourglass-half' => 'fas fa-hourglass-half',
'fas fa-hourglass-start' => 'fas fa-hourglass-start',
'fab fa-houzz' => 'fab fa-houzz',
'fab fa-html5' => 'fab fa-html5',
'fab fa-hubspot' => 'fab fa-hubspot',
'fas fa-i-cursor' => 'fas fa-i-cursor',
'fas fa-id-badge' => 'fas fa-id-badge',
'far fa-id-badge' => 'far fa-id-badge',
'fas fa-id-card' => 'fas fa-id-card',
'far fa-id-card' => 'far fa-id-card',
'fas fa-image' => 'fas fa-image',
'far fa-image' => 'far fa-image',
'fas fa-images' => 'fas fa-images',
'far fa-images' => 'far fa-images',
'fab fa-imdb' => 'fab fa-imdb',
'fas fa-inbox' => 'fas fa-inbox',
'fas fa-indent' => 'fas fa-indent',
'fas fa-industry' => 'fas fa-industry',
'fas fa-info' => 'fas fa-info',
'fas fa-info-circle' => 'fas fa-info-circle',
'fab fa-instagram' => 'fab fa-instagram',
'fab fa-internet-explorer' => 'fab fa-internet-explorer',
'fab fa-ioxhost' => 'fab fa-ioxhost',
'fas fa-italic' => 'fas fa-italic',
'fab fa-itunes' => 'fab fa-itunes',
'fab fa-itunes-note' => 'fab fa-itunes-note',
'fab fa-jenkins' => 'fab fa-jenkins',
'fab fa-joget' => 'fab fa-joget',
'fab fa-joomla' => 'fab fa-joomla',
'fab fa-js' => 'fab fa-js',
'fab fa-js-square' => 'fab fa-js-square',
'fab fa-jsfiddle' => 'fab fa-jsfiddle',
'fas fa-key' => 'fas fa-key',
'fas fa-keyboard' => 'fas fa-keyboard',
'far fa-keyboard' => 'far fa-keyboard',
'fab fa-keycdn' => 'fab fa-keycdn',
'fab fa-kickstarter' => 'fab fa-kickstarter',
'fab fa-kickstarter-k' => 'fab fa-kickstarter-k',
'fas fa-language' => 'fas fa-language',
'fas fa-laptop' => 'fas fa-laptop',
'fab fa-laravel' => 'fab fa-laravel',
'fab fa-lastfm' => 'fab fa-lastfm',
'fab fa-lastfm-square' => 'fab fa-lastfm-square',
'fas fa-leaf' => 'fas fa-leaf',
'fab fa-leanpub' => 'fab fa-leanpub',
'fas fa-lemon' => 'fas fa-lemon',
'far fa-lemon' => 'far fa-lemon', 'fab fa-less' => 'fab fa-less',
'fas fa-level-down-alt' => 'fas fa-level-down-alt',
'fas fa-level-up-alt' => 'fas fa-level-up-alt',
'fas fa-life-ring' => 'fas fa-life-ring',
'far fa-life-ring' => 'far fa-life-ring',
'fas fa-lightbulb' => 'fas fa-lightbulb',
'far fa-lightbulb' => 'far fa-lightbulb',
'fab fa-line' => 'fab fa-line',
'fas fa-link' => 'fas fa-link',
'fab fa-linkedin' => 'fab fa-linkedin',
'fab fa-linkedin-in' => 'fab fa-linkedin-in',
'fab fa-linode' => 'fab fa-linode',
'fab fa-linux' => 'fab fa-linux',
'fas fa-lira-sign' => 'fas fa-lira-sign',
'fas fa-list' => 'fas fa-list',
'fas fa-list-alt' => 'fas fa-list-alt',
'far fa-list-alt' => 'far fa-list-alt',
'fas fa-list-ol' => 'fas fa-list-ol',
'fas fa-list-ul' => 'fas fa-list-ul',
'fas fa-location-arrow' => 'fas fa-location-arrow',
'fas fa-lock' => 'fas fa-lock',
'fas fa-lock-open' => 'fas fa-lock-open',
'fas fa-long-arrow-alt-down' => 'fas fa-long-arrow-alt-down',
'fas fa-long-arrow-alt-left' => 'fas fa-long-arrow-alt-left',
'fas fa-long-arrow-alt-right' => 'fas fa-long-arrow-alt-right',
'fas fa-long-arrow-alt-up' => 'fas fa-long-arrow-alt-up',
'fas fa-low-vision' => 'fas fa-low-vision',
'fab fa-lyft' => 'fab fa-lyft',
'fab fa-magento' => 'fab fa-magento',
'fas fa-magic' => 'fas fa-magic',
'fas fa-magnet' => 'fas fa-magnet',
'fas fa-male' => 'fas fa-male',
'fas fa-map' => 'fas fa-map',
'far fa-map' => 'far fa-map',
'fas fa-map-marker' => 'fas fa-map-marker',
'fas fa-map-marker-alt' => 'fas fa-map-marker-alt',
'fas fa-map-pin' => 'fas fa-map-pin',
'fas fa-map-signs' => 'fas fa-map-signs',
'fas fa-mars' => 'fas fa-mars',
'fas fa-mars-double' => 'fas fa-mars-double',
'fas fa-mars-stroke' => 'fas fa-mars-stroke',
'fas fa-mars-stroke-h' => 'fas fa-mars-stroke-h',
'fas fa-mars-stroke-v' => 'fas fa-mars-stroke-v',
'fab fa-maxcdn' => 'fab fa-maxcdn',
'fab fa-medapps' => 'fab fa-medapps',
'fab fa-medium' => 'fab fa-medium',
'fab fa-medium-m' => 'fab fa-medium-m',
'fas fa-medkit' => 'fas fa-medkit',
'fab fa-medrt' => 'fab fa-medrt',
'fab fa-meetup' => 'fab fa-meetup',
'fas fa-meh' => 'fas fa-meh',
'far fa-meh' => 'far fa-meh',
'fas fa-mercury' => 'fas fa-mercury',
'fas fa-microchip' => 'fas fa-microchip',
'fas fa-microphone' => 'fas fa-microphone',
'fas fa-microphone-slash' => 'fas fa-microphone-slash',
'fab fa-microsoft' => 'fab fa-microsoft',
'fas fa-minus' => 'fas fa-minus',
'fas fa-minus-circle' => 'fas fa-minus-circle',
'fas fa-minus-square' => 'fas fa-minus-square',
'far fa-minus-square' => 'far fa-minus-square',
'fab fa-mix' => 'fab fa-mix',
'fab fa-mixcloud' => 'fab fa-mixcloud',
'fab fa-mizuni' => 'fab fa-mizuni',
'fas fa-mobile' => 'fas fa-mobile',
'fas fa-mobile-alt' => 'fas fa-mobile-alt',
'fab fa-modx' => 'fab fa-modx',
'fab fa-monero' => 'fab fa-monero',
'fas fa-money-bill-alt' => 'fas fa-money-bill-alt',
'far fa-money-bill-alt' => 'far fa-money-bill-alt',
'fas fa-moon' => 'fas fa-moon',
'far fa-moon' => 'far fa-moon',
'fas fa-motorcycle' => 'fas fa-motorcycle',
'fas fa-mouse-pointer' => 'fas fa-mouse-pointer',
'fas fa-music' => 'fas fa-music',
'fab fa-napster' => 'fab fa-napster',
'fas fa-neuter' => 'fas fa-neuter',
'fas fa-newspaper' => 'fas fa-newspaper',
'far fa-newspaper' => 'far fa-newspaper',
'fab fa-nintendo-switch' => 'fab fa-nintendo-switch',
'fab fa-node' => 'fab fa-node',
'fab fa-node-js' => 'fab fa-node-js',
'fab fa-npm' => 'fab fa-npm',
'fab fa-ns8' => 'fab fa-ns8',
'fab fa-nutritionix' => 'fab fa-nutritionix',
'fas fa-object-group' => 'fas fa-object-group',
'far fa-object-group' => 'far fa-object-group',
'fas fa-object-ungroup' => 'fas fa-object-ungroup',
'far fa-object-ungroup' => 'far fa-object-ungroup',
'fab fa-odnoklassniki' => 'fab fa-odnoklassniki',
'fab fa-odnoklassniki-square' => 'fab fa-odnoklassniki-square',
'fab fa-opencart' => 'fab fa-opencart',
'fab fa-openid' => 'fab fa-openid',
'fab fa-opera' => 'fab fa-opera',
'fab fa-optin-monster' => 'fab fa-optin-monster',
'fab fa-osi' => 'fab fa-osi',
'fas fa-outdent' => 'fas fa-outdent',
'fab fa-page4' => 'fab fa-page4',
'fab fa-pagelines' => 'fab fa-pagelines',
'fas fa-paint-brush' => 'fas fa-paint-brush',
'fab fa-palfed' => 'fab fa-palfed',
'fas fa-paper-plane' => 'fas fa-paper-plane',
'far fa-paper-plane' => 'far fa-paper-plane',
'fas fa-paperclip' => 'fas fa-paperclip',
'fas fa-paragraph' => 'fas fa-paragraph',
'fas fa-paste' => 'fas fa-paste',
'fab fa-patreon' => 'fab fa-patreon',
'fas fa-pause' => 'fas fa-pause',
'fas fa-pause-circle' => 'fas fa-pause-circle',
'far fa-pause-circle' => 'far fa-pause-circle',
'fas fa-paw' => 'fas fa-paw',
'fab fa-paypal' => 'fab fa-paypal',
'fas fa-pen-square' => 'fas fa-pen-square',
'fas fa-pencil-alt' => 'fas fa-pencil-alt',
'fas fa-percent' => 'fas fa-percent',
'fab fa-periscope' => 'fab fa-periscope',
'fab fa-phabricator' => 'fab fa-phabricator',
'fab fa-phoenix-framework' => 'fab fa-phoenix-framework',
'fas fa-phone' => 'fas fa-phone',
'fas fa-phone-square' => 'fas fa-phone-square',
'fas fa-phone-volume' => 'fas fa-phone-volume',
'fab fa-pied-piper' => 'fab fa-pied-piper',
'fab fa-pied-piper-alt' => 'fab fa-pied-piper-alt',
'fab fa-pied-piper-pp' => 'fab fa-pied-piper-pp',
'fab fa-pinterest' => 'fab fa-pinterest',
'fab fa-pinterest-p' => 'fab fa-pinterest-p',
'fab fa-pinterest-square' => 'fab fa-pinterest-square',
'fas fa-plane' => 'fas fa-plane',
'fas fa-play' => 'fas fa-play',
'fas fa-play-circle' => 'fas fa-play-circle',
'far fa-play-circle' => 'far fa-play-circle',
'fab fa-playstation' => 'fab fa-playstation',
'fas fa-plug' => 'fas fa-plug',
'fas fa-plus' => 'fas fa-plus',
'fas fa-plus-circle' => 'fas fa-plus-circle',
'fas fa-plus-square' => 'fas fa-plus-square',
'far fa-plus-square' => 'far fa-plus-square',
'fas fa-podcast' => 'fas fa-podcast',
'fas fa-pound-sign' => 'fas fa-pound-sign',
'fas fa-power-off' => 'fas fa-power-off',
'fas fa-print' => 'fas fa-print',
'fab fa-product-hunt' => 'fab fa-product-hunt',
'fab fa-pushed' => 'fab fa-pushed',
'fas fa-puzzle-piece' => 'fas fa-puzzle-piece',
'fab fa-python' => 'fab fa-python',
'fab fa-qq' => 'fab fa-qq',
'fas fa-qrcode' => 'fas fa-qrcode',
'fas fa-question' => 'fas fa-question',
'fas fa-question-circle' => 'fas fa-question-circle',
'far fa-question-circle' => 'far fa-question-circle',
'fab fa-quora' => 'fab fa-quora',
'fas fa-quote-left' => 'fas fa-quote-left',
'fas fa-quote-right' => 'fas fa-quote-right',
'fas fa-random' => 'fas fa-random',
'fab fa-ravelry' => 'fab fa-ravelry',
'fab fa-react' => 'fab fa-react',
'fab fa-rebel' => 'fab fa-rebel',
'fas fa-recycle' => 'fas fa-recycle',
'fab fa-red-river' => 'fab fa-red-river',
'fab fa-reddit' => 'fab fa-reddit',
'fab fa-reddit-alien' => 'fab fa-reddit-alien',
'fab fa-reddit-square' => 'fab fa-reddit-square',
'fas fa-redo' => 'fas fa-redo',
'fas fa-redo-alt' => 'fas fa-redo-alt',
'fas fa-registered' => 'fas fa-registered',
'far fa-registered' => 'far fa-registered',
'fab fa-rendact' => 'fab fa-rendact',
'fab fa-renren' => 'fab fa-renren',
'fas fa-reply' => 'fas fa-reply',
'fas fa-reply-all' => 'fas fa-reply-all',
'fab fa-replyd' => 'fab fa-replyd',
'fab fa-resolving' => 'fab fa-resolving',
'fas fa-retweet' => 'fas fa-retweet',
'fas fa-road' => 'fas fa-road',
'fas fa-rocket' => 'fas fa-rocket',
'fab fa-rocketchat' => 'fab fa-rocketchat',
'fab fa-rockrms' => 'fab fa-rockrms',
'fas fa-rss' => 'fas fa-rss',
'fas fa-rss-square' => 'fas fa-rss-square',
'fas fa-ruble-sign' => 'fas fa-ruble-sign',
'fas fa-rupee-sign' => 'fas fa-rupee-sign',
'fab fa-safari' => 'fab fa-safari',
'fab fa-sass' => 'fab fa-sass',
'fas fa-save' => 'fas fa-save',
'far fa-save' => 'far fa-save',
'fab fa-schlix' => 'fab fa-schlix',
'fab fa-scribd' => 'fab fa-scribd',
'fas fa-search' => 'fas fa-search', 'fas fa-search-minus' => 'fas fa-search-minus',
'fas fa-search-plus' => 'fas fa-search-plus',
'fab fa-searchengin' => 'fab fa-searchengin',
'fab fa-sellcast' => 'fab fa-sellcast',
'fab fa-sellsy' => 'fab fa-sellsy',
'fas fa-server' => 'fas fa-server',
'fab fa-servicestack' => 'fab fa-servicestack',
'fas fa-share' => 'fas fa-share',
'fas fa-share-alt' => 'fas fa-share-alt',
'fas fa-share-alt-square' => 'fas fa-share-alt-square',
'fas fa-share-square' => 'fas fa-share-square',
'far fa-share-square' => 'far fa-share-square',
'fas fa-shekel-sign' => 'fas fa-shekel-sign',
'fas fa-shield-alt' => 'fas fa-shield-alt',
'fas fa-ship' => 'fas fa-ship',
'fab fa-shirtsinbulk' => 'fab fa-shirtsinbulk',
'fas fa-shopping-bag' => 'fas fa-shopping-bag',
'fas fa-shopping-basket' => 'fas fa-shopping-basket',
'fas fa-shopping-cart' => 'fas fa-shopping-cart',
'fas fa-shower' => 'fas fa-shower',
'fas fa-sign-in-alt' => 'fas fa-sign-in-alt',
'fas fa-sign-language' => 'fas fa-sign-language',
'fas fa-sign-out-alt' => 'fas fa-sign-out-alt',
'fas fa-signal' => 'fas fa-signal',
'fab fa-simplybuilt' => 'fab fa-simplybuilt',
'fab fa-sistrix' => 'fab fa-sistrix',
'fas fa-sitemap' => 'fas fa-sitemap',
'fab fa-skyatlas' => 'fab fa-skyatlas',
'fab fa-skype' => 'fab fa-skype',
'fab fa-slack' => 'fab fa-slack',
'fab fa-slack-hash' => 'fab fa-slack-hash',
'fas fa-sliders-h' => 'fas fa-sliders-h',
'fab fa-slideshare' => 'fab fa-slideshare',
'fas fa-smile' => 'fas fa-smile',
'far fa-smile' => 'far fa-smile',
'fab fa-snapchat' => 'fab fa-snapchat',
'fab fa-snapchat-ghost' => 'fab fa-snapchat-ghost',
'fab fa-snapchat-square' => 'fab fa-snapchat-square',
'fas fa-snowflake' => 'fas fa-snowflake',
'far fa-snowflake' => 'far fa-snowflake',
'fas fa-sort' => 'fas fa-sort',
'fas fa-sort-alpha-down' => 'fas fa-sort-alpha-down',
'fas fa-sort-alpha-up' => 'fas fa-sort-alpha-up',
'fas fa-sort-amount-down' => 'fas fa-sort-amount-down',
'fas fa-sort-amount-up' => 'fas fa-sort-amount-up',
'fas fa-sort-down' => 'fas fa-sort-down',
'fas fa-sort-numeric-down' => 'fas fa-sort-numeric-down',
'fas fa-sort-numeric-up' => 'fas fa-sort-numeric-up',
'fas fa-sort-up' => 'fas fa-sort-up',
'fab fa-soundcloud' => 'fab fa-soundcloud',
'fas fa-space-shuttle' => 'fas fa-space-shuttle',
'fab fa-speakap' => 'fab fa-speakap',
'fas fa-spinner' => 'fas fa-spinner',
'fab fa-spotify' => 'fab fa-spotify',
'fas fa-square' => 'fas fa-square',
'far fa-square' => 'far fa-square',
'fab fa-stack-exchange' => 'fab fa-stack-exchange',
'fab fa-stack-overflow' => 'fab fa-stack-overflow',
'fas fa-star' => 'fas fa-star',
'far fa-star' => 'far fa-star',
'fas fa-star-half' => 'fas fa-star-half',
'far fa-star-half' => 'far fa-star-half',
'fab fa-staylinked' => 'fab fa-staylinked',
'fab fa-steam' => 'fab fa-steam',
'fab fa-steam-square' => 'fab fa-steam-square',
'fab fa-steam-symbol' => 'fab fa-steam-symbol',
'fas fa-step-backward' => 'fas fa-step-backward',
'fas fa-step-forward' => 'fas fa-step-forward',
'fas fa-stethoscope' => 'fas fa-stethoscope',
'fab fa-sticker-mule' => 'fab fa-sticker-mule',
'fas fa-sticky-note' => 'fas fa-sticky-note',
'far fa-sticky-note' => 'far fa-sticky-note',
'fas fa-stop' => 'fas fa-stop',
'fas fa-stop-circle' => 'fas fa-stop-circle',
'far fa-stop-circle' => 'far fa-stop-circle',
'fab fa-strava' => 'fab fa-strava',
'fas fa-street-view' => 'fas fa-street-view',
'fas fa-strikethrough' => 'fas fa-strikethrough',
'fab fa-stripe' => 'fab fa-stripe',
'fab fa-stripe-s' => 'fab fa-stripe-s',
'fab fa-studiovinari' => 'fab fa-studiovinari',
'fab fa-stumbleupon' => 'fab fa-stumbleupon',
'fab fa-stumbleupon-circle' => 'fab fa-stumbleupon-circle',
'fas fa-subscript' => 'fas fa-subscript',
'fas fa-subway' => 'fas fa-subway',
'fas fa-suitcase' => 'fas fa-suitcase',
'fas fa-sun' => 'fas fa-sun',
'far fa-sun' => 'far fa-sun',
'fab fa-superpowers' => 'fab fa-superpowers', 'fas fa-superscript' => 'fas fa-superscript',
'fab fa-supple' => 'fab fa-supple',
'fas fa-sync' => 'fas fa-sync',
'fas fa-sync-alt' => 'fas fa-sync-alt',
'fas fa-table' => 'fas fa-table',
'fas fa-tablet' => 'fas fa-tablet',
'fas fa-tablet-alt' => 'fas fa-tablet-alt',
'fas fa-tachometer-alt' => 'fas fa-tachometer-alt',
'fas fa-tag' => 'fas fa-tag',
'fas fa-tags' => 'fas fa-tags',
'fas fa-tasks' => 'fas fa-tasks',
'fas fa-taxi' => 'fas fa-taxi',
'fab fa-telegram' => 'fab fa-telegram',
'fab fa-telegram-plane' => 'fab fa-telegram-plane',
'fab fa-tencent-weibo' => 'fab fa-tencent-weibo',
'fas fa-terminal' => 'fas fa-terminal',
'fas fa-text-height' => 'fas fa-text-height',
'fas fa-text-width' => 'fas fa-text-width',
'fas fa-th' => 'fas fa-th',
'fas fa-th-large' => 'fas fa-th-large',
'fas fa-th-list' => 'fas fa-th-list',
'fab fa-themeisle' => 'fab fa-themeisle',
'fas fa-thermometer-empty' => 'fas fa-thermometer-empty',
'fas fa-thermometer-full' => 'fas fa-thermometer-full',
'fas fa-thermometer-half' => 'fas fa-thermometer-half',
'fas fa-thermometer-quarter' => 'fas fa-thermometer-quarter',
'fas fa-thermometer-three-quarters' => 'fas fa-thermometer-three-quarters',
'fas fa-thumbs-down' => 'fas fa-thumbs-down',
'far fa-thumbs-down' => 'far fa-thumbs-down',
'fas fa-thumbs-up' => 'fas fa-thumbs-up',
'far fa-thumbs-up' => 'far fa-thumbs-up',
'fas fa-thumbtack' => 'fas fa-thumbtack',
'fas fa-ticket-alt' => 'fas fa-ticket-alt',
'fas fa-times' => 'fas fa-times',
'fas fa-times-circle' => 'fas fa-times-circle',
'far fa-times-circle' => 'far fa-times-circle',
'fas fa-tint' => 'fas fa-tint',
'fas fa-toggle-off' => 'fas fa-toggle-off',
'fas fa-toggle-on' => 'fas fa-toggle-on',
'fas fa-trademark' => 'fas fa-trademark',
'fas fa-train' => 'fas fa-train',
'fas fa-transgender' => 'fas fa-transgender',
'fas fa-transgender-alt' => 'fas fa-transgender-alt',
'fas fa-trash' => 'fas fa-trash',
'fas fa-trash-alt' => 'fas fa-trash-alt',
'far fa-trash-alt' => 'far fa-trash-alt',
'fas fa-tree' => 'fas fa-tree',
'fab fa-trello' => 'fab fa-trello',
'fab fa-tripadvisor' => 'fab fa-tripadvisor',
'fas fa-trophy' => 'fas fa-trophy',
'fas fa-truck' => 'fas fa-truck',
'fas fa-tty' => 'fas fa-tty',
'fab fa-tumblr' => 'fab fa-tumblr',
'fab fa-tumblr-square' => 'fab fa-tumblr-square',
'fas fa-tv' => 'fas fa-tv',
'fab fa-twitch' => 'fab fa-twitch',
'fab fa-twitter' => 'fab fa-twitter',
'fab fa-x-twitter' => 'fab fa-x-twitter',
'fab fa-twitter-square' => 'fab fa-twitter-square',
'fab fa-typo3' => 'fab fa-typo3',
'fab fa-uber' => 'fab fa-uber',
'fab fa-uikit' => 'fab fa-uikit',
'fas fa-umbrella' => 'fas fa-umbrella',
'fas fa-underline' => 'fas fa-underline',
'fas fa-undo' => 'fas fa-undo',
'fas fa-undo-alt' => 'fas fa-undo-alt',
'fab fa-uniregistry' => 'fab fa-uniregistry',
'fas fa-universal-access' => 'fas fa-universal-access',
'fas fa-university' => 'fas fa-university',
'fas fa-unlink' => 'fas fa-unlink',
'fas fa-unlock' => 'fas fa-unlock',
'fas fa-unlock-alt' => 'fas fa-unlock-alt',
'fab fa-untappd' => 'fab fa-untappd',
'fas fa-upload' => 'fas fa-upload',
'fab fa-usb' => 'fab fa-usb',
'fas fa-user' => 'fas fa-user',
'far fa-user' => 'far fa-user',
'fas fa-user-circle' => 'fas fa-user-circle',
'far fa-user-circle' => 'far fa-user-circle',
'fas fa-user-md' => 'fas fa-user-md',
'fas fa-user-plus' => 'fas fa-user-plus',
'fas fa-user-secret' => 'fas fa-user-secret',
'fas fa-user-times' => 'fas fa-user-times',
'fas fa-users' => 'fas fa-users',
'fab fa-ussunnah' => 'fab fa-ussunnah',
'fas fa-utensil-spoon' => 'fas fa-utensil-spoon',
'fas fa-utensils' => 'fas fa-utensils',
'fab fa-vaadin' => 'fab fa-vaadin',
'fas fa-venus' => 'fas fa-venus',
'fas fa-venus-double' => 'fas fa-venus-double',
'fas fa-venus-mars' => 'fas fa-venus-mars',
'fab fa-viacoin' => 'fab fa-viacoin',
'fab fa-viadeo' => 'fab fa-viadeo',
'fab fa-viadeo-square' => 'fab fa-viadeo-square',
'fab fa-viber' => 'fab fa-viber',
'fas fa-video' => 'fas fa-video',
'fab fa-vimeo' => 'fab fa-vimeo',
'fab fa-vimeo-square' => 'fab fa-vimeo-square',
'fab fa-vimeo-v' => 'fab fa-vimeo-v',
'fab fa-vine' => 'fab fa-vine',
'fab fa-vk' => 'fab fa-vk',
'fab fa-vnv' => 'fab fa-vnv',
'fas fa-volume-down' => 'fas fa-volume-down',
'fas fa-volume-off' => 'fas fa-volume-off',
'fas fa-volume-up' => 'fas fa-volume-up',
'fab fa-vuejs' => 'fab fa-vuejs',
'fab fa-weibo' => 'fab fa-weibo',
'fab fa-weixin' => 'fab fa-weixin',
'fab fa-whatsapp' => 'fab fa-whatsapp',
'fab fa-whatsapp-square' => 'fab fa-whatsapp-square',
'fas fa-wheelchair' => 'fas fa-wheelchair',
'fab fa-whmcs' => 'fab fa-whmcs',
'fas fa-wifi' => 'fas fa-wifi',
'fab fa-wikipedia-w' => 'fab fa-wikipedia-w',
'fas fa-window-close' => 'fas fa-window-close',
'far fa-window-close' => 'far fa-window-close',
'fas fa-window-maximize' => 'fas fa-window-maximize',
'far fa-window-maximize' => 'far fa-window-maximize',
'fas fa-window-minimize' => 'fas fa-window-minimize',
'fas fa-window-restore' => 'fas fa-window-restore',
'far fa-window-restore' => 'far fa-window-restore',
'fab fa-windows' => 'fab fa-windows',
'fas fa-won-sign' => 'fas fa-won-sign',
'fab fa-wordpress' => 'fab fa-wordpress',
'fab fa-wordpress-simple' => 'fab fa-wordpress-simple',
'fab fa-wpbeginner' => 'fab fa-wpbeginner',
'fab fa-wpexplorer' => 'fab fa-wpexplorer',
'fab fa-wpforms' => 'fab fa-wpforms',
'fas fa-wrench' => 'fas fa-wrench',
'fab fa-xbox' => 'fab fa-xbox',
'fab fa-xing' => 'fab fa-xing',
'fab fa-xing-square' => 'fab fa-xing-square',
'fab fa-y-combinator' => 'fab fa-y-combinator',
'fab fa-yahoo' => 'fab fa-yahoo',
'fab fa-yandex' => 'fab fa-yandex',
'fab fa-yandex-international' => 'fab fa-yandex-international',
'fab fa-yelp' => 'fab fa-yelp',
'fas fa-yen-sign' => 'fas fa-yen-sign',
'fab fa-yoast' => 'fab fa-yoast', 'fab fa-youtube' => 'fab fa-youtube',
);
return $icons;
}
}

View File

@@ -0,0 +1,310 @@
<?php
/**
* The range value customize control extends the WP_Customize_Control class.
*
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2016, Soderlind
* @link https://github.com/soderlind/class-customizer-range-value-control/blob/master/README.md
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* @package customizer-controls
*/
if ( ! class_exists( 'WP_Customize_Control' ) ) {
return;
}
/**
* Class Customizer_Range_Value_Control
*
* @access public
*/
class Chromax_Customizer_Range_Control extends WP_Customize_Control {
/**
* Control type
*
* @var string
*/
public $type = 'range-value';
/**
* Flag that enables media queries
*
* @var bool
*/
public $media_query = false;
/**
* Settings for range inputs.
*
* @var array|mixed
*/
public $input_attr = array();
/**
* Enqueue scripts all controls.
*/
public function enqueue() {
// Main scripts.
wp_enqueue_script(
'chromax-controls',
CHROMAX_THEME_INC_URI . '/customizer/controls/js/controls.js',
array(
'jquery',
'customize-base',
'jquery-ui-button',
'jquery-ui-sortable',
),
false,
true
);
wp_enqueue_style( 'chromax-controls', CHROMAX_THEME_INC_URI . '/customizer/controls/css/controls.css' );
wp_enqueue_style( 'font-awesome', CHROMAX_THEME_URI . '/assets/vendors/css/all.min.css' );
}
/**
* Chromax_Customizer_Range_Control constructor.
*
* @param WP_Customize_Manager $manager Customize manager.
* @param string $id Control id.
* @param array $args Control arguments.
*/
public function __construct( $manager, $id, $args = array() ) {
parent::__construct( $manager, $id, $args );
if ( ! empty( $args['media_query'] ) ) {
$this->media_query = (bool) $args['media_query'];
}
if ( ! empty( $args['input_attr'] ) ) {
$this->input_attr = $args['input_attr'];
}
}
/**
* Handles input value.
*/
public function json() {
$json = parent::json();
$json['value'] = $this->value();
$json['default_value'] = ! empty( $this->setting->default ) ? $this->setting->default : 0;
$json['desktop_value'] = ! $this->is_json( $json['value'] ) ? $json['value'] : $json['default_value'];
$json['tablet_value'] = $json['default_value'];
$json['mobile_value'] = $json['default_value'];
if ( $this->is_json( $json['value'] ) ) {
$decoded_value = json_decode( $json['value'], true );
$json['desktop_value'] = $decoded_value['desktop'];
$json['tablet_value'] = $decoded_value['tablet'];
$json['mobile_value'] = $decoded_value['mobile'];
} else {
$json['desktop_value'] = $json['value'];
}
$json['media_query'] = $this->media_query;
$json['link'] = $this->get_link();
if ( ! $this->contains_array( $this->input_attr ) ) {
$json['min'] = ! empty( $this->input_attr['min'] ) ? $this->input_attr['min'] : 0;
$json['max'] = ! empty( $this->input_attr['max'] ) ? $this->input_attr['max'] : 1;
$json['step'] = ! empty( $this->input_attr['step'] ) ? $this->input_attr['step'] : 1;
} else {
foreach ( $this->input_attr as $device => $value ) {
$json[ $device ] = $value;
}
}
return $json;
}
/**
* Check if an array contains another array.
*
* @param array $array Array to check.
*/
private function contains_array( $array ) {
foreach ( $array as $value ) {
if ( is_array( $value ) ) {
return true;
}
}
return false;
}
/**
* Check if a string is in json format
*
* @param string $string Input.
*/
public function is_json( $string ) {
return is_string( $string ) && is_array( json_decode( $string, true ) ) ? true : false;
}
/**
* Render the control's content.
*
* @access public
*/
protected function content_template() {
?>
<# if ( data.label ) { #>
<span class="customize-control-title">
<span>{{{ data.label }}}</span>
</span>
<# if ( data.media_query ) { #>
<ul class="responsive-switchers" data-plm="<# if( data.mobile ){ #> {{{data.mobile.min }}} <# } #>">
<li class="desktop">
<button type="button" class="preview-desktop active" data-device="desktop">
<i class="dashicons dashicons-desktop"></i>
</button>
</li>
<li class="tablet">
<button type="button" class="preview-tablet" data-device="tablet">
<i class="dashicons dashicons-tablet"></i>
</button>
</li>
<li class="mobile">
<button type="button" class="preview-mobile" data-device="mobile">
<i class="dashicons dashicons-smartphone"></i>
</button>
</li>
</ul>
<# } #>
<# }
var min, max, step, default_value;
if( data.min ){
min = data.min;
}
if( data.max ){
max = data.max;
}
if( data.step ){
step = data.step;
}
if( data.default_value ){
default_value = data.default_value;
}
if( data.desktop ){
if ( data.desktop.min ){
min = data.desktop.min;
}
if ( data.desktop.max ){
max = data.desktop.max;
}
if ( data.desktop.step ){
step = data.desktop.step;
}
if ( data.desktop.default_value ){
default_value = data.desktop.default_value;
}
}
if( data.desktop_value ){
value = data.desktop_value;
} else {
if( default_value ) {
value = default_value;
}
}
#>
<div class="range-slider <# if ( data.media_query ) { #>has-media-queries<# }#>">
<div class="desktop-range active">
<input type="range" class="range-slider__range" title="{{{data.label}}}" min="{{min}}" max="{{max}}" step="{{step}}" data-query="desktop" data-default="{{default_value}}" value="{{ value }}">
<input type="number" class="range-slider-value" title="{{{data.label}}}" min="{{min}}" max="{{max}}" step="{{step}}" value="{{ value }}">
<span class="range-reset-slider"><span class="dashicons dashicons-image-rotate"></span></span>
</div>
<# if ( data.media_query ) {
if( data.tablet ){
if ( data.tablet.min ){
min = data.tablet.min;
}
if ( data.tablet.max ){
max = data.tablet.max;
}
if ( data.tablet.step ){
step = data.tablet.step;
}
if ( data.tablet.default_value ){
default_value = data.tablet.default_value;
}
}
if( data.tablet_value ){
value = data.tablet_value;
} else {
if( default_value ) {
value = default_value;
}
}
#>
<div class="tablet-range">
<input type="range" class="range-slider__range" title="{{{data.label}}}" min="{{min}}" max="{{max}}" step="{{step}}" data-query="tablet" data-default="{{default_value}}" value="{{ value }}">
<input type="number" class="range-slider-value" title="{{{data.label}}}" min="{{min}}" max="{{max}}" step="{{step}}" value="{{ value }}">
<span class="range-reset-slider"><span class="dashicons dashicons-image-rotate"></span></span>
</div>
<# if( data.mobile ){
if ( data.mobile.min ){
min = data.mobile.min;
}
if ( data.mobile.max ){
max = data.mobile.max;
}
if ( data.mobile.step ){
step = data.mobile.step;
}
if ( data.mobile.default_value ){
default_value = data.mobile.default_value;
}
if( data.mobile_value ){
value = data.mobile_value;
} else {
if( default_value ) {
value = default_value;
}
}
} #>
<div class="mobile-range">
<input type="range" class="range-slider__range" title="{{{data.label}}}" min="{{min}}" max="{{max}}" step="{{step}}" data-query="mobile" data-default="{{default_value}}" value="{{ value }}">
<input type="number" class="range-slider-value" title="{{{data.label}}}" min="{{min}}" max="{{max}}" step="{{step}}" value="{{{ value }}}">
<span class="range-reset-slider"><span class="dashicons dashicons-image-rotate"></span></span>
</div>
<# } #>
<input type="hidden" class="range-collector" title="{{{data.label}}}" value="{{ data.value }}" {{{ data.link }}} >
</div>
<?php
}
}
/**
* Sanitize values for range inputs.
*
* @param string $input Control input.
*/
function chromax_sanitize_range_value( $input ) {
if ( chromax_is_json( $input ) ) {
$range_value = json_decode( $input, true );
$range_value['desktop'] = ! empty( $range_value['desktop'] ) || $range_value['desktop'] === '0' ? floatval( $range_value['desktop'] ) : '';
$range_value['tablet'] = ! empty( $range_value['tablet'] ) || $range_value['tablet'] === '0' ? floatval( $range_value['tablet'] ) : '';
$range_value['mobile'] = ! empty( $range_value['mobile'] ) || $range_value['mobile'] === '0' ? floatval( $range_value['mobile'] ) : '';
return json_encode( $range_value );
}
return floatval( $input );
}
/**
* Check if a string is in json format
*
* @param string $string Input.
*/
function chromax_is_json( $string ) {
return is_string( $string ) && is_array( json_decode( $string, true ) ) ? true : false;
}

View File

@@ -0,0 +1,101 @@
<?php
/**
* Takes Ranges Control JSON values, decodes and ouputs accordingly
* @param [string] $css_prop CSS Property to add
* @param [JSON Object] $obj_value Json Object Value
* @param [string] $ext css value extension, eg. px, in, pc
* @return [string]
*/
function chromax_media_range( $css_prop, $obj_value, $default, $media = 'desktop', $ext = '' ) {
if( is_string( $obj_value ) && is_array( json_decode( $obj_value, true ) ) ){
/* It means that we have media queries active */
$json = json_decode( $obj_value );
$value = '';
if ( $media == 'desktop' && $json->desktop != $default ) {
if ( is_array( $css_prop ) ) {
$value = $css_prop[0] . ': ' . esc_attr ( $json->desktop ) . $ext . ';';
if ( count( $css_prop ) > 1 ) {
$value .= $css_prop[1] . ': ' . esc_attr ( $json->desktop ) . $ext . ';';
}
} else {
$value = $css_prop . ': ' . esc_attr ( $json->desktop ) . $ext . ';';
}
}
if ( $media == 'mobile' && $json->mobile != $default ) {
if ( is_array( $css_prop ) ) {
$value = $css_prop[0] . ': ' . esc_attr ( $json->mobile ) . $ext . ';';
if ( count( $css_prop ) > 1 ) {
$value .= $css_prop[1] . ': ' . esc_attr ( $json->mobile ) . $ext . ';';
}
} else {
$value = $css_prop . ': ' . esc_attr ( $json->mobile ) . $ext . ';';
}
}
if ( $media == 'tablet' && $json->tablet != $default ) {
if ( is_array( $css_prop ) ) {
$value = $css_prop[0] . ': ' . esc_attr ( $json->tablet ) . $ext . ';';
if ( count( $css_prop ) > 1 ) {
$value .= $css_prop[1] . ': ' . esc_attr ( $json->tablet ) . $ext . ';';
}
} else {
$value = $css_prop . ': ' . esc_attr ( $json->tablet ) . $ext . ';';
}
}
return $value;
}
return false;
}
/**
* Takes Ranges Control applies to chromax_media_range function and ouputs Full css with @media query
* @param [string] $css_prop CSS Property to add
* @param [string] $control control / settings
* @param [string] $ext css value extension, eg. px, in, pc
* @return [string]
*/
function chromax_customizer_value( $control, $css_selector, $css_prop, array $default, $ext = '' ) {
if ( $control ) {
$control = get_theme_mod( $control );
$return = '';
if( is_string( $control ) && is_array( json_decode( $control, true ) ) ){
$desktop_val = chromax_media_range( $css_prop, $control, $default[0], 'desktop', $ext );
$tablet_val = chromax_media_range( $css_prop, $control, $default[1], 'tablet', $ext );
$mobile_val = chromax_media_range( $css_prop, $control, $default[2], 'mobile', $ext );
if ( !empty( $desktop_val ) ) {
$return = $css_selector . ' { ';
$return .= $desktop_val;
$return .= '} ';
}
if ( !empty( $tablet_val ) ) {
$return .= '@media (max-width:768px) {';
$return .= $css_selector . ' { ';
$return .= $tablet_val;
$return .= '} } ';
}
if ( !empty( $mobile_val ) ) {
$return .= '@media (max-width:480px) {';
$return .= $css_selector . ' { ';
$return .= $mobile_val;
$return .= '} } ';
}
} else {
if ( !empty( $control ) && $control != $default[0] ) {
$return .= $css_selector . ' { ';
$return .= esc_attr( $control ) . $ext . ';';
$return .= ' } ';
}
}
return $return;
}
return false;
}

View File

@@ -0,0 +1,978 @@
<?php if ( ! class_exists( 'WP_Customize_Control' ) ) {
return null;
}
class CHROMAX_Repeater extends WP_Customize_Control {
public $id;
private $boxtitle = array();
private $add_field_label = array();
private $customizer_repeater_title_control = false;
private $customizer_repeater_subtitle_control = false;
private $customizer_repeater_subtitle2_control = false;
private $customizer_repeater_subtitle3_control = false;
private $customizer_repeater_subtitle4_control = false;
private $customizer_repeater_subtitle5_control = false;
private $customizer_repeater_button_text_control = false;
private $customizer_repeater_link_control = false;
private $customizer_repeater_slide_align = false;
private $customizer_repeater_bg_type = false;
private $customizer_repeater_video_url_control = false;
private $customizer_repeater_image_control = false;
private $customizer_repeater_image2_control = false;
private $customizer_repeater_icon_control = false;
private $customizer_repeater_color_control = false;
private $customizer_repeater_text_control = false;
public $customizer_repeater_text2_control = false;
public $customizer_repeater_button2_control = false;
public $customizer_repeater_link2_control = false;
public $customizer_repeater_link3_control = false;
private $customizer_repeater_designation_control = false;
private $customizer_repeater_shortcode_control = false;
private $customizer_repeater_repeater_control = false;
private $customizer_repeater_checkbox_control = false;
private $customizer_icon_container = '';
private $allowed_html = array();
/*Class constructor*/
public function __construct( $manager, $id, $args = array() ) {
parent::__construct( $manager, $id, $args );
/*Get options from customizer.php*/
$this->add_field_label = esc_html__( 'Add new field', 'chromax' );
if ( ! empty( $args['add_field_label'] ) ) {
$this->add_field_label = $args['add_field_label'];
}
$this->boxtitle = esc_html__( 'Customizer Repeater', 'chromax' );
if ( ! empty ( $args['item_name'] ) ) {
$this->boxtitle = $args['item_name'];
} elseif ( ! empty( $this->label ) ) {
$this->boxtitle = $this->label;
}
if ( ! empty( $args['customizer_repeater_image_control'] ) ) {
$this->customizer_repeater_image_control = $args['customizer_repeater_image_control'];
}
if ( ! empty( $args['customizer_repeater_image2_control'] ) ) {
$this->customizer_repeater_image2_control = $args['customizer_repeater_image2_control'];
}
if ( ! empty( $args['customizer_repeater_icon_control'] ) ) {
$this->customizer_repeater_icon_control = $args['customizer_repeater_icon_control'];
}
if ( ! empty( $args['customizer_repeater_color_control'] ) ) {
$this->customizer_repeater_color_control = $args['customizer_repeater_color_control'];
}
if ( ! empty( $args['customizer_repeater_title_control'] ) ) {
$this->customizer_repeater_title_control = $args['customizer_repeater_title_control'];
}
if ( ! empty( $args['customizer_repeater_subtitle_control'] ) ) {
$this->customizer_repeater_subtitle_control = $args['customizer_repeater_subtitle_control'];
}
if ( ! empty( $args['customizer_repeater_subtitle2_control'] ) ) {
$this->customizer_repeater_subtitle2_control = $args['customizer_repeater_subtitle2_control'];
}
if ( ! empty( $args['customizer_repeater_subtitle3_control'] ) ) {
$this->customizer_repeater_subtitle3_control = $args['customizer_repeater_subtitle3_control'];
}
if ( ! empty( $args['customizer_repeater_subtitle4_control'] ) ) {
$this->customizer_repeater_subtitle4_control = $args['customizer_repeater_subtitle4_control'];
}
if ( ! empty( $args['customizer_repeater_subtitle5_control'] ) ) {
$this->customizer_repeater_subtitle5_control = $args['customizer_repeater_subtitle5_control'];
}
if ( ! empty( $args['customizer_repeater_text_control'] ) ) {
$this->customizer_repeater_text_control = $args['customizer_repeater_text_control'];
}
if ( ! empty( $args['customizer_repeater_text2_control'] ) ) {
$this->customizer_repeater_text2_control = $args['customizer_repeater_text2_control'];
}
if ( ! empty( $args['customizer_repeater_button2_control'] ) ) {
$this->customizer_repeater_button2_control = $args['customizer_repeater_button2_control'];
}
if ( ! empty( $args['customizer_repeater_link2_control'] ) ) {
$this->customizer_repeater_link2_control = $args['customizer_repeater_link2_control'];
}
if ( ! empty( $args['customizer_repeater_link3_control'] ) ) {
$this->customizer_repeater_link3_control = $args['customizer_repeater_link3_control'];
}
if ( ! empty( $args['customizer_repeater_designation_control'] ) ) {
$this->customizer_repeater_designation_control = $args['customizer_repeater_designation_control'];
}
if ( ! empty( $args['customizer_repeater_button_text_control'] ) ) {
$this->customizer_repeater_button_text_control = $args['customizer_repeater_button_text_control'];
}
if ( ! empty( $args['customizer_repeater_link_control'] ) ) {
$this->customizer_repeater_link_control = $args['customizer_repeater_link_control'];
}
if ( ! empty( $args['customizer_repeater_checkbox_control'] ) ) {
$this->customizer_repeater_checkbox_control = $args['customizer_repeater_checkbox_control'];
}
if ( ! empty( $args['customizer_repeater_video_url_control'] ) ) {
$this->customizer_repeater_video_url_control = $args['customizer_repeater_video_url_control'];
}
if ( ! empty( $args['customizer_repeater_slide_align'] ) ) {
$this->customizer_repeater_slide_align = $args['customizer_repeater_slide_align'];
}
if ( ! empty( $args['customizer_repeater_bg_type'] ) ) {
$this->customizer_repeater_bg_type = $args['customizer_repeater_bg_type'];
}
if ( ! empty( $args['customizer_repeater_shortcode_control'] ) ) {
$this->customizer_repeater_shortcode_control = $args['customizer_repeater_shortcode_control'];
}
if ( ! empty( $args['customizer_repeater_repeater_control'] ) ) {
$this->customizer_repeater_repeater_control = $args['customizer_repeater_repeater_control'];
}
if ( ! empty( $id ) ) {
$this->id = $id;
}
if ( file_exists( get_template_directory() . '/inc/customizer/controls/code/customizer-repeater/inc/icons.php' ) ) {
$this->customizer_icon_container = 'inc/customizer/controls/code/customizer-repeater/inc/icons';
}
$allowed_array1 = wp_kses_allowed_html( 'post' );
$allowed_array2 = array(
'input' => array(
'type' => array(),
'class' => array(),
'placeholder' => array()
)
);
$this->allowed_html = array_merge( $allowed_array1, $allowed_array2 );
}
/*Enqueue resources for the control*/
public function enqueue() {
wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/vendors/css/all.min.css', array(), 999 );
wp_enqueue_style( 'chromax_customizer-repeater-admin-stylesheet', get_template_directory_uri() . '/inc/customizer/controls/code/customizer-repeater/css/admin-style.css', array(), 999 );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'chromax_customizer-repeater-script', get_template_directory_uri() . '/inc/customizer/controls/code/customizer-repeater/js/customizer_repeater.js', array('jquery', 'jquery-ui-draggable', 'wp-color-picker' ), 999, true );
wp_enqueue_script( 'chromax_customizer-repeater-fontawesome-iconpicker', get_template_directory_uri() . '/inc/customizer/controls/code/customizer-repeater/js/fontawesome-iconpicker.js', array( 'jquery' ), 999, true );
wp_enqueue_style( 'chromax_customizer-repeater-fontawesome-iconpicker-script', get_template_directory_uri() . '/inc/customizer/controls/code/customizer-repeater/css/fontawesome-iconpicker.min.css', array(), 999 );
}
public function render_content() {
/*Get default options*/
$this_default = json_decode( $this->setting->default );
/*Get values (json format)*/
$values = $this->value();
/*Decode values*/
$json = json_decode( $values );
if ( ! is_array( $json ) ) {
$json = array( $values );
} ?>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<div class="customizer-repeater-general-control-repeater customizer-repeater-general-control-droppable">
<?php
if ( ( count( $json ) == 1 && '' === $json[0] ) || empty( $json ) ) {
if ( ! empty( $this_default ) ) {
$this->iterate_array( $this_default ); ?>
<input type="hidden"
id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?>
class="customizer-repeater-colector"
value="<?php echo esc_textarea( json_encode( $this_default ) ); ?>"/>
<?php
} else {
$this->iterate_array(); ?>
<input type="hidden"
id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?>
class="customizer-repeater-colector"/>
<?php
}
} else {
$this->iterate_array( $json ); ?>
<input type="hidden" id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?>
class="customizer-repeater-colector" value="<?php echo esc_textarea( $this->value() ); ?>"/>
<?php
} ?>
</div>
<button type="button" class="button add_field customizer-repeater-new-field">
<?php echo esc_html( $this->add_field_label ); ?>
</button>
<?php
}
private function iterate_array($array = array()){
/*Counter that helps checking if the box is first and should have the delete button disabled*/
$it = 0;
if(!empty($array)){
$exist_service=count($array);
$chromax_del_btn_id=$this->boxtitle;
global $chromax_limit;
global $chromax_type_with_id;
echo sprintf("<input type='hidden' value='$exist_service' id='exist_chromax_$chromax_del_btn_id'/>");
foreach($array as $icon){
if($it<4)
{
$chromax_limit="chromax_limit";
$chromax_type_with_id='';
}
else
{
$chromax_limit="chromax_overlimit";
$chromax_type_with_id=$chromax_del_btn_id."_".$it;
}
?>
<div class="customizer-repeater-general-control-repeater-container customizer-repeater-draggable">
<div class="customizer-repeater-customize-control-title">
<?php echo esc_html( $this->boxtitle ) ?>
</div>
<div class="customizer-repeater-box-content-hidden">
<?php
$choice = $image_url = $image_url2 = $icon_value = $title = $subtitle = $subtitle2 = $subtitle3 = $subtitle4 = $subtitle5 = $text = $text2 = $link2 = $link3 = $button_second = $link = $designation = $slide_align = $bg_type = $button = $open_new_tab = $shortcode = $repeater = $color = $video_url = '';
if(!empty($icon->id)){
$id = $icon->id;
}
if(!empty($icon->choice)){
$choice = $icon->choice;
}
if(!empty($icon->image_url)){
$image_url = $icon->image_url;
}
if(!empty($icon->image_url2)){
$image_url2 = $icon->image_url2;
}
if(!empty($icon->icon_value)){
$icon_value = $icon->icon_value;
}
if(!empty($icon->color)){
$color = $icon->color;
}
if(!empty($icon->title)){
$title = $icon->title;
}
if(!empty($icon->slide_align)){
$slide_align = $icon->slide_align;
}
if(!empty($icon->bg_type)){
$bg_type = $icon->bg_type;
}
if(!empty($icon->designation)){
$designation = $icon->designation;
}
if(!empty($icon->subtitle)){
$subtitle = $icon->subtitle;
}
if(!empty($icon->subtitle2)){
$subtitle2 = $icon->subtitle2;
}
if(!empty($icon->subtitle3)){
$subtitle3 = $icon->subtitle3;
}
if(!empty($icon->subtitle4)){
$subtitle4 = $icon->subtitle4;
}
if(!empty($icon->subtitle5)){
$subtitle5 = $icon->subtitle5;
}
if(!empty($icon->text)){
$text = $icon->text;
}
if(!empty($icon->text2)){
$text2 = $icon->text2;
}
if(!empty($icon->button_second)){
$button_second = $icon->button_second;
}
if(!empty($icon->link2)){
$link2 = $icon->link2;
}
if(!empty($icon->link3)){
$link3 = $icon->link3;
}
if(!empty($icon->video_url)){
$video_url = $icon->video_url;
}
if(!empty($icon->button)){
$button = $icon->button_text;
}
if(!empty($icon->link)){
$link = $icon->link;
}
if(!empty($icon->shortcode)){
$shortcode = $icon->shortcode;
}
if(!empty($icon->social_repeater)){
$repeater = $icon->social_repeater;
}
if(!empty($icon->open_new_tab)){
$open_new_tab = $icon->open_new_tab;
}
if($this->customizer_repeater_bg_type == true){
$this->bg_type($bg_type);
}
if($this->customizer_repeater_title_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Title','chromax' ), $this->id, 'customizer_repeater_title_control' ),
'class' => 'customizer-repeater-title-control '."$chromax_limit".' '."$chromax_type_with_id".'',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ),
), $title);
}
if($this->customizer_repeater_subtitle_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Subtitle','chromax' ), $this->id, 'customizer_repeater_subtitle_control' ),
'class' => 'customizer-repeater-subtitle-control '."$chromax_limit".' '."$chromax_type_with_id".'',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle_control' ),
), $subtitle);
}
if($this->customizer_repeater_subtitle2_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Subtitle 2','chromax' ), $this->id, 'customizer_repeater_subtitle2_control' ),
'class' => 'customizer-repeater-subtitle2-control '."$chromax_limit".' '."$chromax_type_with_id".'',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle2_control' ),
), $subtitle2);
}
if($this->customizer_repeater_subtitle3_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Subtitle 3','chromax' ), $this->id, 'customizer_repeater_subtitle3_control' ),
'class' => 'customizer-repeater-subtitle3-control '."$chromax_limit".' '."$chromax_type_with_id".'',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle3_control' ),
), $subtitle3);
}
if($this->customizer_repeater_subtitle4_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Subtitle 4','chromax' ), $this->id, 'customizer_repeater_subtitle4_control' ),
'class' => 'customizer-repeater-subtitle4-control '."$chromax_limit".' '."$chromax_type_with_id".'',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle4_control' ),
), $subtitle4);
}
if($this->customizer_repeater_subtitle5_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Subtitle 5','chromax' ), $this->id, 'customizer_repeater_subtitle5_control' ),
'class' => 'customizer-repeater-subtitle5-control '."$chromax_limit".' '."$chromax_type_with_id".'',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle5_control' ),
), $subtitle5);
}
if($this->customizer_repeater_text_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Description','chromax' ), $this->id, 'customizer_repeater_text_control' ),
'class' => 'customizer-repeater-text-control '."$chromax_limit".' '."$chromax_type_with_id".'',
'type' => apply_filters('chromax_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ),
), $text);
}
if($this->customizer_repeater_text2_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Button Label','chromax' ), $this->id, 'customizer_repeater_text2_control' ),
'class' => 'customizer-repeater-text2-control '."$chromax_limit".'',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_text2_control' ),
), $text2);
}
if($this->customizer_repeater_button2_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Button Label second','chromax' ), $this->id, 'customizer_repeater_button2_control' ),
'class' => 'customizer-repeater-button2-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_button2_control' ),
), $button_second);
}
if($this->customizer_repeater_button_text_control){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__('Button Text',
'chromax'), $this->id, 'customizer_repeater_button_text_control'),
'class' => 'customizer-repeater-button-text-control '."$chromax_limit".'',
'type' => apply_filters('chromax_repeater_input_types_filter', '' , $this->id,
'customizer_repeater_button_text_control'),
), $button);
}
if($this->customizer_repeater_link_control){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Link','chromax' ), $this->id, 'customizer_repeater_link_control' ),
'class' => 'customizer-repeater-link-control '."$chromax_limit".' '."$chromax_type_with_id".'',
'sanitize_callback' => 'esc_url_raw',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link_control' ),
), $link);
}
if($this->customizer_repeater_link2_control){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'link','chromax' ), $this->id, 'customizer_repeater_link2_control' ),
'class' => 'customizer-repeater-link2-control '."$chromax_limit".' '."$chromax_type_with_id".'',
//'sanitize_callback' => 'esc_url_raw',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link2_control' ),
), $link2);
}
if($this->customizer_repeater_link3_control){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'link 3','chromax' ), $this->id, 'customizer_repeater_link3_control' ),
'class' => 'customizer-repeater-link3-control '."$chromax_limit".' '."$chromax_type_with_id".'',
//'sanitize_callback' => 'esc_url_raw',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link3_control' ),
), $link3);
}
if($this->customizer_repeater_checkbox_control == true){
$this->testimonila_check($open_new_tab);
}
if($this->customizer_repeater_video_url_control){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__('Video Url',
'chromax'), $this->id, 'customizer_repeater_video_url_control'),
'class' => 'customizer-repeater-video-url-control',
'type' => apply_filters('chromax_customizer_repeater_video_url_control', 'textarea', $this->id, 'customizer_repeater_video_url_control' ),
), $video_url);
}
if($this->customizer_repeater_slide_align == true){
$this->slide_align($slide_align);
}
if($this->customizer_repeater_image_control == true && $this->customizer_repeater_icon_control == true) {
$this->icon_type_choice( $choice,$chromax_limit );
}
if($this->customizer_repeater_image_control == true){
$this->image_control($image_url, $choice, $chromax_limit, $it+1, $chromax_del_btn_id);
}
if($this->customizer_repeater_image2_control == true){
$this->image_control2($image_url2, $choice, $chromax_limit, $it+1, $chromax_del_btn_id);
}
if($this->customizer_repeater_icon_control == true){
$this->icon_picker_control($icon_value, $choice);
}
if($this->customizer_repeater_color_control == true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Color','chromax' ), $this->id, 'customizer_repeater_color_control' ),
'class' => 'customizer-repeater-color-control',
'type' => apply_filters('chromax_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color_control' ),
'sanitize_callback' => 'sanitize_hex_color'
), $color);
}
if($this->customizer_repeater_shortcode_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Shortcode','chromax' ), $this->id, 'customizer_repeater_shortcode_control' ),
'class' => 'customizer-repeater-shortcode-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ),
), $shortcode);
}
if($this->customizer_repeater_designation_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Designation','chromax' ), $this->id, 'customizer_repeater_designation_control' ),
'class' => 'customizer-repeater-designation-control',
'type' => apply_filters('chromax_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_designation_control' ),
), $designation);
}
if($this->customizer_repeater_repeater_control==true){
$this->repeater_control($repeater, $chromax_limit, $chromax_type_with_id);
} ?>
<input type="hidden" class="social-repeater-box-id" value="<?php if ( ! empty( $id ) ) {
echo esc_attr( $id );
} ?>">
<button type="button" class="social-repeater-general-control-remove-field" <?php if ( $it == 0 ) {
echo esc_attr('style="display:none;"');
} ?>>
<?php printf( __( 'Delete %s', 'chromax' ), $this->boxtitle ); ?>
</button>
</div>
</div>
<?php
$it++;
}
} else { ?>
<div class="customizer-repeater-general-control-repeater-container">
<div class="customizer-repeater-customize-control-title">
<?php echo esc_html( $this->boxtitle ) ?>
</div>
<div class="customizer-repeater-box-content-hidden">
<?php
if ( $this->customizer_repeater_image_control == true && $this->customizer_repeater_icon_control == true ) {
$this->icon_type_choice();
}
if ( $this->customizer_repeater_image_control == true ) {
$this->image_control();
}
if ( $this->customizer_repeater_image2_control == true ) {
$this->image_control2();
}
if ( $this->customizer_repeater_icon_control == true ) {
$this->icon_picker_control();
}
if($this->customizer_repeater_bg_type == true){
$this->bg_type($bg_type);
}
if($this->customizer_repeater_color_control==true){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Color','chromax' ), $this->id, 'customizer_repeater_color_control' ),
'class' => 'customizer-repeater-color-control',
'type' => apply_filters('chromax_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color_control' ),
'sanitize_callback' => 'sanitize_hex_color'
) );
}
if ( $this->customizer_repeater_title_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Title','chromax' ), $this->id, 'customizer_repeater_title_control' ),
'class' => 'customizer-repeater-title-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ),
) );
}
if ( $this->customizer_repeater_subtitle_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Subtitle','chromax' ), $this->id, 'customizer_repeater_subtitle_control' ),
'class' => 'customizer-repeater-subtitle-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle_control' ),
) );
}
if ( $this->customizer_repeater_subtitle2_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Subtitle 2','chromax' ), $this->id, 'customizer_repeater_subtitle2_control' ),
'class' => 'customizer-repeater-subtitle2-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle2_control' ),
) );
}
if ( $this->customizer_repeater_subtitle3_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Subtitle 3','chromax' ), $this->id, 'customizer_repeater_subtitle3_control' ),
'class' => 'customizer-repeater-subtitle3-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle3_control' ),
) );
}
if ( $this->customizer_repeater_subtitle4_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Subtitle 4','chromax' ), $this->id, 'customizer_repeater_subtitle4_control' ),
'class' => 'customizer-repeater-subtitle4-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle4_control' ),
) );
}
if ( $this->customizer_repeater_subtitle5_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Subtitle 5','chromax' ), $this->id, 'customizer_repeater_subtitle5_control' ),
'class' => 'customizer-repeater-subtitle5-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle5_control' ),
) );
}
if ( $this->customizer_repeater_text_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Description','chromax' ), $this->id, 'customizer_repeater_text_control' ),
'class' => 'customizer-repeater-text-control',
'type' => apply_filters('chromax_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ),
) );
}
if ( $this->customizer_repeater_text2_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Button Label','chromax' ), $this->id, 'customizer_repeater_text2_control' ),
'class' => 'customizer-repeater-text2-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_text2_control' ),
) );
}
if ( $this->customizer_repeater_button2_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Button Label Second','chromax' ), $this->id, 'customizer_repeater_button2_control' ),
'class' => 'customizer-repeater-button2-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_button2_control' ),
) );
}
if ( $this->customizer_repeater_link2_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'link','chromax' ), $this->id, 'customizer_repeater_link2_control' ),
'class' => 'customizer-repeater-link2-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link2_control' ),
) );
}
if ( $this->customizer_repeater_link3_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'link 3','chromax' ), $this->id, 'customizer_repeater_link3_control' ),
'class' => 'customizer-repeater-link3-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link3_control' ),
) );
}
if($this->customizer_repeater_button_text_control){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__('Button Text',
'chromax'), $this->id, 'customizer_repeater_button_text_control'),
'class' => 'customizer-repeater-button-text-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '' , $this->id,
'customizer_repeater_button_text_control'),
));
}
if ( $this->customizer_repeater_link_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Link','chromax' ), $this->id, 'customizer_repeater_link_control' ),
'class' => 'customizer-repeater-link-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link_control' ),
) );
}
if($this->customizer_repeater_checkbox_control == true){
$this->testimonila_check();
}
if($this->customizer_repeater_video_url_control){
$this->input_control(array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__('Video Url',
'chromax'), $this->id, 'customizer_repeater_video_url_control'),
'class' => 'customizer-repeater-video-url-control',
'type' => apply_filters('chromax_customizer_repeater_video_url_control', 'textarea', $this->id, 'customizer_repeater_video_url_control' ),
));
}
if($this->customizer_repeater_slide_align == true){
$this->slide_align($slide_align);
}
if ( $this->customizer_repeater_shortcode_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Shortcode','chromax' ), $this->id, 'customizer_repeater_shortcode_control' ),
'class' => 'customizer-repeater-shortcode-control',
'type' => apply_filters('chromax_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ),
) );
}
if ( $this->customizer_repeater_designation_control == true ) {
$this->input_control( array(
'label' => apply_filters('chromax_repeater_input_labels_filter', esc_html__( 'Designation','chromax' ), $this->id, 'customizer_repeater_designation_control' ),
'class' => 'customizer-repeater-designation-control',
'type' => apply_filters('chromax_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_designation_control' ),
) );
}
if($this->customizer_repeater_repeater_control==true){
$this->repeater_control();
} ?>
<input type="hidden" class="social-repeater-box-id">
<button type="button" class="social-repeater-general-control-remove-field button" style="display:none;">
<?php esc_html_e( 'Delete field', 'chromax' ); ?>
</button>
</div>
</div>
<?php
}
}
private function input_control( $options, $value='' ){
//print_r($options);
?>
<span class="customize-control-title <?php echo esc_html( $options['label'] ); ?>"
<?php if($options['class']== 'customizer-repeater-video-url-control') {echo esc_attr('style="display:none;"'); }?>
><?php echo esc_html( $options['label'] ); ?></span>
<?php
if( !empty($options['type']) ){
switch ($options['type']) {
case 'textarea':?>
<textarea class="<?php echo esc_attr( $options['class'] ); ?>" placeholder="<?php echo esc_attr( $options['label'] ); ?>"><?php echo ( !empty($options['sanitize_callback']) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr($value) ); ?></textarea>
<?php
break;
case 'color': ?>
<input type="text" value="<?php echo ( !empty($options['sanitize_callback']) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr($value) ); ?>" class="<?php echo esc_attr($options['class']); ?>" />
<?php
break;
}
} else { ?>
<input type="text" value="<?php echo ( !empty($options['sanitize_callback']) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr($value) ); ?>" class="<?php echo esc_attr($options['class']); ?>" placeholder="<?php echo esc_attr( $options['label'] ); ?>"/>
<?php
}
}
private function testimonila_check($value='no', $class='', $chromax_type_with_id=''){
?>
<div class="customize-control-title">
<?php esc_html_e('Open link in new tab:','chromax'); ?>
<span class="switch">
<input type="checkbox" name="custom_checkbox" value="yes" <?php if($value=='yes'){echo esc_attr('checked');}?> class="customizer-repeater-checkbox <?php echo esc_attr($class);?> <?php echo esc_attr($chromax_type_with_id);?>">
</span>
</div>
<?php
}
private function icon_picker_control($value = '', $show = '', $class=''){ ?>
<div class="social-repeater-general-control-icon" <?php if( $show === 'customizer_repeater_image' || $show === 'customizer_repeater_none' ) { echo esc_attr('style="display:none;"'); } ?>>
<span class="customize-control-title">
<?php esc_html_e('Icon','chromax'); ?>
</span>
<span class="description customize-control-description">
<?php
echo sprintf(
esc_html__( 'Note: Some icons may not be displayed here. You can see the full list of icons at %1$s.', 'chromax' ),
sprintf( '<a href="http://fontawesome.io/icons/" rel="nofollow">%s</a>', esc_html__( 'http://fontawesome.io/icons/', 'chromax' ) )
); ?>
</span>
<div class="input-group icp-container">
<input data-placement="bottomRight" class="icp icp-auto" value="<?php if(!empty($value)) { echo esc_attr( $value );} ?>" type="text">
<span class="input-group-addon">
<i class="<?php echo esc_attr($value); ?>"></i>
</span>
</div>
<?php get_template_part( $this->customizer_icon_container ); ?>
</div>
<?php
}
private function image_control($value = '', $show = '', $class='', $auto='', $sections=''){
if($auto==1)
{
$auto="one";
}
if($auto==2)
{
$auto="two";
}
if($auto==3)
{
$auto="three";
}
if($auto==4)
{
$auto="four";
}
?>
<div class="customizer-repeater-image-control" <?php if( $show === 'customizer_repeater_icon' || $show === 'customizer_repeater_none' ) { echo esc_attr('style="display:none;"'); } ?>>
<span class="customize-control-title">
<?php esc_html_e('Image','chromax')?>
</span>
<input type="text" class="widefat custom-media-url <?php if($class="chromax_overlimit") { echo esc_attr('chromax-uploading-img');}?> <?php echo esc_attr($auto);?>" value="<?php echo esc_attr( $value ); ?>">
<input type="button" class="button button-secondary customizer-repeater-custom-media-button <?php if($class="chromax_overlimit") { echo esc_attr('chromax-uploading-img-btn');}?> <?php echo esc_attr($auto);?>" value="<?php esc_attr_e( 'Upload Image','chromax' ); ?>" />
</div>
<?php
}
private function image_control2($value = '', $show = '', $class='', $auto='', $sections=''){
if($auto==1)
{
$auto="one";
}
if($auto==2)
{
$auto="two";
}
if($auto==3)
{
$auto="three";
}
if($auto==4)
{
$auto="four";
}
?>
<div class="customizer-repeater-image2-control">
<span class="customize-control-title">
<?php esc_html_e('Image 2','chromax')?>
</span>
<input type="text" class="widefat custom-media-url2 <?php if($class="chromax_overlimit") { echo esc_attr('chromax-uploading-img');}?> <?php echo esc_attr($auto);?>" value="<?php echo esc_attr( $value ); ?>">
<input type="button" class="button button-secondary customizer-repeater-custom-media-button <?php if($class="chromax_overlimit") { echo esc_attr('chromax-uploading-img-btn');}?> <?php echo esc_attr($auto);?>" value="<?php esc_attr_e( 'Upload Image','chromax' ); ?>" />
</div>
<?php
}
private function slide_align($value='left'){?>
<span class="customize-control-title">
<?php esc_html_e('Slide Align','chromax'); ?>
</span>
<select class="customizer-repeater-slide-align">
<option value="left" <?php selected($value,'left');?>>
<?php esc_html_e('Left','chromax') ?>
</option>
<option value="right" <?php selected($value,'right');?>>
<?php esc_html_e('Right','chromax') ?>
</option>
<option value="center" <?php selected($value,'center');?>>
<?php esc_html_e('Center','chromax') ?>
</option>
</select>
<?php
}
private function bg_type($value='image'){?>
<span class="customize-control-title">
<?php esc_html_e('Background Type','chromax'); ?>
</span>
<select class="customizer-repeater-bg-type">
<option value="image" <?php selected($value,'image');?>>
<?php esc_html_e('Image','chromax') ?>
</option>
<option value="video" <?php selected($value,'video');?>>
<?php esc_html_e('Video','chromax') ?>
</option>
</select>
<?php
}
private function icon_type_choice($value='customizer_repeater_icon', $chromax_limit=''){ ?>
<span class="customize-control-title">
<?php esc_html_e('Image type','chromax');?>
</span>
<select class="customizer-repeater-image-choice <?php echo esc_attr($chromax_limit);?>">
<option value="customizer_repeater_icon" <?php selected($value,'customizer_repeater_icon');?>><?php esc_html_e('Icon','chromax'); ?></option>
<option value="customizer_repeater_image" <?php selected($value,'customizer_repeater_image');?>><?php esc_html_e('Image','chromax'); ?></option>
<option value="customizer_repeater_none" <?php selected($value,'customizer_repeater_none');?>><?php esc_html_e('None','chromax'); ?></option>
</select>
<?php
}
private function repeater_control($value = '', $chromax_limit='', $chromax_type_with_id=''){
$social_repeater = array();
$show_del = 0; ?>
<span class="customize-control-title"><?php esc_html_e( 'Social icons', 'chromax' ); ?></span>
<?php
if(!empty($value)) {
$social_repeater = json_decode( html_entity_decode( $value ), true );
}
if ( ( count( $social_repeater ) == 1 && '' === $social_repeater[0] ) || empty( $social_repeater ) ) { ?>
<div class="customizer-repeater-social-repeater">
<div class="customizer-repeater-social-repeater-container">
<div class="customizer-repeater-rc input-group icp-container">
<input data-placement="bottomRight" class="icp icp-auto" value="<?php if(!empty($value)) { echo esc_attr( $value ); } ?>" type="text">
<span class="input-group-addon"></span>
</div>
<?php get_template_part( $this->customizer_icon_container ); ?>
<input type="text" class="customizer-repeater-social-repeater-link team_linkdata_<?php echo $chromax_limit;?> <?php echo esc_attr($chromax_type_with_id);?>"
placeholder="<?php esc_attr_e( 'Link', 'chromax' ); ?>">
<input type="hidden" class="customizer-repeater-social-repeater-id" value="">
<button class="social-repeater-remove-social-item" style="display:none">
<?php esc_html_e( 'Remove Icon', 'chromax' ); ?>
</button>
</div>
<input type="hidden" id="social-repeater-socials-repeater-colector" class="social-repeater-socials-repeater-colector" value=""/>
</div>
<button class="social-repeater-add-social-item button-secondary "><?php esc_html_e( 'Add Icon', 'chromax' ); ?></button>
<?php
} else { ?>
<div class="customizer-repeater-social-repeater">
<?php
foreach ( $social_repeater as $social_icon ) {
$show_del ++; ?>
<div class="customizer-repeater-social-repeater-container">
<div class="customizer-repeater-rc input-group icp-container">
<input data-placement="bottomRight" class="icp icp-auto team_data_<?php echo esc_attr($chromax_limit);?> <?php echo esc_attr($chromax_type_with_id);?>" value="<?php if( !empty($social_icon['icon']) ) { echo esc_attr( $social_icon['icon'] ); } ?>" type="text">
<span class="input-group-addon"><i class="<?php echo esc_attr( $social_icon['icon'] ); ?>"></i></span>
</div>
<?php get_template_part( $this->customizer_icon_container ); ?>
<input type="text" class="customizer-repeater-social-repeater-link"
placeholder="<?php esc_attr_e( 'Link', 'chromax' ); ?>"
value="<?php if ( ! empty( $social_icon['link'] ) ) {
echo esc_url( $social_icon['link'] );
} ?>">
<input type="hidden" class="customizer-repeater-social-repeater-id"
value="<?php if ( ! empty( $social_icon['id'] ) ) {
echo esc_attr( $social_icon['id'] );
} ?>">
<button class="social-repeater-remove-social-item"
style="<?php if ( $show_del == 1 ) {
echo esc_attr("display:none");
} ?>"><?php esc_html_e( 'Remove Icon', 'chromax' ); ?></button>
</div>
<?php
} ?>
<input type="hidden" id="social-repeater-socials-repeater-colector"
class="social-repeater-socials-repeater-colector"
value="<?php echo esc_textarea( html_entity_decode( $value ) ); ?>" />
</div>
<button class="social-repeater-add-social-item button-secondary <?php echo esc_attr($chromax_limit);?> <?php echo esc_attr($chromax_type_with_id);?>"><?php esc_html_e( 'Add Icon', 'chromax' ); ?></button>
<?php
}
}
}

View File

@@ -0,0 +1,214 @@
.customizer-repeater-general-control-repeater-container .customizer-repeater-box-content-hidden:after {
content: "";
display: table;
clear: both;
}
.customizer-repeater-general-control-repeater-container .customizer-repeater-box-content-hidden {
display: none;
}
.customizer-repeater-customize-control-title {
margin: 0;
padding: 15px;
font-size: 1em;
line-height: 1;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
display: block;
font-weight: 600;
color: #23282d;
border: 1px solid #e5e5e5;
cursor: move;
}
.customizer-repeater-customize-control-title:hover {
border: 1px solid #999;
}
.customizer-repeater-customize-control-title:after {
content: "\f140";
font-family: dashicons;
font-size: 20px;
height: 13px;
bottom: 3px;
position: relative;
float: right;
}
.customizer-repeater-customize-control-title.repeater-expanded:after {
content: "\f142";
}
.customizer-repeater-box-content-hidden {
border: 1px solid #e5e5e5;
border-top: none;
padding: 1px 10px 10px;
}
.customizer-repeater-box-content-hidden > div {
margin: 1em 0;
}
.customizer-repeater-box-content-hidden .customize-control-title {
font-size: 13px;
line-height: 1.5;
font-weight: normal;
margin-bottom: 0;
margin-top: 1em;
}
.customizer-repeater-box-content-hidden .customize-control-title:after {
content: ":";
}
.customizer-repeater-box-content-hidden span.description {
font-size: 12px;
font-style: normal;
}
.customizer-repeater-general-control-repeater-container, .customizer-repeater-general-control-repeater_container {
border: 1px solid #e5e5e5;
border-top: none;
margin-bottom: 12px;
width: 100%;
float: left;
background: #fff;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}
.customizer-repeater-box-content-hidden .wp-picker-container, .customizer-repeater-box-content-hidden .wp-picker-container .wp-color-result, .icp-container {
margin: 0;
}
.customizer-repeater-box-content-hidden input:not(.icp, .wp-color-picker),
.customizer-repeater-box-content-hidden textarea,
.customizer-repeater-box-content-hidden .wp-picker-container {
margin-bottom: 1em !important;
}
.social-repeater-general-control-remove-field {
cursor: pointer;
color: #a00;
background: none;
border: none;
padding: 0;
margin-top: 10px;
}
.social-repeater-general-control-remove-field:hover {
color: red;
}
.customizer-repeater-box-content-hidden .wp-picker-holder {
position: relative;
left: -10px;
}
.customizer-repeater-box-content-hidden .wp-picker-input-wrap {
margin-left: 10px;
}
.customizer-repeater-box-content-hidden .wp-picker-container .iris-picker {
border-left: none;
border-right: none;
}
button.customizer-repeater-new-field {
float: right;
}
button.customizer-repeater-new-field:before {
content: "\f132";
display: inline-block;
position: relative;
left: -2px;
top: -1px;
font: 400 20px/1 dashicons;
vertical-align: middle;
-webkit-transition: all .2s;
transition: all .2s;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.customizer-repeater-box-content-hidden > div.customizer-repeater-social-repeater {
margin-top: 0;
}
.customizer-repeater-general-control-repeater-container .customizer-repeater-icon-control {
width: 100%;
margin: 0;
padding: 0;
}
#customizer-repeater-new-field {
width: 100%;
}
.customize-control-widget_form .widget-control-save {
display: block !important;
}
.customizer-repeater-box-content-hidden {
background-color: #fff;
}
.customizer-repeater-image-control .customizer-repeater-custom-media-button,
.customizer-repeater-image2-control .customizer-repeater-custom-media-button {
margin-top: 5px;
}
.customizer-icons {
display: inline-block;
padding: 0 10px 0 0;
vertical-align: middle;
}
.social-repeater-remove-social-item {
display: inline-block;
vertical-align: top;
color: #a00;
border: none;
background: none;
cursor: pointer;
padding: 0;
}
.social-repeater-remove-social-item:hover {
color: red;
}
.customizer-repeater-social-repeater > .customizer-repeater-social-repeater-container:not(:first-child) {
margin-top: 25px;
}
.icp-container {
margin-bottom: 10px;
}
.button-secondary.social-repeater-add-social-item:before {
content: "\f132";
display: inline-block;
position: relative;
left: -2px;
top: -1px;
font: 400 20px/1 dashicons;
vertical-align: middle;
-webkit-transition: all .2s;
transition: all .2s;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.button-secondary.social-repeater-add-social-item {
vertical-align: text-top;
float: right;
}
.customizer-repeater-box-content-hidden textarea {
width: 100%;
}

View File

@@ -0,0 +1,156 @@
.iconpicker .iconpicker-items,
.iconpicker .iconpicker-items:after,
.iconpicker-popover .popover-footer:after,
.iconpicker:after {
clear: both
}
.iconpicker-popover.popover {
position: absolute;
padding: 1px;
text-align: left;
background: #e5e5e5;
z-index: 999;
display: none;
margin-left: -10px;
width: 254px
}
.iconpicker,
.iconpicker-popover.popover.iconpicker-visible {
display: block
}
.iconpicker-popover.popover .popover-title {
padding: 5px;
font-size: 5px;
line-height: 16px;
border-bottom: 1px solid #ebebeb;
background-color: #e5e5e5
}
.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search {
margin: 0 0 2px
}
.iconpicker-popover.popover .popover-title-text~input[type=search].iconpicker-search {
margin-top: 14px
}
.iconpicker-popover.popover .popover-content {
padding: 0;
text-align: center
}
.iconpicker-popover.popover>.arrow,
.iconpicker-popover.popover>.arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid
}
.iconpicker *,
.icp-container {
position: relative
}
.iconpicker-popover.popover>.arrow {
border-width: 11px
}
.iconpicker-popover.popover>.arrow:after {
border-width: 10px;
content: ""
}
.iconpicker-popover.popover.bottomLeft>.arrow {
border-top-width: 0;
border-bottom-color: #e5e5e5;
top: -11px
}
.iconpicker-popover.popover.bottomLeft>.arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
border-top-width: 0;
border-bottom-color: #e5e5e5
}
.iconpicker-popover.popover.bottomLeft>.arrow {
left: 14px;
margin-left: 0
}
.iconpicker,
.iconpicker .iconpicker-items {
position: relative;
margin: 0;
overflow: hidden
}
.iconpicker {
text-align: left;
text-shadow: none;
line-height: 0
}
.iconpicker .iconpicker-items:after,
.iconpicker .iconpicker-items:before,
.iconpicker:after,
.iconpicker:before {
content: " ";
display: table
}
.iconpicker * {
box-sizing: content-box
}
.iconpicker .iconpicker-items {
float: none;
padding: 5px 0 0 5px;
background: #fff;
overflow-y: auto;
min-height: 55px;
max-height: 275px
}
.iconpicker .iconpicker-items i {
float: left;
width: 32px;
height: 32px;
line-height: 32px;
margin: 0 7px 7px 0;
text-align: center;
cursor: pointer;
border-radius: 3px;
font-size: 18px;
color: #444;
box-shadow: 0 0 0 1px #ddd;
transition: transform .2s ease
}
.iconpicker .iconpicker-items i:nth-child(6n) {
margin-right: 0
}
.iconpicker .iconpicker-items i:hover {
transform: scale(1.4);
color: #008ec2;
box-shadow: none
}
.icp {
padding-left: 30px
}
.icp-container .input-group-addon {
position: absolute;
top: 1px;
left: 5px;
padding: 3px
}

View File

@@ -0,0 +1 @@
.iconpicker .iconpicker-items,.iconpicker .iconpicker-items:after,.iconpicker-popover .popover-footer:after,.iconpicker:after{clear:both}.iconpicker-popover.popover{position:absolute;padding:1px;text-align:left;background:#e5e5e5;z-index:999;display:none;margin-left:-10px;width:254px}.iconpicker,.iconpicker-popover.popover.iconpicker-visible{display:block}.iconpicker-popover.popover .popover-title{padding:5px;font-size:5px;line-height:16px;border-bottom:1px solid #ebebeb;background-color:#e5e5e5}.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search{margin:0 0 2px}.iconpicker-popover.popover .popover-title-text~input[type=search].iconpicker-search{margin-top:14px}.iconpicker-popover.popover .popover-content{padding:0;text-align:center}.iconpicker-popover.popover>.arrow,.iconpicker-popover.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.iconpicker *,.icp-container{position:relative}.iconpicker-popover.popover>.arrow{border-width:11px}.iconpicker-popover.popover>.arrow:after{border-width:10px;content:""}.iconpicker-popover.popover.bottomLeft>.arrow{border-top-width:0;border-bottom-color:#e5e5e5;top:-11px}.iconpicker-popover.popover.bottomLeft>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#e5e5e5}.iconpicker-popover.popover.bottomLeft>.arrow{left:14px;margin-left:0}.iconpicker,.iconpicker .iconpicker-items{position:relative;margin:0;overflow:hidden}.iconpicker{text-align:left;text-shadow:none;line-height:0}.iconpicker .iconpicker-items:after,.iconpicker .iconpicker-items:before,.iconpicker:after,.iconpicker:before{content:" ";display:table}.iconpicker *{box-sizing:content-box}.iconpicker .iconpicker-items{float:none;padding:5px 0 0 5px;background:#fff;overflow-y:auto;min-height:55px;max-height:275px}.iconpicker .iconpicker-items i{float:left;width:32px;height:32px;line-height:32px;margin:0 7px 7px 0;text-align:center;cursor:pointer;border-radius:3px;font-size:18px;color:#444;box-shadow:0 0 0 1px #ddd;transition:transform .2s ease}.iconpicker .iconpicker-items i:nth-child(6n){margin-right:0}.iconpicker .iconpicker-items i:hover{transform:scale(1.4);color:#008ec2;box-shadow:none}.icp{padding-left:30px !important}.icp-container .input-group-addon{position:absolute;top:1px;left:5px;padding:3px}

View File

@@ -0,0 +1,34 @@
<?php
function chromax_repeater_register( $wp_customize ) {
require_once CHROMAX_THEME_INC_DIR . '/customizer/controls/code/customizer-repeater/class/customizer-repeater-control.php';
}
add_action( 'customize_register', 'chromax_repeater_register' );
function chromax_repeater_sanitize($input){
$input_decoded = json_decode($input,true);
if(!empty($input_decoded)) {
foreach ($input_decoded as $boxk => $box ){
foreach ($box as $key => $value){
switch ( $key ) {
case 'icon_value':
$input_decoded[$boxk][$key] = wp_kses_post( force_balance_tags( $value ) );
break;
case 'link':
$input_decoded[$boxk][$key] = esc_url_raw( $value );
break;
default:
$input_decoded[$boxk][$key] = wp_kses_post( force_balance_tags( $value ) );
}
}
}
return json_encode($input_decoded);
}
return $input;
}

View File

@@ -0,0 +1,89 @@
<div class="iconpicker-popover popover bottomLeft">
<div class="arrow"></div>
<div class="popover-title">
<input type="search" class="form-control iconpicker-search" placeholder="Type to filter">
</div>
<div class="popover-content">
<div class="iconpicker">
<div class="iconpicker-items">
<i data-type="iconpicker-item" title=".fa-behance" class="fab fa-behance" data-icon=""></i>
<i data-type="iconpicker-item" title=".fa-behance-square" class="fab fa-behance-square"></i>
<i data-type="iconpicker-item" title=".fa-facebook-f" class="fab fa-facebook-f"></i>
<i data-type="iconpicker-item" title=".fa-facebook-square" class="fab fa-facebook-square"></i>
<i data-type="iconpicker-item" title=".fa-google-plus-g" class="fab fa-google-plus-g"></i>
<i data-type="iconpicker-item" title=".fa-google-plus-square" class="fab fa-google-plus-square"></i>
<i data-type="iconpicker-item" title=".fa-linkedin-in" class="fab fa-linkedin-in"></i>
<i data-type="iconpicker-item" title=".fa-linkedin" class="fab fa-linkedin"></i>
<i data-type="iconpicker-item" title=".fa-twitter" class="fab fa-twitter"></i>
<i data-type="iconpicker-item" title=".fa-twitter-square" class="fab fa-twitter-square"></i>
<i data-type="iconpicker-item" title=".fa-vimeo-v" class="fab fa-vimeo-v"></i>
<i data-type="iconpicker-item" title=".fa-vimeo-square" class="fab fa-vimeo-square"></i>
<i data-type="iconpicker-item" title=".fa-youtube" class="fab fa-youtube"></i>
<i data-type="iconpicker-item" title=".fa-youtube-square" class="fab fa-youtube-square"></i>
<i data-type="iconpicker-item" title=".fa-ambulance" class="fas fa-ambulance"></i>
<i data-type="iconpicker-item" title=".fa-american-sign-language-interpreting" class="fas fa-american-sign-language-interpreting"></i>
<i data-type="iconpicker-item" title=".fa-anchor" class="fas fa-anchor"></i>
<i data-type="iconpicker-item" title=".fa-android" class="fab fa-android"></i>
<i data-type="iconpicker-item" title=".fa-apple" class="fab fa-apple"></i>
<i data-type="iconpicker-item" title=".fa-archive" class="fas fa-archive"></i>
<i data-type="iconpicker-item" title=".fa-chart-area" class="fas fa-chart-area"></i>
<i data-type="iconpicker-item" title=".fa-asterisk" class="fas fa-asterisk"></i>
<i data-type="iconpicker-item" title=".fa-car" class="fas fa-car"></i>
<i data-type="iconpicker-item" title=".fa-balance-scale" class="fas fa-balance-scale"></i>
<i data-type="iconpicker-item" title=".fa-ban" class="fas fa-ban"></i>
<i data-type="iconpicker-item" title=".fa-university" class="fas fa-university"></i>
<i data-type="iconpicker-item" title=".fa-bicycle" class="fas fa-bicycle"></i>
<i data-type="iconpicker-item" title=".fa-birthday-cake" class="fas fa-birthday-cake"></i>
<i data-type="iconpicker-item" title=".fa-btc" class="fab fa-btc"></i>
<i data-type="iconpicker-item" title=".fa-black-tie" class="fab fa-black-tie"></i>
<i data-type="iconpicker-item" title=".fa-bookmark" class="fas fa-bookmark"></i>
<i data-type="iconpicker-item" title=".fa-briefcase" class="fas fa-briefcase"></i>
<i data-type="iconpicker-item" title=".fa-bus" class="fas fa-bus"></i>
<i data-type="iconpicker-item" title=".fa-taxi" class="fas fa-taxi"></i>
<i data-type="iconpicker-item" title=".fa-camera" class="fas fa-camera"></i>
<i data-type="iconpicker-item" title=".fa-check" class="fas fa-check"></i>
<i data-type="iconpicker-item" title=".fa-child" class="fas fa-child"></i>
<i data-type="iconpicker-item" title=".fa-code" class="fas fa-code"></i>
<i data-type="iconpicker-item" title=".fa-coffee" class="fas fa-coffee"></i>
<i data-type="iconpicker-item" title=".fa-cog" class="fas fa-cog"></i>
<i data-type="iconpicker-item" title=".fa-comment-dots" class="fas fa-comment-dots"></i>
<i data-type="iconpicker-item" title=".fa-cube" class="fas fa-cube"></i>
<i data-type="iconpicker-item" title=".fa-dollar-sign" class="fas fa-dollar-sign"></i>
<i data-type="iconpicker-item" title=".fa-gem" class="far fa-gem"></i>
<i data-type="iconpicker-item" title=".fa-envelope" class="fas fa-envelope"></i>
<i data-type="iconpicker-item" title=".fa-female" class="fas fa-female"></i>
<i data-type="iconpicker-item" title=".fa-fire-extinguisher" class="fas fa-fire-extinguisher"></i>
<i data-type="iconpicker-item" title=".fa-glass-martini" class="fas fa-glass-martini"></i>
<i data-type="iconpicker-item" title=".fa-globe" class="fas fa-globe"></i>
<i data-type="iconpicker-item" title=".fa-graduation-cap" class="fas fa-graduation-cap"></i>
<i data-type="iconpicker-item" title=".fa-heartbeat" class="fas fa-heartbeat"></i>
<i data-type="iconpicker-item" title=".fa-heart" class="fas fa-heart"></i>
<i data-type="iconpicker-item" title=".fa-bed" class="fas fa-bed"></i>
<i data-type="iconpicker-item" title=".fa-hourglass" class="fas fa-hourglass"></i>
<i data-type="iconpicker-item" title=".fa-home" class="fas fa-home"></i>
<i data-type="iconpicker-item" title=".fa-gavel" class="fas fa-gavel"></i>
<i data-type="iconpicker-item" title=".fa-lock" class="fas fa-lock"></i>
<i data-type="iconpicker-item" title=".fa-map-signs" class="fas fa-map-signs"></i>
<i data-type="iconpicker-item" title=".fa-paint-brush" class="fas fa-paint-brush"></i>
<i data-type="iconpicker-item" title=".fa-plane" class="fas fa-plane"></i>
<i data-type="iconpicker-item" title=".fa-rocket" class="fas fa-rocket"></i>
<i data-type="iconpicker-item" title=".fa-puzzle-piece" class="fas fa-puzzle-piece"></i>
<i data-type="iconpicker-item" title=".fa-shield-alt" class="fas fa-shield-alt"></i>
<i data-type="iconpicker-item" title=".fa-tag" class="fas fa-tag"></i>
<i data-type="iconpicker-item" title=".fa-times" class="fas fa-times"></i>
<i data-type="iconpicker-item" title=".fa-unlock" class="fas fa-unlock"></i>
<i data-type="iconpicker-item" title=".fa-user" class="fas fa-user"></i>
<i data-type="iconpicker-item" title=".fa-user-md" class="fas fa-user-md"></i>
<i data-type="iconpicker-item" title=".fa-video" class="fas fa-video"></i>
<i data-type="iconpicker-item" title=".fa-wordpress" class="fab fa-wordpress"></i>
<i data-type="iconpicker-item" title=".fa-wrench" class="fas fa-wrench"></i>
<i data-type="iconpicker-item" title=".fa-chart-line" class="fas fa-chart-line"></i>
<i data-type="iconpicker-item" title=".fa-chart-area" class="fas fa-chart-area"></i>
<i data-type="iconpicker-item" title=".fa-signal" class="fas fa-signal"></i>
<i data-type="iconpicker-item" title=".fa-500px" class="fab fa-500px"></i>
</div> <!-- /.iconpicker-items -->
</div> <!-- /.iconpicker -->
</div> <!-- /.popover-content -->
</div> <!-- /.iconpicker-popover -->

View File

@@ -0,0 +1,614 @@
/* global jQuery */
/* global wp */
function chromax_media_upload(button_class) {
'use strict';
jQuery('body').on('click', button_class, function () {
var button_id = '#' + jQuery(this).attr('id');
var display_field = jQuery(this).parent().children('input:text');
var _custom_media = true;
wp.media.editor.send.attachment = function (props, attachment) {
if (_custom_media) {
if (typeof display_field !== 'undefined') {
switch (props.size) {
case 'full':
display_field.val(attachment.sizes.full.url);
display_field.trigger('change');
break;
case 'medium':
display_field.val(attachment.sizes.medium.url);
display_field.trigger('change');
break;
case 'thumbnail':
display_field.val(attachment.sizes.thumbnail.url);
display_field.trigger('change');
break;
default:
display_field.val(attachment.url);
display_field.trigger('change');
}
}
_custom_media = false;
} else {
return wp.media.editor.send.attachment(button_id, [props, attachment]);
}
};
wp.media.editor.open(button_class);
window.send_to_editor = function (html) {
};
return false;
});
}
/********************************************
*** Generate unique id ***
*********************************************/
function chromax_customizer_repeater_uniqid(prefix, more_entropy) {
'use strict';
if (typeof prefix === 'undefined') {
prefix = '';
}
var retId;
var php_js;
var formatSeed = function (seed, reqWidth) {
seed = parseInt(seed, 10)
.toString(16); // to hex str
if (reqWidth < seed.length) { // so long we split
return seed.slice(seed.length - reqWidth);
}
if (reqWidth > seed.length) { // so short we pad
return new Array(1 + (reqWidth - seed.length))
.join('0') + seed;
}
return seed;
};
// BEGIN REDUNDANT
if (!php_js) {
php_js = {};
}
// END REDUNDANT
if (!php_js.uniqidSeed) { // init seed with big random int
php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
}
php_js.uniqidSeed++;
retId = prefix; // start with prefix, add current milliseconds hex string
retId += formatSeed(parseInt(new Date()
.getTime() / 1000, 10), 8);
retId += formatSeed(php_js.uniqidSeed, 5); // add seed hex string
if (more_entropy) {
// for more entropy we add a float lower to 10
retId += (Math.random() * 10)
.toFixed(8)
.toString();
}
return retId;
}
/********************************************
*** General Repeater ***
*********************************************/
function chromax_customizer_repeater_refresh_social_icons(th) {
'use strict';
var icons_repeater_values = [];
th.find('.customizer-repeater-social-repeater-container').each(function () {
var icon = jQuery(this).find('.icp').val();
var link = jQuery(this).find('.customizer-repeater-social-repeater-link').val();
var id = jQuery(this).find('.customizer-repeater-social-repeater-id').val();
if (!id) {
id = 'customizer-repeater-social-repeater-' + chromax_customizer_repeater_uniqid();
jQuery(this).find('.customizer-repeater-social-repeater-id').val(id);
}
if (icon !== '' && link !== '') {
icons_repeater_values.push({
'icon': icon,
'link': link,
'id': id
});
}
});
th.find('.social-repeater-socials-repeater-colector').val(JSON.stringify(icons_repeater_values));
chromax_customizer_repeater_refresh_general_control_values();
}
function chromax_customizer_repeater_refresh_general_control_values() {
'use strict';
jQuery('.customizer-repeater-general-control-repeater').each(function () {
var values = [];
var th = jQuery(this);
th.find('.customizer-repeater-general-control-repeater-container').each(function () {
var icon_value = jQuery(this).find('.icp').val();
var text = jQuery(this).find('.customizer-repeater-text-control').val();
var link = jQuery(this).find('.customizer-repeater-link-control').val();
var text2 = jQuery(this).find('.customizer-repeater-text2-control').val();
var link2 = jQuery(this).find('.customizer-repeater-link2-control').val();
var link3 = jQuery(this).find('.customizer-repeater-link3-control').val();
var color = jQuery(this).find('input.customizer-repeater-color-control').val();
var color2 = jQuery(this).find('input.customizer-repeater-color2-control').val();
var image_url = jQuery(this).find('.custom-media-url').val();
var image_url2 = jQuery(this).find('.custom-media-url2').val();
var choice = jQuery(this).find('.customizer-repeater-image-choice').val();
var title = jQuery(this).find('.customizer-repeater-title-control').val();
var subtitle = jQuery(this).find('.customizer-repeater-subtitle-control').val();
var subtitle2 = jQuery(this).find('.customizer-repeater-subtitle2-control').val();
var subtitle3 = jQuery(this).find('.customizer-repeater-subtitle3-control').val();
var subtitle4 = jQuery(this).find('.customizer-repeater-subtitle4-control').val();
var subtitle5 = jQuery(this).find('.customizer-repeater-subtitle5-control').val();
var video_url = jQuery(this).find('.customizer-repeater-video-url-control').val();
var button_second = jQuery(this).find('.customizer-repeater-button2-control').val();
var slide_align = jQuery(this).find('.customizer-repeater-slide-align').val();
var bg_type = jQuery(this).find('.customizer-repeater-bg-type').val();
var open_new_tab = jQuery(this).find('.customizer-repeater-checkbox').attr("checked") ? 'yes' : 'no';
var id = jQuery(this).find('.social-repeater-box-id').val();
if (!id) {
id = 'social-repeater-' + chromax_customizer_repeater_uniqid();
jQuery(this).find('.social-repeater-box-id').val(id);
}
var social_repeater = jQuery(this).find('.social-repeater-socials-repeater-colector').val();
var shortcode = jQuery(this).find('.customizer-repeater-shortcode-control').val();
if (text !== '' || image_url !== '' || image_url2 !== '' || title !== '' || subtitle !== '' || icon_value !== '' || link !== '' || choice !== '' || social_repeater !== '' || shortcode !== '' || slide_align !== '' || bg_type !== '' || color !== '') {
values.push({
'icon_value': (choice === 'customizer_repeater_none' ? '' : icon_value),
'color': color,
'color2': color2,
'text': chromaxescapeHtml(text),
'link': link,
'text2': chromaxescapeHtml(text2),
'button_second': chromaxescapeHtml(button_second),
'link2': link2,
'link3': link3,
'image_url': (choice === 'customizer_repeater_none' ? '' : image_url),
'choice': choice,
'image_url2': image_url2,
'title': chromaxescapeHtml(title),
'subtitle': chromaxescapeHtml(subtitle),
'subtitle2': chromaxescapeHtml(subtitle2),
'subtitle3': chromaxescapeHtml(subtitle3),
'subtitle4': chromaxescapeHtml(subtitle4),
'subtitle5': chromaxescapeHtml(subtitle5),
'video_url': chromaxescapeHtml(video_url),
'slide_align': chromaxescapeHtml(slide_align),
'bg_type': chromaxescapeHtml(bg_type),
'open_new_tab' : open_new_tab,
'social_repeater': chromaxescapeHtml(social_repeater),
'id': id,
'shortcode': chromaxescapeHtml(shortcode)
});
}
});
th.find('.customizer-repeater-colector').val(JSON.stringify(values));
th.find('.customizer-repeater-colector').trigger('change');
});
}
jQuery(document).ready(function () {
'use strict';
var chromax_theme_controls = jQuery('#customize-theme-controls');
chromax_theme_controls.on('click', '.customizer-repeater-customize-control-title', function () {
jQuery(this).next().slideToggle('medium', function () {
if (jQuery(this).is(':visible')){
jQuery(this).prev().addClass('repeater-expanded');
jQuery(this).css('display', 'block');
} else {
jQuery(this).prev().removeClass('repeater-expanded');
}
});
});
chromax_theme_controls.on('change', '.icp',function(){
chromax_customizer_repeater_refresh_general_control_values();
return false;
});
chromax_theme_controls.on('change','.customizer-repeater-slide-align', function(){
chromax_customizer_repeater_refresh_general_control_values();
return false;
});
chromax_theme_controls.on('change','.customizer-repeater-bg-type', function(){
chromax_customizer_repeater_refresh_general_control_values();
return false;
});
chromax_theme_controls.on('change','.customizer-repeater-image2-control', function(){
chromax_customizer_repeater_refresh_general_control_values();
return false;
});
chromax_theme_controls.on('change', '.customizer-repeater-image-choice', function () {
if (jQuery(this).val() === 'customizer_repeater_image') {
jQuery(this).parent().parent().find('.social-repeater-general-control-icon').hide();
jQuery(this).parent().parent().find('.customizer-repeater-image-control').show();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').prev().prev().hide();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').hide();
}
if (jQuery(this).val() === 'customizer_repeater_icon') {
jQuery(this).parent().parent().find('.social-repeater-general-control-icon').show();
jQuery(this).parent().parent().find('.customizer-repeater-image-control').hide();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').prev().prev().show();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').show();
}
if (jQuery(this).val() === 'customizer_repeater_none') {
jQuery(this).parent().parent().find('.social-repeater-general-control-icon').hide();
jQuery(this).parent().parent().find('.customizer-repeater-image-control').hide();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').prev().prev().hide();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').hide();
}
chromax_customizer_repeater_refresh_general_control_values();
return false;
});
chromax_media_upload('.customizer-repeater-custom-media-button');
jQuery('.custom-media-url').on('change', function () {
chromax_customizer_repeater_refresh_general_control_values();
return false;
});
var color_options = {
change: function(event, ui){
chromax_customizer_repeater_refresh_general_control_values();
}
};
/**
* This adds a new box to repeater
*
*/
chromax_theme_controls.on('click', '.customizer-repeater-new-field', function () {
var th = jQuery(this).parent();
var id = 'customizer-repeater-' + chromax_customizer_repeater_uniqid();
var parentid = jQuery(this).parent().attr("id");
if(parentid == 'customize-control-chromax_hdr_social')
{
var totalItems = jQuery("#customize-control-chromax_hdr_social .customizer-repeater-general-control-repeater-container").length
if(totalItems >= 4){
jQuery( "#customize-control-chromax_social_option_upsale .desert-companion-upgrade-message" ).show();
return false;
}
}
if(parentid == 'customize-control-chromax_slider_option')
{
var totalItems = jQuery("#customize-control-chromax_slider_option .customizer-repeater-general-control-repeater-container").length
if(totalItems >= 3){
jQuery( "#customize-control-chromax_slider_option_upsale .desert-companion-upgrade-message" ).show();
return false;
}
}
if(parentid == 'customize-control-chromax_information_option')
{
var totalItems = jQuery("#customize-control-chromax_information_option .customizer-repeater-general-control-repeater-container").length
if(totalItems >= 4){
jQuery( "#customize-control-chromax_information_option_upsale .desert-companion-upgrade-message" ).show();
return false;
}
}
if(parentid == 'customize-control-chromax_service_option')
{
var totalItems = jQuery("#customize-control-chromax_service_option .customizer-repeater-general-control-repeater-container").length
if(totalItems >= 5){
jQuery( "#customize-control-chromax_service_option_upsale .desert-companion-upgrade-message" ).show();
return false;
}
}
if(parentid == 'customize-control-chromax_why_choose_right_option')
{
var totalItems = jQuery("#customize-control-chromax_why_choose_right_option .customizer-repeater-general-control-repeater-container").length
if(totalItems >= 4){
jQuery( "#customize-control-chromax_why_choose_right_option_upsale .desert-companion-upgrade-message" ).show();
return false;
}
}
if (typeof th !== 'undefined') {
/* Clone the first box*/
var field = th.find('.customizer-repeater-general-control-repeater-container:first').clone( true, true );
if (typeof field !== 'undefined') {
/*Set the default value for choice between image and icon to icon*/
field.find('.customizer-repeater-image-choice').val('customizer_repeater_icon');
/*Show icon selector*/
field.find('.social-repeater-general-control-icon').show();
/*Hide image selector*/
if (field.find('.social-repeater-general-control-icon').length > 0) {
field.find('.customizer-repeater-image-control').hide();
}
/*Show delete box button because it's not the first box*/
field.find('.social-repeater-general-control-remove-field').show();
/* Empty control for icon */
field.find('.input-group-addon').find('.fa').attr('class', 'fa');
/*Remove all repeater fields except first one*/
field.find('.customizer-repeater-social-repeater').find('.customizer-repeater-social-repeater-container').not(':first').remove();
field.find('.customizer-repeater-social-repeater-link').val('');
field.find('.social-repeater-socials-repeater-colector').val('');
/*Remove value from icon field*/
field.find('.icp').val('');
/*Remove value from text field*/
field.find('.customizer-repeater-text-control').val('');
/*Remove value from link field*/
field.find('.customizer-repeater-link-control').val('');
/*Remove value from text field*/
field.find('.customizer-repeater-text2-control').val('');
/*Remove value from button field*/
field.find('.customizer-repeater-button2-control').val('');
/*Remove value from link field*/
field.find('.customizer-repeater-link2-control').val('');
/*Remove value from link field*/
field.find('.customizer-repeater-link3-control').val('');
/*Set the default value in slide align*/
field.find('.customizer-repeater-slide-align').val('left');
/*Set the default value in slide align*/
field.find('.customizer-repeater-bg-type').val('left');
/*Set the default value in checkbox*/
field.find('.customizer-repeater-checkbox').val('');
/*Set box id*/
field.find('.social-repeater-box-id').val(id);
/*Remove value from media field*/
field.find('.custom-media-url').val('');
/*Remove value from title field*/
field.find('.customizer-repeater-title-control').val('');
/*Remove value from color field*/
field.find('div.customizer-repeater-color-control .wp-picker-container').replaceWith('<input type="text" class="customizer-repeater-color-control ' + id + '">');
field.find('input.customizer-repeater-color-control').wpColorPicker(color_options);
field.find('div.customizer-repeater-color2-control .wp-picker-container').replaceWith('<input type="text" class="customizer-repeater-color2-control ' + id + '">');
field.find('input.customizer-repeater-color2-control').wpColorPicker(color_options);
// field.find('.customize-control-notifications-container').remove();
/*Remove value from subtitle field*/
field.find('.customizer-repeater-subtitle-control').val('');
/*Remove value from subtitle field*/
field.find('.customizer-repeater-subtitle2-control').val('');
/*Remove value from subtitle field*/
field.find('.customizer-repeater-subtitle3-control').val('');
/*Remove value from subtitle field*/
field.find('.customizer-repeater-subtitle4-control').val('');
/*Remove value from subtitle field*/
field.find('.customizer-repeater-subtitle5-control').val('');
/*Remove value from subtitle field*/
field.find('.customizer-repeater-video-url-control').val('');
/*Remove value from shortcode field*/
field.find('.customizer-repeater-shortcode-control').val('');
/*Append new box*/
th.find('.customizer-repeater-general-control-repeater-container:first').parent().append(field);
/*Refresh values*/
chromax_customizer_repeater_refresh_general_control_values();
}
}
return false;
});
chromax_theme_controls.on('click', '.social-repeater-general-control-remove-field', function () {
var split_delete_button=jQuery(this).text();
var split_delete_button_split=split_delete_button.substr(8, 12);
if (typeof jQuery(this).parent() !== 'undefined') {
jQuery(this).parent().hide(500, function(){
jQuery(this).parent().remove();
chromax_customizer_repeater_refresh_general_control_values();
var chromax_hdr_social = jQuery("#customize-control-chromax_hdr_social .customizer-repeater-general-control-repeater-container").length
if(chromax_hdr_social < 4){
jQuery( "#customize-control-chromax_social_option_upsale .desert-companion-upgrade-message" ).hide();
}
var chromax_slider_option = jQuery("#customize-control-chromax_slider_option .customizer-repeater-general-control-repeater-container").length
if(chromax_slider_option < 3){
jQuery( "#customize-control-chromax_slider_option_upsale .desert-companion-upgrade-message" ).hide();
}
var chromax_information_option = jQuery("#customize-control-chromax_information_option .customizer-repeater-general-control-repeater-container").length
if(chromax_information_option < 4){
jQuery( "#customize-control-chromax_information_option_upsale .desert-companion-upgrade-message" ).hide();
}
var chromax_service_option = jQuery("#customize-control-chromax_service_option .customizer-repeater-general-control-repeater-container").length
if(chromax_service_option < 5){
jQuery( "#customize-control-chromax_service_option_upsale .desert-companion-upgrade-message" ).hide();
}
var chromax_why_choose_right_option = jQuery("#customize-control-chromax_why_choose_right_option .customizer-repeater-general-control-repeater-container").length
if(chromax_why_choose_right_option < 4){
jQuery( "#customize-control-chromax_why_choose_right_option_upsale .desert-companion-upgrade-message" ).hide();
}
});
}
return false;
});
chromax_theme_controls.on('keyup', '.customizer-repeater-title-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
jQuery('input.customizer-repeater-color-control').wpColorPicker(color_options);
jQuery('input.customizer-repeater-color2-control').wpColorPicker(color_options);
chromax_theme_controls.on('keyup', '.customizer-repeater-subtitle-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-subtitle2-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-subtitle3-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-subtitle4-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-subtitle5-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-video-url-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-shortcode-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-text-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-link-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-text2-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-button2-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-link2-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('keyup', '.customizer-repeater-link3-control', function () {
chromax_customizer_repeater_refresh_general_control_values();
});
chromax_theme_controls.on('change','.customizer-repeater-checkbox', function(){
chromax_customizer_repeater_refresh_general_control_values();
});
/*Drag and drop to change icons order*/
jQuery('.customizer-repeater-general-control-droppable').sortable({
axis: 'y',
update: function () {
chromax_customizer_repeater_refresh_general_control_values();
}
});
/*----------------- Socials Repeater ---------------------*/
chromax_theme_controls.on('click', '.social-repeater-add-social-item', function (event) {
event.preventDefault();
var th = jQuery(this).parent();
var id = 'customizer-repeater-social-repeater-' + chromax_customizer_repeater_uniqid();
if (typeof th !== 'undefined') {
var field = th.find('.customizer-repeater-social-repeater-container:first').clone( true, true );
if (typeof field !== 'undefined') {
field.find( '.icp' ).val('');
field.find( '.input-group-addon' ).find('.fa').attr('class','fa');
field.find('.social-repeater-remove-social-item').show();
field.find('.customizer-repeater-social-repeater-link').val('');
field.find('.customizer-repeater-social-repeater-id').val(id);
th.find('.customizer-repeater-social-repeater-container:first').parent().append(field);
}
}
return false;
});
chromax_theme_controls.on('click', '.social-repeater-remove-social-item', function (event) {
event.preventDefault();
var th = jQuery(this).parent();
var repeater = jQuery(this).parent().parent();
th.remove();
chromax_customizer_repeater_refresh_social_icons(repeater);
return false;
});
chromax_theme_controls.on('keyup', '.customizer-repeater-social-repeater-link', function (event) {
event.preventDefault();
var repeater = jQuery(this).parent().parent();
chromax_customizer_repeater_refresh_social_icons(repeater);
return false;
});
chromax_theme_controls.on('change', '.customizer-repeater-social-repeater-container .icp', function (event) {
event.preventDefault();
var repeater = jQuery(this).parent().parent().parent();
chromax_customizer_repeater_refresh_social_icons(repeater);
return false;
});
});
var chromaxentityMap = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
'\'': '&#39;',
'/': '&#x2F;'
};
function chromaxescapeHtml(string) {
'use strict';
//noinspection JSUnresolvedFunction
string = String(string).replace(new RegExp('\r?\n', 'g'), '<br />');
string = String(string).replace(/\\/g, '&#92;');
return String(string).replace(/[&<>"'\/]/g, function (s) {
return chromaxentityMap[s];
});
}

View File

@@ -0,0 +1,67 @@
(function ($) {
'use strict';
wp.chromaxcustomizerRepeater = {
init: function () {
$('.iconpicker-items>i').on('click', function () {
var iconClass = $(this).attr('class');
var classInput = $(this).parents('.iconpicker-popover').prev().find('.icp');
classInput.val(iconClass);
classInput.attr('value', iconClass);
var iconPreview = classInput.next('.input-group-addon');
var iconElement = '<i class="'.concat(iconClass, '"><\/i>');
iconPreview.empty();
iconPreview.append(iconElement);
var th = $(this).parent().parent().parent();
classInput.trigger('change');
chromax_customizer_repeater_refresh_social_icons(th);
return false;
});
},
search: function ($searchField) {
var itemsList = $searchField.parent().next().find('.iconpicker-items');
var searchTerm = $searchField.val().toLowerCase();
if (searchTerm.length > 0) {
itemsList.children().each(function () {
if ($(this).filter('[title*='.concat(searchTerm)).length > 0 || searchTerm.length < 1) {
$(this).show();
} else {
$(this).hide();
}
});
} else {
itemsList.children().show();
}
},
iconPickerToggle: function ($input) {
var iconPicker = $input.parent().next();
iconPicker.addClass('iconpicker-visible');
}
};
$(document).ready(function () {
wp.chromaxcustomizerRepeater.init();
$('.iconpicker-search').on('keyup', function () {
wp.chromaxcustomizerRepeater.search($(this));
});
$('.icp-auto').on('click', function () {
wp.chromaxcustomizerRepeater.iconPickerToggle($(this));
});
$(document).mouseup( function (e) {
var container = $('.iconpicker-popover');
if (!container.is(e.target)
&& container.has(e.target).length === 0)
{
container.removeClass('iconpicker-visible');
}
});
});
})(jQuery);

View File

@@ -0,0 +1 @@
!function(e){"use strict";wp.chromaxcustomizerRepeater={init:function(){e(".iconpicker-items>i").on("click",function(){var i=e(this).attr("class").slice(3),t=e(this).parents(".iconpicker-popover").prev().find(".icp");t.val(i),t.attr("value",i);var n=t.next(".input-group-addon"),c='<i class="fa '.concat(i,'"></i>');n.empty(),n.append(c);var r=e(this).parent().parent().parent();return t.trigger("change"),chromax_customizer_repeater_refresh_social_icons(r),!1})},search:function(i){var t=i.parent().next().find(".iconpicker-items"),n=i.val().toLowerCase();n.length>0?t.children().each(function(){e(this).filter("[title*=".concat(n)).length>0||n.length<1?e(this).show():e(this).hide()}):t.children().show()},iconPickerToggle:function(e){e.parent().next().addClass("iconpicker-visible")}},e(document).ready(function(){wp.chromaxcustomizerRepeater.init(),e(".iconpicker-search").on("keyup",function(){wp.chromaxcustomizerRepeater.search(e(this))}),e(".icp-auto").on("click",function(){wp.chromaxcustomizerRepeater.iconPickerToggle(e(this))}),e(document).mouseup(function(i){var t=e(".iconpicker-popover");t.is(i.target)||0!==t.has(i.target).length||t.removeClass("iconpicker-visible")})})}(jQuery);

View File

@@ -0,0 +1,81 @@
<?php
/**
* Page editor control
*
* @package chromax
* @since chromax 1.0
*/
if ( ! class_exists( 'WP_Customize_Control' ) ) {
return null;
}
/**
* Class to create a custom tags control
*/
class Chromax_Page_Editor extends WP_Customize_Control {
/**
* Flag to include sync scripts if needed
*
* @var bool|mixed
*/
private $needsync = false;
/**
* Chromax_Page_Editor constructor.
*
* @param WP_Customize_Manager $manager Manager.
* @param string $id Id.
* @param array $args Constructor args.
*/
public function __construct( $manager, $id, $args = array() ) {
parent::__construct( $manager, $id, $args );
if ( ! empty( $args['needsync'] ) ) {
$this->needsync = $args['needsync'];
}
}
/**
* Enqueue scripts
*
* @since 1.1.0
* @access public
* @updated Changed wp_enqueue_scripts order and dependencies.
*/
public function enqueue() {
wp_enqueue_style( 'chromax_text_editor_css', get_template_directory_uri() . '/inc/customizer/controls/code/editor/css/chromax-page-editor.css', array(),'chromax');
wp_enqueue_script(
'chromax_text_editor', get_template_directory_uri() . '/inc/customizer/controls/code/editor/js/chromax-text-editor.js', array(
'jquery',
'customize-preview',
),'chromax', true
);
if ( $this->needsync === true ) {
wp_enqueue_script( 'chromax_controls_script', get_template_directory_uri() . '/inc/customizer/controls/code/editor/js/chromax-update-controls.js', array( 'jquery', 'chromax_text_editor' ),'chromax', true );
wp_localize_script(
'chromax_controls_script', 'requestpost', array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'thumbnail_control' => 'chromax_feature_thumbnail', // name of image control that needs sync
'editor_control' => 'Chromax_Page_Editor', // name of control (theme_mod) that needs sync
'thumbnail_label' => esc_html__( 'About background', 'chromax' ), // name of thumbnail control
)
);
}
}
/**
* Render the content on the theme customizer page
*/
public function render_content() {
?>
<label>
<?php if ( ! empty( $this->label ) ) : ?>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<?php endif; ?>
<input type="hidden" <?php $this->link(); ?> value="<?php echo esc_textarea( $this->value() ); ?>" id="<?php echo esc_attr( $this->id ); ?>" class="editorfield">
<a onclick="javascript:WPEditorWidget.toggleEditor('<?php echo $this->id; ?>');" class="button edit-content-button"><?php _e( '(Edit)', 'chromax' ); ?></a>
</label>
<?php
}
}

View File

@@ -0,0 +1,98 @@
/*EDIT CONTENT CONTROL*/
.button.edit-content-button,.edit-content-button{display:inline-flex;align-items:center;line-height:1;margin-bottom: 10px;}
.edit-content-button:before{content: "\f464";opacity: 0.6;background-color: #ddd;padding: 8px;margin-left: -10px;margin-right: 7px;font-size: 18px;vertical-align: top;border-radius: 2px 0 0 2px;font-family: 'dashicons';}
/*--------------------------WIDGETS------------------------------------*/
#wp-editor-widget-container{position:fixed;left:0;right:0;bottom:0;z-index:9999999;background:#f1f1f1;border-top:1px solid #ddd;}
@media screen and (min-width: 800px){
#wp-editor-widget-container{
left:300px;
}
}
@media screen and (min-width: 1667px){
#wp-editor-widget-container{
left:18%;
}
}
#wp-editor-widget-container .close{position:absolute;top:17px;right:7px;width:30px;height:30px;z-index:1000; text-decoration: none; opacity:0.4; text-align: center;}
#wp-editor-widget-container .close{ opacity:0.7;}
#wp-editor-widget-container .icon:after{font: 400 22px/45px dashicons; content: "\f335";color: #888;text-decoration: none!important; line-height: 30px}
#wp-editor-widget-container .close:active{outline:0}
#wp-editor-widget-container .editor{margin:50px}
#available-widgets [class*=wp_editor_widget] .widget-title:before{content:"\f478"}
body.wp-customizer #wp-editor-widget-container{ bottom:-650px;}
body.wp-customizer #wp-editor-widget-container.editoron{ bottom:0;}
body.wp-customizer #wp-editor-widget-container .editor {margin: 10px; margin-top: 55px;}
body.widgets_access .widget-position table tr:nth-child(3) {display: none;}
.customize-control .icons-selector .selector-category select,
.customize-control .icons-selector .selector-search input[type=text] {
line-height: 13px;
height: 30px;
}
.customize-control .icons-selector,
.customize-control .icons-selector .selector {
width: 100%;
}
.customize-control .icons-selector .selector {
border: 1px solid #8c8f94;
border-radius: 3px;
height: 30px;
background-color: #fff;
}
.customize-control .icons-selector .selected-icon {
width: 70%;
}
.customize-control .icons-selector .selected-icon i {
line-height: 30px;
}
.customize-control .icons-selector .selector-button {
width: 28%;
border-left: 1px solid #8c8f94;
}
.customize-control .icons-selector .selector-button i {
line-height: 28px;
}
.customize-control .icons-selector .selector-popup {
padding: 12px;
border: 1px solid #ddd;
}
.customize-control .icons-selector .selector-arrows span,
.customize-control .icons-selector .fip-box,
.customize-control .icons-selector .selector-category select,
.customize-control .icons-selector .selector-search input[type=text] {
border: 1px solid #ddd;
}
.customize-control .icons-selector .selector-pages {
line-height: 14px;
}
.customize-control .icons-selector .selector-search i {
top: 5px;
}
.customize-control .icons-selector .selector-arrows span i {
width: auto;
height: auto;
line-height: 12px;
}
.customize-control .icons-selector .selector-arrows span:hover i,
.customize-control .icons-selector .fip-box:hover {
color: #0073aa;
}

View File

@@ -0,0 +1,184 @@
<?php
/**
* Sync functions for control.
*
* @package chromax
* @since chromax 1.0
*/
/**
* Display editor for page editor control.
*
* @since 1.0
*/
function chromax_customize_editor() {
?>
<div id="wp-editor-widget-container" style="display: none;">
<a class="close" href="javascript:WPEditorWidget.hideEditor();"><span class="icon"></span></a>
<div class="editor">
<?php
$settings = array(
'textarea_rows' => 55,
'editor_height' => 260,
);
wp_editor( '', 'wpeditorwidget', $settings );
?>
<p><a href="javascript:WPEditorWidget.updateWidgetAndCloseEditor(true);" class="button button-primary"><?php _e( 'Save and close', 'chromax' ); ?></a></p>
</div>
</div>
<?php
}
add_action( 'customize_controls_print_footer_scripts', 'chromax_customize_editor', 1 );
/**
* Sync frontpage content with customizer control
*
* @param string $value New value.
*
* @return mixed
*/
function chromax_sync_content_from_control( $value, $old_value = '' ) {
$frontpage_id = get_option( 'page_on_front' );
if ( ! empty( $frontpage_id ) && ! empty( $value ) ) {
if ( ! wp_is_post_revision( $frontpage_id ) ) {
// update the post, which calls save_post again
$post = array(
'ID' => $frontpage_id,
'post_content' => wp_kses_post( $value ),
);
wp_update_post( $post );
}
}
return $value;
}
add_filter( 'pre_set_theme_mod_chromax_page_editor', 'chromax_sync_content_from_control', 10,2 );
/**
* Sync page thumbnail and content with customizer control
*/
function chromax_sync_control_from_page() {
$need_update = get_option( 'chromax_sync_needed' );
if ( $need_update === false ) {
return;
}
$frontpage_id = get_option( 'page_on_front' );
if ( empty( $frontpage_id ) ) {
return;
}
$content = get_post_field( 'post_content', $frontpage_id );
set_theme_mod( 'Chromax_Page_Editor', $content );
$chromax_frontpage_featured = '';
if ( has_post_thumbnail( $frontpage_id ) ) {
$chromax_frontpage_featured = get_the_post_thumbnail_url( $frontpage_id );
}
set_theme_mod( 'chromax_feature_thumbnail', $chromax_frontpage_featured );
update_option( 'chromax_sync_needed', false );
}
add_action( 'after_setup_theme', 'chromax_sync_control_from_page' );
/**
* Set flag to sync customizer control from page.
*
* @param string $post_id Post id.
*/
function chromax_trigger_sync( $post_id ) {
if ( wp_is_post_revision( $post_id ) ) {
return;
}
$frontpage_id = get_option( 'page_on_front' );
if ( empty( $frontpage_id ) ) {
return;
}
if ( intval( $post_id ) === intval( $frontpage_id ) ) {
update_option( 'chromax_sync_needed' , true );
};
}
add_action( 'save_post', 'chromax_trigger_sync', 10 );
/**
* Sync frontpage thumbnail with customizer control
*
* @param string $value New value.
* @param string $old_value Old value.
*
* @return mixed
*/
function chromax_sync_thumbnail_from_control( $value, $old_value ) {
$frontpage_id = get_option( 'page_on_front' );
if ( ! empty( $frontpage_id ) ) {
$thumbnail_id = attachment_url_to_postid( $value );
update_post_meta( $frontpage_id, '_thumbnail_id', $thumbnail_id );
}
return $value;
}
add_filter( 'pre_set_theme_mod_chromax_feature_thumbnail', 'chromax_sync_thumbnail_from_control', 10, 2 );
/**
* Ajax call to sync page content and thumbnail when you switch to static frontpage
*/
function chromax_ajax_call() {
$pid = $_POST['pid'];
$return_value = array();
$content = get_post_field( 'post_content', $pid );
set_theme_mod( 'Chromax_Page_Editor', $content );
$chromax_frontpage_featured = '';
if ( has_post_thumbnail( $pid ) ) {
$chromax_frontpage_featured = get_the_post_thumbnail_url( $pid );
}
set_theme_mod( 'chromax_feature_thumbnail', $chromax_frontpage_featured );
$return_value['post_content'] = $content;
$return_value['post_thumbnail'] = $chromax_frontpage_featured;
echo json_encode( $return_value );
die();
}
add_action( 'wp_ajax_chromax_ajax_call', 'chromax_ajax_call' );
/**
* chromax allow all HTML tags in TinyMce editor.
*
* @param array $init_array TinyMce settings.
*
* @return array
*/
function chromax_override_mce_options( $init_array ) {
$opts = '*[*]';
$init_array['valid_elements'] = $opts;
$init_array['extended_valid_elements'] = $opts;
return $init_array;
}
add_filter( 'tiny_mce_before_init', 'chromax_override_mce_options' );
/**
* Filters for text format
*/
add_filter( 'chromax_text', 'wptexturize' );
add_filter( 'chromax_text', 'convert_smilies' );
add_filter( 'chromax_text', 'convert_chars' );
add_filter( 'chromax_text', 'wpautop' );
add_filter( 'chromax_text', 'shortcode_unautop' );
add_filter( 'chromax_text', 'do_shortcode' );

View File

@@ -0,0 +1,115 @@
/* global tinyMCE */
/* global wp */
/* exported WPEditorWidget */
var WPEditorWidget = {
/**
* @var string
*/
currentContentId: '',
/**
* @var int
*/
wpFullOverlayOriginalZIndex: 0,
/**
* @var bool
*/
isVisible: false,
/**
*
*/
toggleEditor: function(contentId){
if ( this.isVisible === true ) {
this.hideEditor();
} else {
this.showEditor(contentId);
}
},
/**
* Show the editor
* @param string contentId
*/
showEditor: function(contentId) {
this.isVisible = true;
var overlay = jQuery('.wp-full-overlay');
jQuery('body.wp-customizer #wp-editor-widget-container').fadeIn(100).animate({'bottom':'0'});
this.currentContentId = contentId;
this.wpFullOverlayOriginalZIndex = parseInt( overlay.css('zIndex') );
overlay.css({ zIndex: 49000 });
this.setEditorContent(contentId);
},
/**
* Hide editor
*/
hideEditor: function() {
this.isVisible = false;
jQuery('body.wp-customizer #wp-editor-widget-container').animate({'bottom':'-650px'}).fadeOut();
jQuery('.wp-full-overlay').css({ zIndex: this.wpFullOverlayOriginalZIndex });
},
/**
* Set editor content
*/
setEditorContent: function(contentId) {
var editor = tinyMCE.EditorManager.get('wpeditorwidget');
var content = jQuery('#'+ contentId).val();
if (typeof editor === 'object' && editor !== null) {
editor.setContent(content);
}
jQuery('#wpeditorwidget').val(content);
},
/**
* Update widget and close the editor
*/
updateWidgetAndCloseEditor: function() {
jQuery('#wpeditorwidget-tmce').trigger('click');
var editor = tinyMCE.EditorManager.get('wpeditorwidget');
var content = editor.getContent();
if (typeof editor === 'undefined' || editor === null || editor.isHidden()) {
content = jQuery('#wpeditorwidget').val();
}
var contentId = jQuery('#'+ this.currentContentId);
contentId.val(content);
if ( contentId.attr('class') === 'editorfield') {
var controlid = contentId.data('customize-setting-link');
setTimeout(function(){
wp.customize(controlid, function(obj) {
obj.set(editor.getContent());
} );
}, 1000);
}
this.hideEditor();
}
};
jQuery( document ).ready(function() {
jQuery('.customize-section-back').on('click',function(){
WPEditorWidget.hideEditor();
});
var customize = wp.customize;
customize.previewer.bind( 'trigger-close-editor', function( data ) {
if( data === true ){
WPEditorWidget.hideEditor();
}
});
});

View File

@@ -0,0 +1,53 @@
/* global requestpost */
/* global wp */
/* global WPEditorWidget */
( function( $ ) {
'use strict';
wp.customize( 'page_on_front', function( value ) {
value.bind( function( newval ) {
$.ajax({
url: requestpost.ajaxurl,
type: 'post',
data: {
action: 'chromax_ajax_call',
pid: newval
},
success: function (result) {
if(result !== '' && result !== 'undefined' ){
result = JSON.parse(result);
var content = result.post_content;
jQuery( '#Chromax_Page_Editor' ).val(content);
WPEditorWidget.setEditorContent('Chromax_Page_Editor');
if(result.post_thumbnail !== '' && result.post_thumbnail !== 'undefined'){
wp.customize.instance(requestpost.thumbnail_control).set(result.post_thumbnail);
var html = '<label for="chromax_feature_thumbnail-button">' +
'<span class="customize-control-title">' + requestpost.thumbnail_label + '</span>' +
'</label>' +
'<div class="attachment-media-view attachment-media-view-image landscape">' +
'<div class="thumbnail thumbnail-image">' +
'<img class="attachment-thumb" src="'+result.post_thumbnail+'" draggable="false" alt=""> ' +
'</div>' +
'<div class="actions">' +
'<button type="button" class="button remove-button">Remove</button>' +
'<button type="button" class="button upload-button control-focus" id="chromax_feature_thumbnail-button">Change Image</button> ' +
'<div style="clear:both"></div>' +
'</div>' +
'</div>';
wp.customize.control(requestpost.thumbnail_control).container['0'].innerHTML = html;
}
wp.customize.instance(requestpost.editor_control).previewer.refresh();
}
}
});
} );
} );
} )( jQuery );

View File

@@ -0,0 +1,82 @@
<?php
/**
* Singleton class for handling the theme's customizer integration.
*
* @since 1.0.0
* @access public
*/
final class Chromax_Customize {
/**
* Returns the instance.
*
* @since 1.0.0
* @access public
* @return object
*/
public static function get_instance() {
static $instance = null;
if ( is_null( $instance ) ) {
$instance = new self;
$instance->setup_actions();
}
return $instance;
}
/**
* Constructor method.
*
* @since 1.0.0
* @access private
* @return void
*/
private function __construct() {}
/**
* Sets up initial actions.
*
* @since 1.0.0
* @access private
* @return void
*/
private function setup_actions() {
// Register panels, sections, settings, controls, and partials.
add_action( 'customize_register', array( $this, 'sections' ) );
}
/**
* Sets up the customizer sections.
*
* @since 1.0.0
* @access public
* @param object $manager
* @return void
*/
public function sections( $manager ) {
// Load custom sections.
require_once CHROMAX_THEME_INC_DIR . '/customizer/controls/code/upgrade/section-pro.php';
// Register custom section types.
$manager->register_section_type( 'Chromax_Customize_Section_Pro' );
// Register sections.
$manager->add_section(
new Chromax_Customize_Section_Pro(
$manager,
'chromax',
array(
'pro_text' => esc_html__( 'Upgrade to Chromax Pro','chromax' ),
'pro_url' => 'https://desertthemes.com/themes/chromax-pro/',
'priority' => 0
)
)
);
}
}
// Doing this customizer thang!
Chromax_Customize::get_instance();

View File

@@ -0,0 +1,69 @@
<?php
/**
* Pro customizer section.
*
* @since 1.0.0
* @access public
*/
class Chromax_Customize_Section_Pro extends WP_Customize_Section {
/**
* The type of customize section being rendered.
*
* @since 1.0.0
* @access public
* @var string
*/
public $type = 'chromax';
/**
* Custom button text to output.
*
* @since 1.0.0
* @access public
* @var string
*/
public $pro_text = '';
/**
* Custom pro button URL.
*
* @since 1.0.0
* @access public
* @var string
*/
public $pro_url = '';
/**
* Add custom parameters to pass to the JS via JSON.
*
* @since 1.0.0
* @access public
* @return void
*/
public function json() {
$json = parent::json();
$json['pro_text'] = $this->pro_text;
$json['pro_url'] = esc_url( $this->pro_url );
return $json;
}
/**
* Outputs the Underscore.js template.
*
* @since 1.0.0
* @access public
* @return void
*/
protected function render_template() { ?>
<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }} cannot-expand control-section-default" aria-owns="sub-accordion-section-chromax-pro">
<h3 class="accordion-section-title">
{{ data.title }}
<a href="{{ data.pro_url }}" class="wp-ui-text-highlight" target="_blank" rel="noopener">{{ data.pro_text }}</a>
</h3>
</li>
<?php
}
}

View File

@@ -0,0 +1,281 @@
/* Range */
.range-slider__range:active::-moz-range-thumb {
background: #0085ba;
}
.customize-control input[type=number].range-slider-value {
width: 21%;
height: 28px;
text-align: center;
margin-left: 2%;
border-radius: 4px;
padding: 3px;
font-size: 12px;
font-weight: 600;
color: #555;
-moz-appearance: textfield;
}
.customize-control input[type=number].range-slider-value::-webkit-outer-spin-button,
.customize-control input[type=number].range-slider-value::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.customize-control input[type=number].range-slider-value {
-moz-appearance: textfield;
}
.range-reset-slider .dashicons{
width: 16px;
height: 16px;
font-size: 16px;
line-height: 1;
}
.customize-control span.range-reset-slider {
display: inline-block;
position: relative;
width: 6%;
line-height: 1;
color: rgba(0,0,0,.2);
cursor: pointer;
text-align: center;
transition: all .3s ease;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
-o-transition: all .3s ease;
-ms-transition: all .3s ease;
}
.range-slider {
width: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
-webkit-align-items: center;
align-items: center;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
flex-direction: row;
justify-content: flex-start;
}
.range-slider__range {
background-color: rgba(0,0,0,.1);
height: 5px;
width: 67% !important;
padding: 0;
margin-bottom: 0;
cursor: pointer;
outline: none;
-webkit-transition: background .5s;
-moz-transition: background .5s;
transition: background .5s;
-webkit-appearance: none;
}
.range-slider__range::-webkit-slider-thumb {
-webkit-appearance: none;
width: 15px;
height: 15px;
border: none;
border-radius: 15px;
background-color: #2e86b9;
}
.range-slider__range::-webkit-slider-thumb:hover {
background: #0085ba;
}
.range-slider__range:active::-webkit-slider-thumb {
background: #0085ba;
}
.range-slider__range::-moz-range-thumb {
width: 20px;
height: 20px;
border: 0;
border-radius: 50%;
background: #0085ba;
cursor: pointer;
-webkit-transition: background .15s ease-in-out;
transition: background .15s ease-in-out;
}
.range-slider__range::-moz-range-thumb:hover {
background: #0085ba;
}
.customize-control span.range-reset-slider:hover {
color: #fe5252;
}
::-moz-range-track {
background: #d7dcdf;
border: 0;
}
input::-moz-focus-inner, input::-moz-focus-outer {
border: 0;
}
.customize-control-range-value .customize-control-title,
.customize-control-range-value .responsive-switchers{
display: inline-block;
}
.responsive-switchers{
display: inline-block;
vertical-align: middle;
margin-bottom: 5px;
}
.responsive-switchers .preview-tablet,
.responsive-switchers .preview-mobile{
display: none;
}
.desktop-range,
.tablet-range,
.mobile-range{
display: none;
width:100%;
}
.desktop-range.active,
.tablet-range.active,
.mobile-range.active{
display: block;
}
.customize-control .responsive-switchers { margin-left: 5px; width: auto; }
.customize-control .responsive-switchers-open li button { display: block; }
.customize-control .responsive-switchers li { float: left; margin: 0; }
.customize-control .responsive-switchers li button { height: 20px; width: 20px; background-color: #a4afb7; cursor: pointer; position: relative; margin-left: 5px; color: #fff; font-size: 10px; text-align: center; border-radius: 50%; padding: 0; border: 0; outline: none; -webkit-transition: background-color .5s; transition: background-color .5s; cursor: pointer; }
.customize-control .responsive-switchers li button:hover { background-color: #c2cbd2; }
.customize-control .responsive-switchers li button.active { background-color: #13aff0; }
.customize-control .responsive-switchers li button i { width: auto; height: auto; font-size: inherit; line-height: 18px; }
.customize-control-hidden {
display: list-item;
margin-left: -12px;
margin-right: -12px;
padding: 7px 15px;
background: #FFF;
border-left: 8px solid #0073aa;
border-right: 8px solid #0073aa;
max-width: -webkit-fill-available;
margin-bottom: 10px;
}
.customize-control-hidden label {
margin-bottom: 0;
line-height: 2;
font-size: 1em;
cursor: default;
color: #000;
font-weight: 600;
}
/* Upsale */
.control-section-chromax h3 {
margin: 0;
padding: 1px 0;
border: 0;
position: relative;
}
.control-section-chromax h3 a {
background: #fff;
display: block;
text-decoration: none;
}
li#accordion-section-chromax a {
background: #f64a00;
color: #fff;
border-color: #f64a00;
margin-top: -4px;
}
li#accordion-section-chromax h3 {
background: #f64a00 !important;
}
li#customize-control-chromax_sidebar_option_upsale .desert-companion-upgrade-message,
li#customize-control-chromax_body_typography_option_upsale .desert-companion-upgrade-message,
#sub-accordion-section-chromax_headings_typography .desert-companion-upgrade-message,
li#customize-control-chromax_blog_option_upsale .desert-companion-upgrade-message{
display: block !important;
}
li#accordion-panel-chromax_typography_options {
margin-bottom: 10px;
}
.customize-control .icons-selector .selector-category select,
.customize-control .icons-selector .selector-search input[type=text] {
line-height: 13px;
height: 30px;
}
.customize-control .icons-selector,
.customize-control .icons-selector .selector {
width: 100%;
}
.customize-control .icons-selector .selector {
border: 1px solid #8c8f94;
border-radius: 3px;
height: 30px;
background-color: #fff;
}
.customize-control .icons-selector .selected-icon {
width: 70%;
}
.customize-control .icons-selector .selected-icon i {
line-height: 30px;
}
.customize-control .icons-selector .selector-button {
width: 28%;
border-left: 1px solid #8c8f94;
}
.customize-control .icons-selector .selector-button i {
line-height: 28px;
}
.customize-control .icons-selector .selector-popup {
padding: 12px;
border: 1px solid #ddd;
}
.customize-control .icons-selector .selector-arrows span,
.customize-control .icons-selector .fip-box,
.customize-control .icons-selector .selector-category select,
.customize-control .icons-selector .selector-search input[type=text] {
border: 1px solid #ddd;
}
.customize-control .icons-selector .selector-pages {
line-height: 14px;
}
.customize-control .icons-selector .selector-search i {
top: 5px;
}
.customize-control .icons-selector .selector-arrows span i {
width: auto;
height: auto;
line-height: 12px;
}
.customize-control .icons-selector .selector-arrows span:hover i,
.customize-control .icons-selector .fip-box:hover {
color: #0073aa;
}

View File

@@ -0,0 +1,188 @@
/* Range */
wp.customize.controlConstructor['range-value'] = wp.customize.Control.extend({
ready: function(){
'use strict';
jQuery.fn.exists = function(){return this.length>0;};
var control = this,
changeAction;
var theme_controls = jQuery('#customize-theme-controls');
function syncRangeText( slider, input, from ){
switch (from){
case 'slider':
input.val( slider.val());
break;
case 'input':
slider.val( input.val() );
break;
}
}
function updateValues( control ){
var collector = control.find('.range-collector');
var values = getSliderValues( control );
var have_queries = Object.keys(values).length > 1;
if( have_queries ){
collector.val(JSON.stringify(values));
} else {
collector.val(values.desktop);
}
collector.trigger( 'change' );
}
function getSliderValues( control ) {
var values = {};
var desktopSelector = control.find('.range-slider__range[data-query="desktop"]'),
tabletSelector = control.find('.range-slider__range[data-query="tablet"]') ,
mobileSelector = control.find('.range-slider__range[data-query="mobile"]'),
desktopValue, tabletValue, mobileValue;
if( desktopSelector.exists() ){
desktopValue = desktopSelector.val();
if( desktopValue !== 'undefined' && desktopValue !== '' ){
values.desktop = desktopValue;
}
}
if( tabletSelector.exists() ){
tabletValue = tabletSelector.val();
if( tabletValue !== 'undefined' && tabletValue !== '' ){
values.tablet = tabletValue;
}
}
if( mobileSelector.exists() ){
mobileValue = mobileSelector.val();
if( mobileValue !== 'undefined' && mobileValue !== '' ){
values.mobile = mobileValue;
}
}
return values;
}
function responsiveSwitcher(){
// Responsive switchers
jQuery( '.customize-control .responsive-switchers button' ).on( 'click', function( event ) {
event.preventDefault();
// Set up variables
var $devices = jQuery( '.responsive-switchers' ),
$device = jQuery( event.currentTarget ).data( 'device' ),
$body = jQuery( '.wp-full-overlay' ),
$footer_devices = jQuery( '.wp-full-overlay-footer .devices' );
// Button class
$devices.find( 'button' ).removeClass( 'active' );
$devices.find( 'button.preview-' + $device ).addClass( 'active' );
var control = jQuery('.range-slider.has-media-queries');
control.find('.desktop-range').removeClass('active');
control.find('.tablet-range').removeClass('active');
control.find('.mobile-range').removeClass('active');
control.find('.' + $device + '-range').addClass('active');
// Wrapper class
$body.removeClass( 'preview-desktop preview-tablet preview-mobile' ).addClass( 'preview-' + $device );
// Panel footer buttons
$footer_devices.find( 'button' ).removeClass( 'active' ).attr( 'aria-pressed', false );
$footer_devices.find( 'button.preview-' + $device ).addClass( 'active' ).attr( 'aria-pressed', true );
} );
jQuery('#customize-footer-actions .devices button').on( 'click', function( event ) {
event.preventDefault();
var device = jQuery(this).data('device');
var queries = jQuery( '.responsive-switchers' );
queries.find( 'button' ).removeClass( 'active' );
queries.find( 'button.preview-' + device ).addClass( 'active' );
var control = jQuery('.range-slider.has-media-queries');
control.find('.desktop-range').removeClass('active');
control.find('.tablet-range').removeClass('active');
control.find('.mobile-range').removeClass('active');
control.find('.' + device + '-range').addClass('active');
});
}
theme_controls.unbind().on('click', '.preview-desktop.active', function () {
jQuery( this ).parent().parent().toggleClass( 'responsive-switchers-open' );
});
theme_controls.on('input', '.range-slider__range', function () {
var slider = jQuery(this);
var input = jQuery(this).next();
var control = jQuery(this).parent().parent();
syncRangeText( slider, input, 'slider');
updateValues( control );
});
theme_controls.on('keyup', '.range-slider-value', function(){
var control = jQuery(this).parent().parent();
updateValues( control );
});
theme_controls.on('keydown', '.range-slider-value', function(){
var slider = jQuery(this).prev();
var input = jQuery(this);
syncRangeText( slider, input, 'input');
});
theme_controls.on('click', '.range-reset-slider', function (event) {
event.preventDefault();
var input = jQuery(this).prev();
var slider = input.prev();
var control = jQuery(this).parent().parent();
var defaultValue = slider.data('default');
input.val( defaultValue );
slider.val( defaultValue );
updateValues( control );
});
responsiveSwitcher();
if ( 'postMessage' === control.setting.transport ) {
changeAction = 'mousemove change';
} else {
changeAction = 'change';
}
// Change the value
this.container.on( changeAction, '.range-collector', function() {
control.setting.set( jQuery( this ).val() );
});
}
});
/* Upsale */
( function( api ) {
// Extends our custom "chromax" section.
api.sectionConstructor['chromax'] = api.Section.extend( {
// No events for this type of section.
attachEvents: function () {},
// Always make the section active.
isContextuallyActive: function () {
return true;
}
} );
} )( wp.customize );
jQuery(document).ready(function($) {
jQuery("#sub-accordion-section-chromax_sidebar_options select:not(#_customize-input-chromax_default_pg_sidebar_option), #sub-accordion-section-chromax_typography_options select, #sub-accordion-section-chromax_headings_typography select").prop('disabled', true);
});
jQuery(document).ready(function($) {
jQuery('.contact-icon-picker.iconPicker').fontIconPicker();
});

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
<defs>
<font id="iconpicker" horiz-adv-x="1000" >
<font-face font-family="iconpicker" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
<missing-glyph horiz-adv-x="1000" />
<glyph glyph-name="spin3" unicode="&#xe815;" d="m494 850c-266 0-483-210-494-472c-1-19 13-20 13-20l84 0c16 0 19 10 19 18c10 199 176 358 378 358c107 0 205-45 273-118l-58-57c-11-12-11-27 5-31l247-50c21-5 46 11 37 44l-58 227c-2 9-16 22-29 13l-65-60c-89 91-214 148-352 148z m409-508c-16 0-19-10-19-18c-10-199-176-358-377-358c-108 0-205 45-274 118l59 57c10 12 10 27-5 31l-248 50c-21 5-46-11-37-44l58-227c2-9 16-22 30-13l64 60c89-91 214-148 353-148c265 0 482 210 493 473c1 18-13 19-13 19l-84 0z" horiz-adv-x="1000" />
<glyph glyph-name="search" unicode="&#xe812;" d="m643 386q0 103-74 176t-176 74t-177-74t-73-176t73-177t177-73t176 73t74 177z m286-465q0-29-22-50t-50-21q-30 0-50 21l-191 191q-100-69-223-69q-80 0-153 31t-125 84t-84 125t-31 153t31 152t84 126t125 84t153 31t152-31t126-84t84-126t31-152q0-123-69-223l191-191q21-21 21-51z" horiz-adv-x="928.6" />
<glyph glyph-name="cancel" unicode="&#xe814;" d="m724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165l-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164l-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164l164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164l164-164q15-15 15-38z" horiz-adv-x="785.7" />
<glyph glyph-name="block" unicode="&#xe84e;" d="m732 352q0 90-48 164l-421-420q76-50 166-50q62 0 118 25t96 65t65 97t24 119z m-557-167l421 421q-75 50-167 50q-83 0-153-40t-110-112t-41-152q0-91 50-167z m682 167q0-88-34-168t-91-137t-137-92t-166-34t-167 34t-137 92t-91 137t-34 168t34 167t91 137t137 91t167 34t166-34t137-91t91-137t34-167z" horiz-adv-x="857.1" />
<glyph glyph-name="down-dir" unicode="&#xe800;" d="m571 457q0-14-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 11-11 25t11 25t25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
<glyph glyph-name="up-dir" unicode="&#xe813;" d="m571 171q0-14-10-25t-25-10h-500q-15 0-25 10t-11 25t11 26l250 250q10 10 25 10t25-10l250-250q10-11 10-26z" horiz-adv-x="571.4" />
<glyph glyph-name="left-dir" unicode="&#xe801;" d="m357 600v-500q0-14-10-25t-26-11t-25 11l-250 250q-10 11-10 25t10 25l250 250q11 11 25 11t26-11t10-25z" horiz-adv-x="357.1" />
<glyph glyph-name="right-dir" unicode="&#xe802;" d="m321 350q0-14-10-25l-250-250q-11-11-25-11t-25 11t-11 25v500q0 15 11 25t25 11t25-11l250-250q10-10 10-25z" horiz-adv-x="357.1" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,328 @@
/* fontIconPicker main CSS file {@link https://github.com/micc83/fontIconPicker} */
.icons-selector * {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
}
.icons-selector,
.icons-selector *,
.icons-selector :after,
.icons-selector :before,
.icons-selector:after,
.icons-selector:before {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box
}
.icons-selector {
display: inline-block;
vertical-align: middle;
text-align: left
}
.icons-selector .selector {
width: 100px;
height: 40px
}
.icons-selector .selector-button {
width: 39px;
height: 100%;
display: block;
text-align: center;
cursor: pointer;
float: left
}
.icons-selector .selector-button i {
line-height: 38px;
text-align: center
}
.icons-selector .selected-icon {
display: block;
width: 60px;
height: 100%;
float: left;
text-align: center
}
.icons-selector .selected-icon i {
line-height: 40px;
font-size: 18px;
cursor: default
}
.icons-selector .selector-popup {
position: absolute;
z-index: 10000;
background-color: #fefefe;
padding: 5px;
height: auto;
width: 342px;
margin-top: -1px
}
.icons-selector .selector-category select,
.icons-selector .selector-search input[type=text] {
border: 0;
line-height: 20px;
padding: 10px 2.5%;
width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 5px;
font-size: 12px;
display: block
}
.icons-selector .selector-category select {
height: 40px
}
.icons-selector .selector-category select option {
padding: 10px
}
.icons-selector input::-webkit-input-placeholder {
text-transform: uppercase
}
.icons-selector input:-moz-placeholder {
text-transform: uppercase
}
.icons-selector input::-moz-placeholder {
text-transform: uppercase
}
.icons-selector input:-ms-input-placeholder {
text-transform: uppercase
}
.icons-selector .selector-search {
position: relative
}
.icons-selector .selector-search i {
position: absolute;
right: 10px;
top: 7px
}
.icons-selector .fip-icons-container {
width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 5px
}
.icons-selector .fip-icons-container .loading {
font-size: 24px;
margin: 0 auto;
padding: 20px 0;
text-align: center;
width: 100%
}
.icons-selector .fip-box {
display: inline-block;
margin: 2px;
width: 60px;
line-height: 42px;
text-align: center;
cursor: pointer;
vertical-align: top;
height: 40px
}
.icons-selector .selector-footer {
line-height: 12px;
padding: 5px 5px 0;
text-align: center
}
.icons-selector .selector-footer,
.icons-selector .selector-footer i {
font-size: 14px
}
.icons-selector .selector-arrows {
float: right
}
.icons-selector .selector-pages {
font-size: 11px;
float: left
}
.icons-selector .selector-arrows i {
cursor: pointer
}
.icons-selector .selector-footer em {
font-style: italic
}
.icons-selector .icons-picker-error i:before {
color: #eee
}
@font-face {
font-family: iconpicker;
src: url(iconpicker.eot?90190138);
src: url(iconpicker.eot?90190138#iefix) format('embedded-opentype'), url(iconpicker.woff?90190138) format('woff'), url(iconpicker.ttf?90190138) format('truetype'), url(iconpicker.svg?90190138#iconpicker) format('svg');
font-weight: 400;
font-style: normal
}
.icons-selector [class*=" fip-icon-"]:before,
.icons-selector [class^=fip-icon-]:before {
font-family: iconpicker;
font-style: normal;
font-weight: 400;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
font-variant: normal;
text-transform: none;
line-height: 1em;
margin-left: .2em
}
.icons-selector .fip-icon-search:before {
content: '\e812';
cursor: default
}
.icons-selector .fip-icon-cancel:before {
content: '\e814';
cursor: pointer
}
.icons-selector .fa-times-circle-o:before {
color: #fed0d0;
font-size: 18px;
line-height: 1.85;
}
.icons-selector .fip-icon-block:before {
content: '\e84e';
color: #fed0d0
}
.icons-selector .fip-icon-down-dir:before {
content: '\e800'
}
.icons-selector .fip-icon-up-dir:before {
content: '\e813'
}
.icons-selector .fip-icon-left-dir:before {
content: '\e801'
}
.icons-selector .fip-icon-right-dir:before {
content: '\e802'
}
.icons-selector .fip-icon-spin3:before {
content: '\e815'
}
.icons-selector .fip-icon-spin3 {
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
-webkit-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
display: inline-block
}
@-moz-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg)
}
}
@-webkit-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg)
}
}
@-o-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg)
}
}
@-ms-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg)
}
}
@keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg)
}
}
.icons-selector .selector-popup {
width: 280px;
}

View File

@@ -0,0 +1,415 @@
/**
* jQuery fontIconPicker - v2.0.0
*
* An icon picker built on top of font icons and jQuery
*
* http://codeb.it/fontIconPicker
*
* Made by Alessandro Benoit & Swashata
* Under MIT License
*
* {@link https://github.com/micc83/fontIconPicker}
*/
!(function(a) {
"use strict";
function c(c, d) {
(this.element = a(c)),
(this.settings = a.extend({}, b, d)),
this.settings.emptyIcon && this.settings.iconsPerPage--,
(this.iconPicker = a("<div/>", {
class: "icons-selector",
style: "position: relative",
html: '<div class="selector"><span class="selected-icon"><i class="fa-times-circle"></i></span><span class="selector-button"><i class="fip-icon-down-dir"></i></span></div><div class="selector-popup" style="display: none;">' +
(this.settings.hasSearch ? '<div class="selector-search"><input type="text" name="" value="" placeholder="Search icon" class="icons-search-input"/><i class="fip-icon-search"></i></div>' : "") +
'<div class="selector-category">' +
'<select name="" class="icon-category-select" style="display: none">' +
"</select>" +
"</div>" +
'<div class="fip-icons-container"></div>' +
'<div class="selector-footer" style="display:none;">' +
'<span class="selector-pages">1/2</span>' +
'<span class="selector-arrows">' +
'<span class="selector-arrow-left" style="display:none;">' +
'<i class="fip-icon-left-dir"></i>' +
"</span>" +
'<span class="selector-arrow-right">' +
'<i class="fip-icon-right-dir"></i>' +
"</span>" +
"</span>" +
"</div>" +
"</div>",
})),
(this.iconContainer = this.iconPicker.find(".fip-icons-container")),
(this.searchIcon = this.iconPicker.find(".selector-search i")),
(this.iconsSearched = []),
(this.isSearch = !1),
(this.totalPage = 1),
(this.currentPage = 1),
(this.currentIcon = !1),
(this.iconsCount = 0),
(this.open = !1),
(this.searchValues = []),
(this.availableCategoriesSearch = []),
(this.triggerEvent = null),
(this.backupSource = []),
(this.backupSearch = []),
(this.isCategorized = !1),
(this.selectCategory = this.iconPicker.find(".icon-category-select")),
(this.selectedCategory = !1),
(this.availableCategories = []),
(this.unCategorizedKey = null),
this.init();
}
var b = {
theme: "fip-grey",
source: !1,
emptyIcon: !0,
emptyIconValue: "",
iconsPerPage: 20,
hasSearch: !0,
searchSource: !1,
useAttribute: !1,
attributeName: "data-icon",
convertToHex: !0,
allCategoryText: "From all categories",
unCategorizedText: "Uncategorized",
};
(c.prototype = {
init: function() {
this.iconPicker.addClass(this.settings.theme), this.iconPicker.css({
left: -9999
}).appendTo("body");
var b = this.iconPicker.outerHeight(),
c = this.iconPicker.outerWidth();
if (
(this.iconPicker.css({
left: ""
}),
this.element.before(this.iconPicker),
this.element.css({
visibility: "hidden",
top: 0,
position: "relative",
zIndex: "-1",
left: "-" + c + "px",
display: "inline-block",
height: b + "px",
width: c + "px",
padding: "0",
margin: "0 -" + c + "px 0 0",
border: "0 none",
verticalAlign: "top",
}), !this.element.is("select"))
) {
var d = (function() {
for (var a = 3, b = document.createElement("div"), c = b.all || [];
(b.innerHTML = "<!--[if gt IE " + ++a + "]><br><![endif]-->"), c[0];);
return a > 4 ? a : !a;
})(),
e = document.createElement("div");
this.triggerEvent = 9 !== d && "oninput" in e ? ["input", "keyup"] : ["keyup"];
}!this.settings.source && this.element.is("select") ?
((this.settings.source = []),
(this.settings.searchSource = []),
this.element.find("optgroup").length ?
((this.isCategorized = !0),
this.element.find("optgroup").each(
a.proxy(function(b, c) {
var d = this.availableCategories.length,
e = a("<option />");
e.attr("value", d),
e.html(a(c).attr("label")),
this.selectCategory.append(e),
(this.availableCategories[d] = []),
(this.availableCategoriesSearch[d] = []),
a(c)
.find("option")
.each(
a.proxy(function(b, c) {
var e = a(c).val(),
f = a(c).html();
e && e !== this.settings.emptyIconValue && (this.settings.source.push(e), this.availableCategories[d].push(e), this.searchValues.push(f), this.availableCategoriesSearch[d].push(f));
}, this)
);
}, this)
),
this.element.find("> option").length &&
this.element.find("> option").each(
a.proxy(function(b, c) {
var d = a(c).val(),
e = a(c).html();
return d && "" !== d && d != this.settings.emptyIconValue ?
(null === this.unCategorizedKey &&
((this.unCategorizedKey = this.availableCategories.length),
(this.availableCategories[this.unCategorizedKey] = []),
(this.availableCategoriesSearch[this.unCategorizedKey] = []),
a("<option />").attr("value", this.unCategorizedKey).html(this.settings.unCategorizedText).appendTo(this.selectCategory)),
this.settings.source.push(d),
this.availableCategories[this.unCategorizedKey].push(d),
this.searchValues.push(e),
this.availableCategoriesSearch[this.unCategorizedKey].push(e),
void 0) :
!0;
}, this)
)) :
this.element.find("option").each(
a.proxy(function(b, c) {
var d = a(c).val(),
e = a(c).html();
d && (this.settings.source.push(d), this.searchValues.push(e));
}, this)
),
(this.backupSource = this.settings.source.slice(0)),
(this.backupSearch = this.searchValues.slice(0)),
this.loadCategories()) :
this.initSourceIndex(),
this.loadIcons(),
this.selectCategory.on(
"change keyup",
a.proxy(function(b) {
if (this.isCategorized === !1) return !1;
var c = a(b.currentTarget),
d = c.val();
if ("all" === c.val())(this.settings.source = this.backupSource), (this.searchValues = this.backupSearch);
else {
var e = parseInt(d, 10);
this.availableCategories[e] && ((this.settings.source = this.availableCategories[e]), (this.searchValues = this.availableCategoriesSearch[e]));
}
this.resetSearch(), this.loadIcons();
}, this)
),
this.iconPicker.find(".selector-button").click(
a.proxy(function() {
this.toggleIconSelector();
}, this)
),
this.iconPicker.find(".selector-arrow-right").click(
a.proxy(function(b) {
this.currentPage < this.totalPage && (this.iconPicker.find(".selector-arrow-left").show(), (this.currentPage = this.currentPage + 1), this.renderIconContainer()),
this.currentPage === this.totalPage && a(b.currentTarget).hide();
}, this)
),
this.iconPicker.find(".selector-arrow-left").click(
a.proxy(function(b) {
this.currentPage > 1 && (this.iconPicker.find(".selector-arrow-right").show(), (this.currentPage = this.currentPage - 1), this.renderIconContainer()), 1 === this.currentPage && a(b.currentTarget).hide();
}, this)
),
this.iconPicker.find(".icons-search-input").keyup(
a.proxy(function(b) {
var c = a(b.currentTarget).val();
return "" === c ?
(this.resetSearch(), void 0) :
(this.searchIcon.removeClass("fip-icon-search"),
this.searchIcon.addClass("fip-icon-cancel"),
(this.isSearch = !0),
(this.currentPage = 1),
(this.iconsSearched = []),
a.grep(
this.searchValues,
a.proxy(function(a, b) {
return a.toLowerCase().search(c.toLowerCase()) >= 0 ? ((this.iconsSearched[this.iconsSearched.length] = this.settings.source[b]), !0) : void 0;
}, this)
),
this.renderIconContainer(),
void 0);
}, this)
),
this.iconPicker.find(".selector-search").on(
"click",
".fip-icon-cancel",
a.proxy(function() {
this.iconPicker.find(".icons-search-input").focus(), this.resetSearch();
}, this)
),
this.iconContainer.on(
"click",
".fip-box",
a.proxy(function(b) {
this.setSelectedIcon(a(b.currentTarget).find("i").attr("data-fip-value")), this.toggleIconSelector();
}, this)
),
this.iconPicker.click(function(a) {
return a.stopPropagation(), !1;
}),
a("html").click(
a.proxy(function() {
this.open && this.toggleIconSelector();
}, this)
);
},
initSourceIndex: function() {
if ("object" == typeof this.settings.source) {
if (a.isArray(this.settings.source))
(this.isCategorized = !1),
this.selectCategory.html("").hide(),
(this.settings.source = a.map(this.settings.source, function(a) {
return "function" == typeof a.toString ? a.toString() : a;
})),
(this.searchValues = a.isArray(this.settings.searchSource) ?
a.map(this.settings.searchSource, function(a) {
return "function" == typeof a.toString ? a.toString() : a;
}) :
this.settings.source.slice(0));
else {
var b = a.extend(!0, {}, this.settings.source);
(this.settings.source = []),
(this.searchValues = []),
(this.availableCategoriesSearch = []),
(this.selectedCategory = !1),
(this.availableCategories = []),
(this.unCategorizedKey = null),
(this.isCategorized = !0),
this.selectCategory.html("");
for (var c in b) {
var d = this.availableCategories.length,
e = a("<option />");
e.attr("value", d), e.html(c), this.selectCategory.append(e), (this.availableCategories[d] = []), (this.availableCategoriesSearch[d] = []);
for (var f in b[c]) {
var g = b[c][f],
h = this.settings.searchSource && this.settings.searchSource[c] && this.settings.searchSource[c][f] ? this.settings.searchSource[c][f] : g;
"function" == typeof g.toString && (g = g.toString()),
g && g !== this.settings.emptyIconValue && (this.settings.source.push(g), this.availableCategories[d].push(g), this.searchValues.push(h), this.availableCategoriesSearch[d].push(h));
}
}
}
(this.backupSource = this.settings.source.slice(0)), (this.backupSearch = this.searchValues.slice(0)), this.loadCategories();
}
},
loadCategories: function() {
this.isCategorized !== !1 && (a('<option value="all">' + this.settings.allCategoryText + "</option>").prependTo(this.selectCategory), this.selectCategory.show().val("all").trigger("change"));
},
loadIcons: function() {
this.iconContainer.html('<i class="fip-icon-spin3 animate-spin loading"></i>'), this.settings.source instanceof Array && this.renderIconContainer();
},
renderIconContainer: function() {
var b,
c = [];
if (
((c = this.isSearch ? this.iconsSearched : this.settings.source),
(this.iconsCount = c.length),
(this.totalPage = Math.ceil(this.iconsCount / this.settings.iconsPerPage)),
this.totalPage > 1 ? this.iconPicker.find(".selector-footer").show() : this.iconPicker.find(".selector-footer").hide(),
this.iconPicker.find(".selector-pages").html(this.currentPage + "/" + this.totalPage + " <em>(" + this.iconsCount + ")</em>"),
(b = (this.currentPage - 1) * this.settings.iconsPerPage),
this.settings.emptyIcon)
)
this.iconContainer.html('<span class="fip-box"><i class="fas fa-times-circle" data-fip-value="fa-times-circle"></i></span>');
else {
if (c.length < 1) return this.iconContainer.html('<span class="icons-picker-error"><i class="fas fa-times-circle" data-fip-value="fa-times-circle"></i></span>'), void 0;
this.iconContainer.html("");
}
c = c.slice(b, b + this.settings.iconsPerPage);
for (var e, d = 0;
(e = c[d++]);) {
var f = e;
a.grep(
this.settings.source,
a.proxy(function(a, b) {
return a === e ? ((f = this.searchValues[b]), !0) : !1;
}, this)
),
a("<span/>", {
html: '<i data-fip-value="' +
e +
'" ' +
(this.settings.useAttribute ? this.settings.attributeName + '="' + (this.settings.convertToHex ? "&#x" + parseInt(e, 10).toString(16) + ";" : e) + '"' : 'class=" ' + e + '"') +
"></i>",
class: "fip-box",
title: f,
}).appendTo(this.iconContainer);
}
this.settings.emptyIcon || (this.element.val() && -1 !== a.inArray(this.element.val(), this.settings.source)) ?
-1 === a.inArray(this.element.val(), this.settings.source) ?
this.setSelectedIcon() :
this.setSelectedIcon(this.element.val()) :
this.setSelectedIcon(c[0]);
},
setHighlightedIcon: function() {
this.iconContainer.find(".current-icon").removeClass("current-icon"),
this.currentIcon &&
this.iconContainer
.find('[data-fip-value="' + this.currentIcon + '"]')
.parent("span")
.addClass("current-icon");
},
setSelectedIcon: function(a) {
if (
("fa-times-circle" === a && (a = ""),
this.settings.useAttribute ?
a ?
this.iconPicker.find(".selected-icon").html("<i " + this.settings.attributeName + '="' + (this.settings.convertToHex ? "&#x" + parseInt(a, 10).toString(16) + ";" : a) + '"></i>') :
this.iconPicker.find(".selected-icon").html('<i class="fa-times-circle"></i>') :
this.iconPicker.find(".selected-icon").html('<i class="fas ' + (a || "fa-times-circle") + '"></i>'),
this.element.val("" === a ? this.settings.emptyIconValue : a).trigger("change"),
null !== this.triggerEvent)
)
for (var b in this.triggerEvent) this.element.trigger(this.triggerEvent[b]);
(this.currentIcon = a), this.setHighlightedIcon();
},
toggleIconSelector: function() {
(this.open = this.open ? 0 : 1),
this.iconPicker.find(".selector-popup").slideToggle(300),
this.iconPicker.find(".selector-button i").toggleClass("fip-icon-down-dir"),
this.iconPicker.find(".selector-button i").toggleClass("fip-icon-up-dir"),
this.open && this.iconPicker.find(".icons-search-input").focus().select();
},
resetSearch: function() {
this.iconPicker.find(".icons-search-input").val(""),
this.searchIcon.removeClass("fip-icon-cancel"),
this.searchIcon.addClass("fip-icon-search"),
this.iconPicker.find(".selector-arrow-left").hide(),
(this.currentPage = 1),
(this.isSearch = !1),
this.renderIconContainer(),
this.totalPage > 1 && this.iconPicker.find(".selector-arrow-right").show();
},
}),
(a.fn.fontIconPicker = function(b) {
return (
this.each(function() {
a.data(this, "fontIconPicker") || a.data(this, "fontIconPicker", new c(this, b));
}),
(this.setIcons = a.proxy(function(b, c) {
void 0 === b && (b = !1),
void 0 === c && (c = !1),
this.each(function() {
(a.data(this, "fontIconPicker").settings.source = b),
(a.data(this, "fontIconPicker").settings.searchSource = c),
a.data(this, "fontIconPicker").initSourceIndex(),
a.data(this, "fontIconPicker").resetSearch(),
a.data(this, "fontIconPicker").loadIcons();
});
}, this)),
(this.destroyPicker = a.proxy(function() {
this.each(function() {
a.data(this, "fontIconPicker") &&
(a.data(this, "fontIconPicker").iconPicker.remove(),
a.data(this, "fontIconPicker").element.css({
visibility: "",
top: "",
position: "",
zIndex: "",
left: "",
display: "",
height: "",
width: "",
padding: "",
margin: "",
border: "",
verticalAlign: ""
}),
a.removeData(this, "fontIconPicker"));
});
}, this)),
(this.refreshPicker = a.proxy(function(d) {
d || (d = b),
this.destroyPicker(),
this.each(function() {
a.data(this, "fontIconPicker") || a.data(this, "fontIconPicker", new c(this, d));
});
}, this)),
this
);
});
})(jQuery);

View File

@@ -0,0 +1,298 @@
<?php
class Chromax_Customizer_Notify_Section extends WP_Customize_Section {
public $type = 'chromax-customizer-notify-section';
public $recommended_actions = '';
public $recommended_plugins = '';
public $total_actions = '';
public $plugin_text = '';
public $dismiss_button = '';
public function check_active( $slug ) {
if ( file_exists( ABSPATH . 'wp-content/plugins/' . $slug . '/' . $slug . '.php' ) ) {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$needs = is_plugin_active( $slug . '/' . $slug . '.php' ) ? 'deactivate' : 'activate';
return array(
'status' => is_plugin_active( $slug . '/' . $slug . '.php' ),
'needs' => $needs,
);
}
return array(
'status' => false,
'needs' => 'install',
);
}
public function create_action_link( $state, $slug ) {
switch ( $state ) {
case 'install':
return wp_nonce_url(
add_query_arg(
array(
'action' => 'install-plugin',
'plugin' => $slug,
),
network_admin_url( 'update.php' )
),
'install-plugin_' . $slug
);
break;
case 'deactivate':
return add_query_arg(
array(
'action' => 'deactivate',
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
'plugin_status' => 'all',
'paged' => '1',
'_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . $slug . '/' . $slug . '.php' ),
), network_admin_url( 'plugins.php' )
);
break;
case 'activate':
return add_query_arg(
array(
'action' => 'activate',
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
'plugin_status' => 'all',
'paged' => '1',
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $slug . '/' . $slug . '.php' ),
), network_admin_url( 'plugins.php' )
);
break;
}// End switch().
}
public function call_plugin_api( $slug ) {
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
$call_api = get_transient( 'chromax_cust_notify_plugin_info_' . $slug );
if ( false === $call_api ) {
$call_api = plugins_api(
'plugin_information', array(
'slug' => $slug,
'fields' => array(
'downloaded' => false,
'rating' => false,
'description' => false,
'short_description' => true,
'donate_link' => false,
'tags' => false,
'sections' => false,
'homepage' => false,
'added' => false,
'last_updated' => false,
'compatibility' => false,
'tested' => false,
'requires' => false,
'downloadlink' => false,
'icons' => false,
),
)
);
set_transient( 'chromax_cust_notify_plugin_info_' . $slug, $call_api, 30 * MINUTE_IN_SECONDS );
}
return $call_api;
}
public function json() {
$json = parent::json();
global $chromax_customizer_notify_recommended_actions;
global $chromax_customizer_notify_recommended_plugins;
global $install_button_label;
global $activate_button_label;
global $chromax_deactivate_button_label;
$formatted_array = array();
$chromax_customizer_notify_show_recommended_actions = get_option( 'chromax_customizer_notify_show' );
foreach ( $chromax_customizer_notify_recommended_actions as $key => $chromax_lite_customizer_notify_recommended_action ) {
if ( $chromax_customizer_notify_show_recommended_actions[ $chromax_lite_customizer_notify_recommended_action['id'] ] === false ) {
continue;
}
if ( $chromax_lite_customizer_notify_recommended_action['check'] ) {
continue;
}
$chromax_lite_customizer_notify_recommended_action['index'] = $key + 1;
if ( isset( $chromax_lite_customizer_notify_recommended_action['plugin_slug'] ) ) {
$active = $this->check_active( $chromax_customizer_notify_recommended_action['plugin_slug'] );
$chromax_lite_customizer_notify_recommended_action['url'] = $this->create_action_link( $active['needs'], $chromax_lite_customizer_notify_recommended_action['plugin_slug'] );
if ( $active['needs'] !== 'install' && $active['status'] ) {
$chromax_lite_customizer_notify_recommended_action['class'] = 'active';
} else {
$chromax_lite_customizer_notify_recommended_action['class'] = '';
}
switch ( $active['needs'] ) {
case 'install':
$chromax_lite_customizer_notify_recommended_action['button_class'] = 'install-now button';
$chromax_lite_customizer_notify_recommended_action['button_label'] = $install_button_label;
break;
case 'activate':
$chromax_lite_customizer_notify_recommended_action['button_class'] = 'activate-now button button-primary';
$chromax_lite_customizer_notify_recommended_action['button_label'] = $activate_button_label;
break;
case 'deactivate':
$chromax_lite_customizer_notify_recommended_action['button_class'] = 'deactivate-now button';
$chromax_lite_customizer_notify_recommended_action['button_label'] = $chromax_deactivate_button_label;
break;
}
}
$formatted_array[] = $chromax_lite_customizer_notify_recommended_action;
}// End foreach().
$customize_plugins = array();
$chromax_lite_customizer_notify_show_recommended_plugins = get_option( 'chromax_customizer_notify_show_recommended_plugins' );
foreach ( $chromax_customizer_notify_recommended_plugins as $slug => $plugin_opt ) {
if ( ! $plugin_opt['recommended'] ) {
continue;
}
if ( isset( $chromax_lite_customizer_notify_show_recommended_plugins[ $slug ] ) && $chromax_lite_customizer_notify_show_recommended_plugins[ $slug ] ) {
continue;
}
$active = $this->check_active( $slug );
if ( ! empty( $active['needs'] ) && ( $active['needs'] == 'deactivate' ) ) {
continue;
}
$ti_customizer_notify_recommended_plugin['url'] = $this->create_action_link( $active['needs'], $slug );
if ( $active['needs'] !== 'install' && $active['status'] ) {
$ti_customizer_notify_recommended_plugin['class'] = 'active';
} else {
$ti_customizer_notify_recommended_plugin['class'] = '';
}
switch ( $active['needs'] ) {
case 'install':
$ti_customizer_notify_recommended_plugin['button_class'] = 'install-now button';
$ti_customizer_notify_recommended_plugin['button_label'] = $install_button_label;
break;
case 'activate':
$ti_customizer_notify_recommended_plugin['button_class'] = 'activate-now button button-primary';
$ti_customizer_notify_recommended_plugin['button_label'] = $activate_button_label;
break;
case 'deactivate':
$ti_customizer_notify_recommended_plugin['button_class'] = 'deactivate-now button';
$ti_customizer_notify_recommended_plugin['button_label'] = $chromax_deactivate_button_label;
break;
}
$info = $this->call_plugin_api( $slug );
$ti_customizer_notify_recommended_plugin['id'] = $slug;
$ti_customizer_notify_recommended_plugin['plugin_slug'] = $slug;
if ( ! empty( $plugin_opt['description'] ) ) {
$ti_customizer_notify_recommended_plugin['description'] = $plugin_opt['description'];
} else {
$ti_customizer_notify_recommended_plugin['description'] = $info->short_description;
}
$ti_customizer_notify_recommended_plugin['title'] = $info->name;
$customize_plugins[] = $ti_customizer_notify_recommended_plugin;
}// End foreach().
$json['recommended_actions'] = $formatted_array;
$json['recommended_plugins'] = $customize_plugins;
$json['total_actions'] = count( $chromax_customizer_notify_recommended_actions );
$json['plugin_text'] = $this->plugin_text;
$json['dismiss_button'] = $this->dismiss_button;
return $json;
}
protected function render_template() {
?>
<# if( data.recommended_actions.length > 0 || data.recommended_plugins.length > 0 ){ #>
<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
<h3 class="accordion-section-title">
<span class="section-title" data-plugin_text="{{ data.plugin_text }}">
<# if( data.recommended_actions.length > 0 ){ #>
{{ data.title }}
<# }else{ #>
<# if( data.recommended_plugins.length > 0 ){ #>
{{ data.plugin_text }}
<# }#>
<# } #>
</span>
<# if( data.recommended_actions.length > 0 ){ #>
<span class="chromax-customizer-plugin-notify-actions-count">
<span class="current-index">{{ data.recommended_actions[0].index }}</span>
{{ data.total_actions }}
</span>
<# } #>
</h3>
<div class="chromax-theme-recomended-actions_container" id="plugin-filter">
<# if( data.recommended_actions.length > 0 ){ #>
<# for (action in data.recommended_actions) { #>
<div class="chromax-recommeded-actions-container epsilon-required-actions" data-index="{{ data.recommended_actions[action].index }}">
<# if( !data.recommended_actions[action].check ){ #>
<div class="chromax-epsilon-recommeded-actions">
<p class="title">{{ data.recommended_actions[action].title }}</p>
<span data-action="dismiss" class="dashicons dashicons-no chromax-customizer-notify-dismiss-recommended-action" id="{{ data.recommended_actions[action].id }}"></span>
<div class="description">{{{ data.recommended_actions[action].description }}}</div>
<# if( data.recommended_actions[action].plugin_slug ){ #>
<div class="custom-action">
<p class="plugin-card-{{ data.recommended_actions[action].plugin_slug }} action_button {{ data.recommended_actions[action].class }}">
<a data-slug="{{ data.recommended_actions[action].plugin_slug }}" class="{{ data.recommended_actions[action].button_class }}" href="{{ data.recommended_actions[action].url }}">{{ data.recommended_actions[action].button_label }}</a>
</p>
</div>
<# } #>
<# if( data.recommended_actions[action].help ){ #>
<div class="custom-action">{{{ data.recommended_actions[action].help }}}</div>
<# } #>
</div>
<# } #>
</div>
<# } #>
<# } #>
<# if( data.recommended_plugins.length > 0 ){ #>
<# for (action in data.recommended_plugins) { #>
<div class="chromax-recommeded-actions-container epsilon-recommended-plugins" data-index="{{ data.recommended_plugins[action].index }}">
<# if( !data.recommended_plugins[action].check ){ #>
<div class="chromax-epsilon-recommeded-actions">
<p class="title">{{ data.recommended_plugins[action].title }}</p>
<span data-action="dismiss" class="dashicons dashicons-no chromax-customizer-notify-dismiss-button-recommended-plugin" id="{{ data.recommended_plugins[action].id }}"></span>
<div class="description">{{{ data.recommended_plugins[action].description }}}</div>
<# if( data.recommended_plugins[action].plugin_slug ){ #>
<div class="custom-action">
<p class="plugin-card-{{ data.recommended_plugins[action].plugin_slug }} action_button {{ data.recommended_plugins[action].class }}">
<a data-slug="{{ data.recommended_plugins[action].plugin_slug }}" class="{{ data.recommended_plugins[action].button_class }}" href="{{ data.recommended_plugins[action].url }}">{{ data.recommended_plugins[action].button_label }}</a>
</p>
</div>
<# } #>
<# if( data.recommended_plugins[action].help ){ #>
<div class="custom-action">{{{ data.recommended_plugins[action].help }}}</div>
<# } #>
</div>
<# } #>
</div>
<# } #>
<# } #>
</div>
</li>
<# } #>
<?php
}
}

View File

@@ -0,0 +1,207 @@
<?php
class Chromax_Customizer_Notify {
private $recommended_actions;
private $recommended_plugins;
private $config;
private static $instance;
private $recommended_actions_title;
private $recommended_plugins_title;
private $dismiss_button;
private $install_button_label;
private $activate_button_label;
private $chromax_deactivate_button_label;
public static function init( $config ) {
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Chromax_Customizer_Notify ) ) {
self::$instance = new Chromax_Customizer_Notify;
if ( ! empty( $config ) && is_array( $config ) ) {
self::$instance->config = $config;
self::$instance->setup_config();
self::$instance->setup_actions();
}
}
}
public function setup_config() {
global $chromax_customizer_notify_recommended_plugins;
global $chromax_customizer_notify_recommended_actions;
global $install_button_label;
global $activate_button_label;
global $chromax_deactivate_button_label;
$this->recommended_actions = isset( $this->config['recommended_actions'] ) ? $this->config['recommended_actions'] : array();
$this->recommended_plugins = isset( $this->config['recommended_plugins'] ) ? $this->config['recommended_plugins'] : array();
$this->recommended_actions_title = isset( $this->config['recommended_actions_title'] ) ? $this->config['recommended_actions_title'] : '';
$this->recommended_plugins_title = isset( $this->config['recommended_plugins_title'] ) ? $this->config['recommended_plugins_title'] : '';
$this->dismiss_button = isset( $this->config['dismiss_button'] ) ? $this->config['dismiss_button'] : '';
$chromax_customizer_notify_recommended_plugins = array();
$chromax_customizer_notify_recommended_actions = array();
if ( isset( $this->recommended_plugins ) ) {
$chromax_customizer_notify_recommended_plugins = $this->recommended_plugins;
}
if ( isset( $this->recommended_actions ) ) {
$chromax_customizer_notify_recommended_actions = $this->recommended_actions;
}
$install_button_label = isset( $this->config['install_button_label'] ) ? $this->config['install_button_label'] : '';
$activate_button_label = isset( $this->config['activate_button_label'] ) ? $this->config['activate_button_label'] : '';
$chromax_deactivate_button_label = isset( $this->config['chromax_deactivate_button_label'] ) ? $this->config['chromax_deactivate_button_label'] : '';
}
public function setup_actions() {
// Register the section
add_action( 'customize_register', array( $this, 'chromax_plugin_notification_customize_register' ) );
// Enqueue scripts and styles
add_action( 'customize_controls_enqueue_scripts', array( $this, 'chromax_customizer_notify_scripts_for_customizer' ), 0 );
/* ajax callback for dismissable recommended actions */
add_action( 'wp_ajax_quality_customizer_notify_dismiss_action', array( $this, 'chromax_customizer_notify_dismiss_recommended_action_callback' ) );
add_action( 'wp_ajax_ti_customizer_notify_dismiss_recommended_plugins', array( $this, 'chromax_customizer_notify_dismiss_recommended_plugins_callback' ) );
}
public function chromax_customizer_notify_scripts_for_customizer() {
wp_enqueue_style( 'chromax-customizer-notify-css', get_template_directory_uri() . '/inc/customizer/customizer-plugin-notice/css/chromax-customizer-notify.css', array());
wp_enqueue_style( 'plugin-install' );
wp_enqueue_script( 'plugin-install' );
wp_add_inline_script( 'plugin-install', 'var pagenow = "customizer";' );
wp_enqueue_script( 'updates' );
wp_enqueue_script( 'chromax-customizer-notify-js', get_template_directory_uri() . '/inc/customizer/customizer-plugin-notice/js/chromax-customizer-notify.js', array( 'customize-controls' ));
wp_localize_script(
'chromax-customizer-notify-js', 'chromaxCustomizercompanionObject', array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'template_directory' => get_template_directory_uri(),
'base_path' => admin_url(),
'activating_string' => __( 'Activating', 'chromax' ),
'nonce' => wp_create_nonce('ajax-nonce')
)
);
}
public function chromax_plugin_notification_customize_register( $wp_customize ) {
require_once get_template_directory() . '/inc/customizer/customizer-plugin-notice/chromax-customizer-notify-section.php';
$wp_customize->register_section_type( 'Chromax_Customizer_Notify_Section' );
$wp_customize->add_section(
new chromax_Customizer_Notify_Section(
$wp_customize,
'Chromax-customizer-notify-section',
array(
'title' => $this->recommended_actions_title,
'plugin_text' => $this->recommended_plugins_title,
'dismiss_button' => $this->dismiss_button,
'priority' => 0,
)
)
);
}
public function chromax_customizer_notify_dismiss_recommended_action_callback() {
global $chromax_customizer_notify_recommended_actions;
$action_id = ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0;
echo esc_html( $action_id ); /* this is needed and it's the id of the dismissable required action */
if ( ! empty( $action_id ) ) {
if ( get_option( 'chromax_customizer_notify_show' ) ) {
$chromax_customizer_notify_show_recommended_actions = get_option( 'chromax_customizer_notify_show' );
switch ( $_GET['todo'] ) {
case 'add':
$chromax_customizer_notify_show_recommended_actions[ $action_id ] = true;
break;
case 'dismiss':
$chromax_customizer_notify_show_recommended_actions[ $action_id ] = false;
break;
}
update_option( 'chromax_customizer_notify_show', $chromax_customizer_notify_show_recommended_actions );
} else {
$chromax_customizer_notify_show_recommended_actions = array();
if ( ! empty( $chromax_customizer_notify_recommended_actions ) ) {
foreach ( $chromax_customizer_notify_recommended_actions as $chromax_lite_customizer_notify_recommended_action ) {
if ( $chromax_lite_customizer_notify_recommended_action['id'] == $action_id ) {
$chromax_customizer_notify_show_recommended_actions[ $chromax_lite_customizer_notify_recommended_action['id'] ] = false;
} else {
$chromax_customizer_notify_show_recommended_actions[ $chromax_lite_customizer_notify_recommended_action['id'] ] = true;
}
}
update_option( 'chromax_customizer_notify_show', $chromax_customizer_notify_show_recommended_actions );
}
}
}
die();
}
public function chromax_customizer_notify_dismiss_recommended_plugins_callback() {
$action_id = ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0;
echo esc_html( $action_id ); /* this is needed and it's the id of the dismissable required action */
if ( ! empty( $action_id ) ) {
$chromax_lite_customizer_notify_show_recommended_plugins = get_option( 'chromax_customizer_notify_show_recommended_plugins' );
switch ( $_GET['todo'] ) {
case 'add':
$chromax_lite_customizer_notify_show_recommended_plugins[ $action_id ] = false;
break;
case 'dismiss':
$chromax_lite_customizer_notify_show_recommended_plugins[ $action_id ] = true;
break;
}
update_option( 'chromax_customizer_notify_show_recommended_plugins', $chromax_lite_customizer_notify_show_recommended_plugins );
}
die();
}
}

View File

@@ -0,0 +1,23 @@
<?php
/*
* Customizer Notifications
*/
require get_template_directory() . '/inc/customizer/customizer-plugin-notice/chromax-customizer-notify.php';
$chromax_config_customizer = array(
'recommended_plugins' => array(
'desert-companion' => array(
'recommended' => true,
'description' => sprintf(
/* translators: %s: plugin name */
esc_html__( 'If you want to show all the features and sections of the Theme. please install and activate %s plugin', 'chromax' ), '<strong>Desert Companion</strong>'
),
),
),
'recommended_actions' => array(),
'recommended_actions_title' => esc_html__( 'Recommended Actions', 'chromax' ),
'recommended_plugins_title' => esc_html__( 'Recommended Plugin', 'chromax' ),
'install_button_label' => esc_html__( 'Install and Activate', 'chromax' ),
'activate_button_label' => esc_html__( 'Activate', 'chromax' ),
'chromax_deactivate_button_label' => esc_html__( 'Deactivate', 'chromax' ),
);
Chromax_Customizer_Notify::init( apply_filters( 'chromax_customizer_notify_array', $chromax_config_customizer ) );

View File

@@ -0,0 +1,139 @@
.chromax-customizer-plugin-notify-actions-count {
display: inline-block;
z-index: 26;
margin: 1px 0 0 2px;
padding: 0 6px;
border-radius: 10px;
color: #fff;
background-color: #d54e21;
font-size: 9px;
font-weight: 600;
line-height: 17px;
vertical-align: top;
}
div.chromax-theme-recomended-actions_container {
margin-bottom: 2em;
padding: 0 10px;
}
.chromax-theme-recomended-actions_container p.succes {
margin: 1em 0;
}
.chromax-epsilon-recommeded-actions p.title {
margin-bottom: 0;
color: #555d66;
font-size: 14px;
font-weight: 600;
}
.chromax-epsilon-recommeded-actions div.description {
font-size: 12px;
}
.chromax-epsilon-recommeded-actions .custom-action {
margin-top: 1em;
padding-top: 1em;
border-top: 1px solid #fafafa;
}
.chromax-epsilon-recommeded-actions .custom-action p {
margin-top: 0;
}
.chromax-theme-recomended-actions_container .chromax-recommeded-actions-container:not(:first-child) {
overflow: hidden;
height: 0;
opacity: 0;
}
.chromax-theme-recomended-actions_container .chromax-recommeded-actions-container:first-child {
height: auto;
opacity: 1;
}
.chromax-theme-recomended-actions_container .chromax-recommeded-actions-container {
-webkit-transition: opacity 2s;
/* Safari */
transition: opacity 2s;
}
.chromax-theme-recomended-actions_container .hide {
display: none;
}
.chromax-customizer-plugin-notify-actions-count.complete {
background-color: #79ba49;
}
.chromax-theme-recomended-actions_container #demo_content .button {
display: block;
margin-bottom: 1em;
text-align: center;
}
.chromax-theme-recomended-actions_container .succes a {
display: inline-block;
width: 100%;
text-align: center;
}
.chromax-theme-recomended-actions_container .succes a.social {
width: 49%;
margin-bottom: 1em;
padding-top: 4px;
line-height: 20px;
}
.chromax-theme-recomended-actions_container .succes a.social span,
.chromax-theme-recomended-actions_container .succes span {
margin-right: 5px;
}
.chromax-theme-recomended-actions_container .succes {
padding-top: 4px;
line-height: 20px;
}
.chromax-customizer-notify-dismiss-button-recommended-plugin,
.chromax-customizer-notify-dismiss-recommended-action {
position: absolute;
top: 10px;
right: 10px;
border-radius: 50%;
color: #d54e21;
text-decoration: none;
cursor: pointer;
}
.chromax-epsilon-recommeded-actions {
position: relative;
}
.chromax-customizer-notify-dismiss-recommended-action,
.chromax-epsilon-recommeded-actions .chromax-customizer-notify-dismiss-button-recommended-plugin {
top: 0;
right: 0;
}
.chromax-epsilon-recommeded-actions #temp_load {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
-webkit-align-items: center;
align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
}
.chromax-epsilon-recommeded-actions #temp_load img {
margin: 0 auto;
}

View File

@@ -0,0 +1,180 @@
/**
* Customizer notification system
*/
(function (api) {
api.sectionConstructor['chromax-customizer-notify-section'] = api.Section.extend(
{
// No events for this type of section.
attachEvents: function () {
},
// Always make the section active.
isContextuallyActive: function () {
return true;
}
}
);
})( wp.customize );
jQuery( document ).ready(
function () {
jQuery( '.chromax-customizer-notify-dismiss-recommended-action' ).click(
function () {
var id = jQuery( this ).attr( 'id' ),
action = jQuery( this ).attr( 'data-action' );
jQuery.ajax(
{
type: 'GET',
data: {action: 'chromax_customizer_notify_dismiss_action', id: id, todo: action, nonce: chromaxCustomizercompanionObject.nonce},
dataType: 'html',
url: chromaxCustomizercompanionObject.ajaxurl,
beforeSend: function () {
jQuery( '#' + id ).parent().append( '<div id="temp_load" style="text-align:center"><img src="' + chromaxCustomizercompanionObject.base_path + '/images/spinner-2x.gif" /></div>' );
},
success: function (data) {
var container = jQuery( '#' + data ).parent().parent();
var index = container.next().data( 'index' );
var recommended_sction = jQuery( '#accordion-section-ti_customizer_notify_recomended_actions' );
var actions_count = recommended_sction.find( '.chromax-customizer-plugin-notify-actions-count' );
var section_title = recommended_sction.find( '.section-title' );
jQuery( '.chromax-customizer-plugin-notify-actions-count .current-index' ).text( index );
container.slideToggle().remove();
if (jQuery( '.chromax-theme-recomended-actions_container > .epsilon-recommended-actions' ).length === 0) {
actions_count.remove();
if (jQuery( '.chromax-theme-recomended-actions_container > .epsilon-recommended-plugins' ).length === 0) {
jQuery( '.control-section-ti-customizer-notify-recomended-actions' ).remove();
} else {
section_title.text( section_title.data( 'plugin_text' ) );
}
}
},
error: function (jqXHR, textStatus, errorThrown) {
console.log( jqXHR + ' :: ' + textStatus + ' :: ' + errorThrown );
}
}
);
}
);
jQuery( '.chromax-customizer-notify-dismiss-button-recommended-plugin' ).click(
function () {
var id = jQuery( this ).attr( 'id' ),
action = jQuery( this ).attr( 'data-action' );
jQuery.ajax(
{
type: 'GET',
data: {action: 'ti_customizer_notify_dismiss_recommended_plugins', id: id, todo: action, nonce: chromaxCustomizercompanionObject.nonce},
dataType: 'html',
url: chromaxCustomizercompanionObject.ajaxurl,
beforeSend: function () {
jQuery( '#' + id ).parent().append( '<div id="temp_load" style="text-align:center"><img src="' + chromaxCustomizercompanionObject.base_path + '/images/spinner-2x.gif" /></div>' );
},
success: function (data) {
var container = jQuery( '#' + data ).parent().parent();
var index = container.next().data( 'index' );
jQuery( '.chromax-customizer-plugin-notify-actions-count .current-index' ).text( index );
container.slideToggle().remove();
if (jQuery( '.chromax-theme-recomended-actions_container > .epsilon-recommended-plugins' ).length === 0) {
jQuery( '.control-section-ti-customizer-notify-recomended-section' ).remove();
}
},
error: function (jqXHR, textStatus, errorThrown) {
console.log( jqXHR + ' :: ' + textStatus + ' :: ' + errorThrown );
}
}
);
}
);
// Remove activate button and replace with activation in progress button.
jQuery( document ).on(
'DOMNodeInserted','.activate-now', function () {
var activateButton = jQuery( '.activate-now' );
if (activateButton.length) {
var url = jQuery( activateButton ).attr( 'href' );
if (typeof url !== 'undefined') {
// Request plugin activation.
jQuery.ajax(
{
beforeSend: function () {
jQuery( activateButton ).replaceWith( '<a class="button updating-message">' + chromaxCustomizercompanionObject.activating_string + '...</a>' );
},
async: true,
type: 'GET',
url: url,
success: function () {
// Reload the page.
location.reload();
}
}
);
}
}
}
);
}
);
/**
* Remove activate button and replace with activation in progress button.
*
* @package chromax
*/
jQuery( document ).ready(
function ($) {
$( 'body' ).on(
'click', ' .chromax-install-plugin ', function () {
var slug = $( this ).attr( 'data-slug' );
wp.updates.installPlugin(
{
slug: slug
}
);
return false;
}
);
$( '.activate-now' ).on(
'click', function (e) {
var activateButton = $( this );
e.preventDefault();
if ($( activateButton ).length) {
var url = $( activateButton ).attr( 'href' );
if (typeof url !== 'undefined') {
// Request plugin activation.
$.ajax(
{
beforeSend: function () {
$( activateButton ).replaceWith( '<a class="button updating-message">'+"activating"+'...</a>' );
},
async: true,
type: 'GET',
url: url,
success: function () {
// Reload the page.
location.reload();
}
}
);
}
}
}
);
}
);

View File

@@ -0,0 +1,239 @@
<?php
function chromax_footer_customize_settings( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
// Footer Section Panel //
$wp_customize->add_panel(
'footer_options',
array(
'priority' => 34,
'capability' => 'edit_theme_options',
'title' => __('Footer Options', 'chromax'),
)
);
/*=========================================
Footer Widget
=========================================*/
$wp_customize->add_section(
'chromax_footer_widget',
array(
'title' => __('Footer Widget','chromax'),
'panel' => 'footer_options',
'priority' => 3,
)
);
// Heading
$wp_customize->add_setting(
'chromax_footer_mid_head'
,array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_text',
)
);
$wp_customize->add_control(
'chromax_footer_mid_head',
array(
'type' => 'hidden',
'label' => __('Footer Middle','chromax'),
'section' => 'chromax_footer_widget',
'priority' => 1,
)
);
// Title //
$wp_customize->add_setting(
'chromax_footer_mid_ttl',
array(
'default' => __('LETS GET In TOUCH','chromax'),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_html',
'transport' => $selective_refresh
)
);
$wp_customize->add_control(
'chromax_footer_mid_ttl',
array(
'label' => __('Title','chromax'),
'section' => 'chromax_footer_widget',
'type' => 'text',
'priority' => 1,
)
);
// Button Link //
$wp_customize->add_setting(
'chromax_footer_mid_link',
array(
'default' => '#',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_url',
)
);
$wp_customize->add_control(
'chromax_footer_mid_link',
array(
'label' => __('Button Link','chromax'),
'section' => 'chromax_footer_widget',
'type' => 'text',
'priority' => 1,
)
);
// Open New Tab
$wp_customize->add_setting(
'chromax_footer_mid_target' ,
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_checkbox',
)
);
$wp_customize->add_control(
'chromax_footer_mid_target',
array(
'label' => esc_html__( 'Open in New Tab ?', 'chromax' ),
'section' => 'chromax_footer_widget',
'type' => 'checkbox',
'priority' => 1,
)
);
// Heading
$wp_customize->add_setting(
'chromax_footer_widget_head'
,array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_text',
)
);
$wp_customize->add_control(
'chromax_footer_widget_head',
array(
'type' => 'hidden',
'label' => __('Footer Widget','chromax'),
'section' => 'chromax_footer_widget',
'priority' => 1,
)
);
// column //
$wp_customize->add_setting(
'chromax_footer_widget_column',
array(
'default' => '4',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_select',
'priority' => 3,
)
);
$wp_customize->add_control(
'chromax_footer_widget_column',
array(
'label' => __('Select Widget Column','chromax'),
'section' => 'chromax_footer_widget',
'type' => 'select',
'choices' =>
array(
'' => __( 'None', 'chromax' ),
'1' => __( '1 Column', 'chromax' ),
'2' => __( '2 Column', 'chromax' ),
'3' => __( '3 Column', 'chromax' ),
'4' => __( '4 Column', 'chromax' )
)
)
);
/*=========================================
Footer Copright
=========================================*/
$wp_customize->add_section(
'chromax_footer_copyright',
array(
'title' => __('Footer Copright','chromax'),
'panel' => 'footer_options',
'priority' => 4,
)
);
// Heading
$wp_customize->add_setting(
'chromax_footer_copyright_first_head'
,array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_text',
)
);
$wp_customize->add_control(
'chromax_footer_copyright_first_head',
array(
'type' => 'hidden',
'label' => __('Copyright','chromax'),
'section' => 'chromax_footer_copyright',
'priority' => 3,
)
);
// footer third text //
$chromax_copyright = esc_html__('Copyright &copy; [current_year] [site_title] | Powered by [theme_author]', 'chromax' );
$wp_customize->add_setting(
'chromax_footer_copyright_text',
array(
'default' => $chromax_copyright,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_html',
)
);
$wp_customize->add_control(
'chromax_footer_copyright_text',
array(
'label' => __('Copyright','chromax'),
'section' => 'chromax_footer_copyright',
'type' => 'textarea',
'priority' => 4,
)
);
/*=========================================
Footer Background
=========================================*/
$wp_customize->add_section(
'footer_background_options',
array(
'title' => __('Footer Background','chromax'),
'panel' => 'footer_options',
'priority' => 4,
)
);
// Footer Background Color
$wp_customize->add_setting(
'chromax_footer_bg_color',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_hex_color',
'default' => '#222222'
));
$wp_customize->add_control(
new WP_Customize_Color_Control
($wp_customize,
'chromax_footer_bg_color',
array(
'label' => __( 'Footer Background Color', 'chromax' ),
'section' => 'footer_background_options',
)
)
);
}
add_action( 'customize_register', 'chromax_footer_customize_settings' );

View File

@@ -0,0 +1,561 @@
<?php
function chromax_typography_customize( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
$wp_customize->add_panel(
'chromax_typography_options', array(
'priority' => 38,
'title' => esc_html__( 'Typography', 'chromax' ),
)
);
/*=========================================
chromax Typography
=========================================*/
$wp_customize->add_section(
'chromax_typography_options',
array(
'priority' => 1,
'title' => __('Body Typography','chromax'),
'panel' => 'chromax_typography_options',
)
);
// Body Font Size //
if ( class_exists( 'chromax_Customizer_Range_Control' ) ) {
$wp_customize->add_setting(
'chromax_body_font_size_option',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_range_value',
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
new chromax_Customizer_Range_Control( $wp_customize, 'chromax_body_font_size_option',
array(
'label' => __( 'Size', 'chromax' ),
'section' => 'chromax_typography_options',
'priority' => 2,
'media_query' => true,
'input_attr' => array(
'mobile' => array(
'min' => 1,
'max' => 50,
'step' => 1,
'default_value' => 16,
),
'tablet' => array(
'min' => 0,
'max' => 50,
'step' => 1,
'default_value' => 16,
),
'desktop' => array(
'min' => 0,
'max' => 50,
'step' => 1,
'default_value' => 16,
),
),
) )
);
}
// Body Font Size //
if ( class_exists( 'chromax_Customizer_Range_Control' ) ) {
$wp_customize->add_setting(
'chromax_body_line_height_option',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_range_value',
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
new chromax_Customizer_Range_Control( $wp_customize, 'chromax_body_line_height_option',
array(
'label' => __( 'Line Height', 'chromax' ),
'section' => 'chromax_typography_options',
'priority' => 3,
'media_query' => true,
'input_attr' => array(
'mobile' => array(
'min' => 0,
'max' => 3,
'step' => 0.1,
'default_value' => 1.6,
),
'tablet' => array(
'min' => 0,
'max' => 3,
'step' => 0.1,
'default_value' => 1.6,
),
'desktop' => array(
'min' => 0,
'max' => 3,
'step' => 0.1,
'default_value' => 1.6,
),
)
) )
);
}
// Body Font Size //
if ( class_exists( 'chromax_Customizer_Range_Control' ) ) {
$wp_customize->add_setting(
'chromax_body_ltr_space_option',
array(
'default' => '0.1',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_range_value',
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
new chromax_Customizer_Range_Control( $wp_customize, 'chromax_body_ltr_space_option',
array(
'label' => __( 'Letter Spacing', 'chromax' ),
'section' => 'chromax_typography_options',
'priority' => 4,
'media_query' => true,
'input_attr' => array(
'mobile' => array(
'min' => -10,
'max' => 10,
'step' => 1,
'default_value' => 0,
),
'tablet' => array(
'min' => -10,
'max' => 10,
'step' => 1,
'default_value' => 0,
),
'desktop' => array(
'min' => -10,
'max' => 10,
'step' => 1,
'default_value' => 0,
),
)
) )
);
}
// Body Font weight //
$wp_customize->add_setting( 'chromax_body_font_weight_option', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'chromax_sanitize_select',
) );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'chromax_body_font_weight_option', array(
'label' => __( 'Weight', 'chromax' ),
'section' => 'chromax_typography_options',
'type' => 'select',
'priority' => 5,
'choices' => array(
'inherit' => __( 'Default', 'chromax' ),
'100' => __( 'Thin: 100', 'chromax' ),
'200' => __( 'Light: 200', 'chromax' ),
'300' => __( 'Book: 300', 'chromax' ),
'400' => __( 'Normal: 400', 'chromax' ),
'500' => __( 'Medium: 500', 'chromax' ),
'600' => __( 'Semibold: 600', 'chromax' ),
'700' => __( 'Bold: 700', 'chromax' ),
'800' => __( 'Extra Bold: 800', 'chromax' ),
'900' => __( 'Black: 900', 'chromax' ),
),
)
)
);
// Body Font style //
$wp_customize->add_setting( 'chromax_body_font_style_option', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'chromax_sanitize_select',
) );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'chromax_body_font_style_option', array(
'label' => __( 'Font Style', 'chromax' ),
'section' => 'chromax_typography_options',
'type' => 'select',
'priority' => 6,
'choices' => array(
'inherit' => __( 'Inherit', 'chromax' ),
'normal' => __( 'Normal', 'chromax' ),
'italic' => __( 'Italic', 'chromax' ),
'oblique' => __( 'oblique', 'chromax' ),
),
)
)
);
// Body Text Transform //
$wp_customize->add_setting( 'chromax_body_text_transform_option', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'chromax_sanitize_select',
) );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'chromax_body_text_transform_option', array(
'label' => __( 'Transform', 'chromax' ),
'section' => 'chromax_typography_options',
'type' => 'select',
'priority' => 7,
'choices' => array(
'inherit' => __( 'Default', 'chromax' ),
'uppercase' => __( 'Uppercase', 'chromax' ),
'lowercase' => __( 'Lowercase', 'chromax' ),
'capitalize' => __( 'Capitalize', 'chromax' ),
),
)
)
);
// Body Text Decoration //
$wp_customize->add_setting( 'chromax_body_txt_decoration_option', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'chromax_sanitize_select',
) );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'chromax_body_txt_decoration_option', array(
'label' => __( 'Text Decoration', 'chromax' ),
'section' => 'chromax_typography_options',
'type' => 'select',
'priority' => 8,
'choices' => array(
'inherit' => __( 'Inherit', 'chromax' ),
'underline' => __( 'Underline', 'chromax' ),
'overline' => __( 'Overline', 'chromax' ),
'line-through' => __( 'Line Through', 'chromax' ),
'none' => __( 'None', 'chromax' ),
),
)
)
);
// Upgrade
if ( class_exists( 'Desert_Companion_Customize_Upgrade_Control' ) ) {
$wp_customize->add_setting(
'chromax_body_typography_option_upsale',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
new Desert_Companion_Customize_Upgrade_Control
($wp_customize,
'chromax_body_typography_option_upsale',
array(
'label' => __( 'Typography Features', 'chromax' ),
'section' => 'chromax_typography_options',
'priority' => 8,
)
)
);
}
/*=========================================
chromax Typography Headings
=========================================*/
$wp_customize->add_section(
'chromax_headings_typography',
array(
'priority' => 2,
'title' => __('Headings (H1-H6) Typography','chromax'),
'panel' => 'chromax_typography_options',
)
);
/*=========================================
chromax Typography H1
=========================================*/
for ( $i = 1; $i <= 6; $i++ ) {
if($i == '1'){$j=36;}elseif($i == '2'){$j=32;}elseif($i == '3'){$j=28;}elseif($i == '4'){$j=24;}elseif($i == '5'){$j=20;}else{$j=16;}
$wp_customize->add_setting(
'h' . $i . '_typography'
,array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_text',
)
);
$wp_customize->add_control(
'h' . $i . '_typography',
array(
'type' => 'hidden',
'label' => esc_html('H' . $i .' Typography','chromax'),
'section' => 'chromax_headings_typography',
)
);
// Heading Font Size //
if ( class_exists( 'chromax_Customizer_Range_Control' ) ) {
$wp_customize->add_setting(
'chromax_h' . $i . '_font_size_option',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_range_value',
'transport' => 'postMessage'
)
);
$wp_customize->add_control(
new chromax_Customizer_Range_Control( $wp_customize, 'chromax_h' . $i . '_font_size_option',
array(
'label' => __( 'Font Size', 'chromax' ),
'section' => 'chromax_headings_typography',
'media_query' => true,
'input_attr' => array(
'mobile' => array(
'min' => 1,
'max' => 100,
'step' => 1,
'default_value' => $j,
),
'tablet' => array(
'min' => 1,
'max' => 100,
'step' => 1,
'default_value' => $j,
),
'desktop' => array(
'min' => 1,
'max' => 100,
'step' => 1,
'default_value' => $j,
),
)
) )
);
}
// Heading Font Size //
if ( class_exists( 'chromax_Customizer_Range_Control' ) ) {
$wp_customize->add_setting(
'chromax_h' . $i . '_line_height_option',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_range_value',
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
new chromax_Customizer_Range_Control( $wp_customize, 'chromax_h' . $i . '_line_height_option',
array(
'label' => __( 'Line Height', 'chromax' ),
'section' => 'chromax_headings_typography',
'media_query' => true,
'input_attrs' => array(
'min' => 0,
'max' => 5,
'step' => 0.1,
//'suffix' => 'px', //optional suffix
),
'input_attr' => array(
'mobile' => array(
'min' => 0,
'max' => 3,
'step' => 0.1,
'default_value' => 1.2,
),
'tablet' => array(
'min' => 0,
'max' => 3,
'step' => 0.1,
'default_value' => 1.2,
),
'desktop' => array(
'min' => 0,
'max' => 3,
'step' => 0.1,
'default_value' => 1.2,
),
)
) )
);
}
// Heading Letter Spacing //
if ( class_exists( 'chromax_Customizer_Range_Control' ) ) {
$wp_customize->add_setting(
'chromax_h' . $i . '_ltr_space_option',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'chromax_sanitize_range_value',
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
new chromax_Customizer_Range_Control( $wp_customize, 'chromax_h' . $i . '_ltr_space_option',
array(
'label' => __( 'Letter Spacing', 'chromax' ),
'section' => 'chromax_headings_typography',
'media_query' => true,
'input_attr' => array(
'mobile' => array(
'min' => -10,
'max' => 10,
'step' => 1,
'default_value' => 0.1,
),
'tablet' => array(
'min' => -10,
'max' => 10,
'step' => 1,
'default_value' => 0.1,
),
'desktop' => array(
'min' => -10,
'max' => 10,
'step' => 1,
'default_value' => 0.1,
),
)
) )
);
}
// Heading Font weight //
$wp_customize->add_setting( 'chromax_h' . $i . '_font_weight_option', array(
'capability' => 'edit_theme_options',
'default' => '700',
'transport' => 'postMessage',
'sanitize_callback' => 'chromax_sanitize_select',
) );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'chromax_h' . $i . '_font_weight_option', array(
'label' => __( 'Font Weight', 'chromax' ),
'section' => 'chromax_headings_typography',
'type' => 'select',
'choices' => array(
'inherit' => __( 'Inherit', 'chromax' ),
'100' => __( 'Thin: 100', 'chromax' ),
'200' => __( 'Light: 200', 'chromax' ),
'300' => __( 'Book: 300', 'chromax' ),
'400' => __( 'Normal: 400', 'chromax' ),
'500' => __( 'Medium: 500', 'chromax' ),
'600' => __( 'Semibold: 600', 'chromax' ),
'700' => __( 'Bold: 700', 'chromax' ),
'800' => __( 'Extra Bold: 800', 'chromax' ),
'900' => __( 'Black: 900', 'chromax' ),
),
)
)
);
// Heading Font style //
$wp_customize->add_setting( 'chromax_h' . $i . '_font_style_option', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'chromax_sanitize_select',
) );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'chromax_h' . $i . '_font_style_option', array(
'label' => __( 'Font Style', 'chromax' ),
'section' => 'chromax_headings_typography',
'type' => 'select',
'choices' => array(
'inherit' => __( 'Inherit', 'chromax' ),
'normal' => __( 'Normal', 'chromax' ),
'italic' => __( 'Italic', 'chromax' ),
'oblique' => __( 'oblique', 'chromax' ),
),
)
)
);
// Heading Text Transform //
$wp_customize->add_setting( 'chromax_h' . $i . '_text_transform_option', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'chromax_sanitize_select',
) );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'chromax_h' . $i . '_text_transform_option', array(
'label' => __( 'Text Transform', 'chromax' ),
'section' => 'chromax_headings_typography',
'type' => 'select',
'choices' => array(
'inherit' => __( 'Default', 'chromax' ),
'uppercase' => __( 'Uppercase', 'chromax' ),
'lowercase' => __( 'Lowercase', 'chromax' ),
'capitalize' => __( 'Capitalize', 'chromax' ),
),
)
)
);
// Heading Text Decoration //
$wp_customize->add_setting( 'chromax_h' . $i . '_txt_decoration_option', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'chromax_sanitize_select',
) );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'chromax_h' . $i . '_txt_decoration_option', array(
'label' => __( 'Text Decoration', 'chromax' ),
'section' => 'chromax_headings_typography',
'type' => 'select',
'choices' => array(
'inherit' => __( 'Inherit', 'chromax' ),
'underline' => __( 'Underline', 'chromax' ),
'overline' => __( 'Overline', 'chromax' ),
'line-through' => __( 'Line Through', 'chromax' ),
'none' => __( 'None', 'chromax' ),
),
)
)
);
// Upgrade
if ( class_exists( 'Desert_Companion_Customize_Upgrade_Control' ) ) {
$wp_customize->add_setting(
'chromax_h' . $i . '_typography_option_upsale',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
new Desert_Companion_Customize_Upgrade_Control
($wp_customize,
'chromax_h' . $i . '_typography_option_upsale',
array(
'label' => __( 'Typography Features', 'chromax' ),
'section' => 'chromax_headings_typography',
)
)
);
}
}
}
add_action( 'customize_register', 'chromax_typography_customize' );

View File

@@ -0,0 +1,107 @@
<?php
/**
* Customizer: Sanitization Callbacks
*
* This file demonstrates how to define sanitization callback functions for various data types.
*
* @package Chromax
* @copyright Copyright (c) 2015, WordPress Theme Review Team
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer)
*/
/**
* Checkbox sanitization callback example.
*
* Sanitization callback for 'checkbox' type controls. This callback sanitizes `$checked`
* as a boolean value, either TRUE or FALSE.
*
* @param bool $checked Whether the checkbox is checked.
* @return bool Whether the checkbox is checked.
*/
function chromax_sanitize_checkbox( $checked ) {
// Boolean check.
return ( ( isset( $checked ) && true == $checked ) ? true : false );
}
/**
* HTML sanitization callback example.
*
* - Sanitization: html
* - Control: text, textarea
*
* Sanitization callback for 'html' type text inputs. This callback sanitizes `$html`
* for HTML allowable in posts.
*
* NOTE: wp_filter_post_kses() can be passed directly as `$wp_customize->add_setting()`
* 'sanitize_callback'. It is wrapped in a callback here merely for example purposes.
*
* @see wp_filter_post_kses() https://developer.wordpress.org/reference/functions/wp_filter_post_kses/
*
* @param string $html HTML to sanitize.
* @return string Sanitized HTML.
*/
function chromax_sanitize_html( $html ) {
return wp_kses_post( force_balance_tags( $html ) );
}
/**
* Select sanitization callback example.
*
* - Sanitization: select
* - Control: select, radio
*
* Sanitization callback for 'select' and 'radio' type controls. This callback sanitizes `$input`
* as a slug, and then validates `$input` against the choices defined for the control.
*
* @see sanitize_key() https://developer.wordpress.org/reference/functions/sanitize_key/
* @see $wp_customize->get_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/get_control/
*
* @param string $input Slug to sanitize.
* @param WP_Customize_Setting $setting Setting instance.
* @return string Sanitized slug if it is a valid choice; otherwise, the setting default.
*/
function chromax_sanitize_select( $input, $setting ) {
// Ensure input is a slug.
$input = sanitize_key( $input );
// Get list of choices from the control associated with the setting.
$choices = $setting->manager->get_control( $setting->id )->choices;
// If the input is a valid key, return it; otherwise, return the default.
return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
}
/**
* URL sanitization callback example.
*
* - Sanitization: url
* - Control: text, url
*
* Sanitization callback for 'url' type text inputs. This callback sanitizes `$url` as a valid URL.
*
* NOTE: esc_url_raw() can be passed directly as `$wp_customize->add_setting()` 'sanitize_callback'.
* It is wrapped in a callback here merely for example purposes.
*
* @see esc_url_raw() https://developer.wordpress.org/reference/functions/esc_url_raw/
*
* @param string $url URL to sanitize.
* @return string Sanitized URL.
*/
function chromax_sanitize_url( $url ) {
return esc_url_raw( $url );
}
/* Sanitization Text*/
function chromax_sanitize_text( $text ) {
return wp_filter_post_kses( $text );
}
/* Sanitization Integer*/
function chromax_sanitize_integer( $input ) {
if( is_numeric( $input ) ) {
return intval( $input );
}
}