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,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
}
}