Cleanup: Remoción masiva de restos de WordPress y consolidación de archivos GKACHELE™
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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%;
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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 -->
|
||||
@@ -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 = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
'\'': ''',
|
||||
'/': '/'
|
||||
};
|
||||
|
||||
function chromaxescapeHtml(string) {
|
||||
'use strict';
|
||||
//noinspection JSUnresolvedFunction
|
||||
string = String(string).replace(new RegExp('\r?\n', 'g'), '<br />');
|
||||
string = String(string).replace(/\\/g, '\');
|
||||
return String(string).replace(/[&<>"'\/]/g, function (s) {
|
||||
return chromaxentityMap[s];
|
||||
});
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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' );
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -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 );
|
||||
@@ -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();
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
/* Range */
|
||||
.range-slider__range:active::-moz-range-thumb {
|
||||
background: #0085ba;
|
||||
}
|
||||
|
||||
.customize-control input[type=number].range-slider-value {
|
||||
width: 21%;
|
||||
height: 28px;
|
||||
text-align: center;
|
||||
margin-left: 2%;
|
||||
border-radius: 4px;
|
||||
padding: 3px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: #555;
|
||||
-moz-appearance: textfield;
|
||||
|
||||
}
|
||||
|
||||
.customize-control input[type=number].range-slider-value::-webkit-outer-spin-button,
|
||||
.customize-control input[type=number].range-slider-value::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
.customize-control input[type=number].range-slider-value {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.range-reset-slider .dashicons{
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.customize-control span.range-reset-slider {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 6%;
|
||||
line-height: 1;
|
||||
color: rgba(0,0,0,.2);
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
transition: all .3s ease;
|
||||
-webkit-transition: all .3s ease;
|
||||
-moz-transition: all .3s ease;
|
||||
-o-transition: all .3s ease;
|
||||
-ms-transition: all .3s ease;
|
||||
}
|
||||
|
||||
.range-slider {
|
||||
width: 100%;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.range-slider__range {
|
||||
background-color: rgba(0,0,0,.1);
|
||||
height: 5px;
|
||||
width: 67% !important;
|
||||
padding: 0;
|
||||
margin-bottom: 0;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
-webkit-transition: background .5s;
|
||||
-moz-transition: background .5s;
|
||||
transition: background .5s;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
.range-slider__range::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border: none;
|
||||
border-radius: 15px;
|
||||
background-color: #2e86b9;
|
||||
}
|
||||
|
||||
.range-slider__range::-webkit-slider-thumb:hover {
|
||||
background: #0085ba;
|
||||
}
|
||||
|
||||
.range-slider__range:active::-webkit-slider-thumb {
|
||||
background: #0085ba;
|
||||
}
|
||||
|
||||
.range-slider__range::-moz-range-thumb {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 0;
|
||||
border-radius: 50%;
|
||||
background: #0085ba;
|
||||
cursor: pointer;
|
||||
-webkit-transition: background .15s ease-in-out;
|
||||
transition: background .15s ease-in-out;
|
||||
}
|
||||
|
||||
.range-slider__range::-moz-range-thumb:hover {
|
||||
background: #0085ba;
|
||||
}
|
||||
|
||||
.customize-control span.range-reset-slider:hover {
|
||||
color: #fe5252;
|
||||
}
|
||||
|
||||
::-moz-range-track {
|
||||
background: #d7dcdf;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
input::-moz-focus-inner, input::-moz-focus-outer {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.customize-control-range-value .customize-control-title,
|
||||
.customize-control-range-value .responsive-switchers{
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.responsive-switchers{
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.responsive-switchers .preview-tablet,
|
||||
.responsive-switchers .preview-mobile{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.desktop-range,
|
||||
.tablet-range,
|
||||
.mobile-range{
|
||||
display: none;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.desktop-range.active,
|
||||
.tablet-range.active,
|
||||
.mobile-range.active{
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control .responsive-switchers { margin-left: 5px; width: auto; }
|
||||
.customize-control .responsive-switchers-open li button { display: block; }
|
||||
.customize-control .responsive-switchers li { float: left; margin: 0; }
|
||||
.customize-control .responsive-switchers li button { height: 20px; width: 20px; background-color: #a4afb7; cursor: pointer; position: relative; margin-left: 5px; color: #fff; font-size: 10px; text-align: center; border-radius: 50%; padding: 0; border: 0; outline: none; -webkit-transition: background-color .5s; transition: background-color .5s; cursor: pointer; }
|
||||
.customize-control .responsive-switchers li button:hover { background-color: #c2cbd2; }
|
||||
.customize-control .responsive-switchers li button.active { background-color: #13aff0; }
|
||||
.customize-control .responsive-switchers li button i { width: auto; height: auto; font-size: inherit; line-height: 18px; }
|
||||
|
||||
.customize-control-hidden {
|
||||
display: list-item;
|
||||
margin-left: -12px;
|
||||
margin-right: -12px;
|
||||
padding: 7px 15px;
|
||||
background: #FFF;
|
||||
border-left: 8px solid #0073aa;
|
||||
border-right: 8px solid #0073aa;
|
||||
max-width: -webkit-fill-available;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.customize-control-hidden label {
|
||||
margin-bottom: 0;
|
||||
line-height: 2;
|
||||
font-size: 1em;
|
||||
cursor: default;
|
||||
color: #000;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Upsale */
|
||||
.control-section-chromax h3 {
|
||||
margin: 0;
|
||||
padding: 1px 0;
|
||||
border: 0;
|
||||
position: relative;
|
||||
}
|
||||
.control-section-chromax h3 a {
|
||||
background: #fff;
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
}
|
||||
li#accordion-section-chromax a {
|
||||
background: #f64a00;
|
||||
color: #fff;
|
||||
border-color: #f64a00;
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
li#accordion-section-chromax h3 {
|
||||
background: #f64a00 !important;
|
||||
}
|
||||
|
||||
|
||||
li#customize-control-chromax_sidebar_option_upsale .desert-companion-upgrade-message,
|
||||
li#customize-control-chromax_body_typography_option_upsale .desert-companion-upgrade-message,
|
||||
#sub-accordion-section-chromax_headings_typography .desert-companion-upgrade-message,
|
||||
li#customize-control-chromax_blog_option_upsale .desert-companion-upgrade-message{
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
li#accordion-panel-chromax_typography_options {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selector-category select,
|
||||
.customize-control .icons-selector .selector-search input[type=text] {
|
||||
line-height: 13px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector,
|
||||
.customize-control .icons-selector .selector {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selector {
|
||||
border: 1px solid #8c8f94;
|
||||
border-radius: 3px;
|
||||
height: 30px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selected-icon {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selected-icon i {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selector-button {
|
||||
width: 28%;
|
||||
border-left: 1px solid #8c8f94;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selector-button i {
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selector-popup {
|
||||
padding: 12px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selector-arrows span,
|
||||
.customize-control .icons-selector .fip-box,
|
||||
.customize-control .icons-selector .selector-category select,
|
||||
.customize-control .icons-selector .selector-search input[type=text] {
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selector-pages {
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selector-search i {
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selector-arrows span i {
|
||||
width: auto;
|
||||
height: auto;
|
||||
line-height: 12px;
|
||||
}
|
||||
|
||||
.customize-control .icons-selector .selector-arrows span:hover i,
|
||||
.customize-control .icons-selector .fip-box:hover {
|
||||
color: #0073aa;
|
||||
}
|
||||
188
gk-assets/themes/chromax/inc/customizer/controls/js/controls.js
vendored
Normal file
188
gk-assets/themes/chromax/inc/customizer/controls/js/controls.js
vendored
Normal file
@@ -0,0 +1,188 @@
|
||||
/* Range */
|
||||
wp.customize.controlConstructor['range-value'] = wp.customize.Control.extend({
|
||||
|
||||
ready: function(){
|
||||
'use strict';
|
||||
|
||||
jQuery.fn.exists = function(){return this.length>0;};
|
||||
var control = this,
|
||||
changeAction;
|
||||
var theme_controls = jQuery('#customize-theme-controls');
|
||||
|
||||
function syncRangeText( slider, input, from ){
|
||||
switch (from){
|
||||
case 'slider':
|
||||
input.val( slider.val());
|
||||
break;
|
||||
case 'input':
|
||||
slider.val( input.val() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function updateValues( control ){
|
||||
var collector = control.find('.range-collector');
|
||||
var values = getSliderValues( control );
|
||||
var have_queries = Object.keys(values).length > 1;
|
||||
if( have_queries ){
|
||||
collector.val(JSON.stringify(values));
|
||||
} else {
|
||||
collector.val(values.desktop);
|
||||
}
|
||||
collector.trigger( 'change' );
|
||||
|
||||
}
|
||||
|
||||
function getSliderValues( control ) {
|
||||
var values = {};
|
||||
var desktopSelector = control.find('.range-slider__range[data-query="desktop"]'),
|
||||
tabletSelector = control.find('.range-slider__range[data-query="tablet"]') ,
|
||||
mobileSelector = control.find('.range-slider__range[data-query="mobile"]'),
|
||||
desktopValue, tabletValue, mobileValue;
|
||||
|
||||
if( desktopSelector.exists() ){
|
||||
desktopValue = desktopSelector.val();
|
||||
if( desktopValue !== 'undefined' && desktopValue !== '' ){
|
||||
values.desktop = desktopValue;
|
||||
}
|
||||
}
|
||||
|
||||
if( tabletSelector.exists() ){
|
||||
tabletValue = tabletSelector.val();
|
||||
if( tabletValue !== 'undefined' && tabletValue !== '' ){
|
||||
values.tablet = tabletValue;
|
||||
}
|
||||
}
|
||||
|
||||
if( mobileSelector.exists() ){
|
||||
mobileValue = mobileSelector.val();
|
||||
if( mobileValue !== 'undefined' && mobileValue !== '' ){
|
||||
values.mobile = mobileValue;
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
function responsiveSwitcher(){
|
||||
// Responsive switchers
|
||||
jQuery( '.customize-control .responsive-switchers button' ).on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
// Set up variables
|
||||
var $devices = jQuery( '.responsive-switchers' ),
|
||||
$device = jQuery( event.currentTarget ).data( 'device' ),
|
||||
$body = jQuery( '.wp-full-overlay' ),
|
||||
$footer_devices = jQuery( '.wp-full-overlay-footer .devices' );
|
||||
|
||||
// Button class
|
||||
$devices.find( 'button' ).removeClass( 'active' );
|
||||
$devices.find( 'button.preview-' + $device ).addClass( 'active' );
|
||||
|
||||
var control = jQuery('.range-slider.has-media-queries');
|
||||
control.find('.desktop-range').removeClass('active');
|
||||
control.find('.tablet-range').removeClass('active');
|
||||
control.find('.mobile-range').removeClass('active');
|
||||
control.find('.' + $device + '-range').addClass('active');
|
||||
|
||||
// Wrapper class
|
||||
$body.removeClass( 'preview-desktop preview-tablet preview-mobile' ).addClass( 'preview-' + $device );
|
||||
|
||||
// Panel footer buttons
|
||||
$footer_devices.find( 'button' ).removeClass( 'active' ).attr( 'aria-pressed', false );
|
||||
$footer_devices.find( 'button.preview-' + $device ).addClass( 'active' ).attr( 'aria-pressed', true );
|
||||
|
||||
} );
|
||||
|
||||
jQuery('#customize-footer-actions .devices button').on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
var device = jQuery(this).data('device');
|
||||
var queries = jQuery( '.responsive-switchers' );
|
||||
|
||||
queries.find( 'button' ).removeClass( 'active' );
|
||||
queries.find( 'button.preview-' + device ).addClass( 'active' );
|
||||
|
||||
var control = jQuery('.range-slider.has-media-queries');
|
||||
control.find('.desktop-range').removeClass('active');
|
||||
control.find('.tablet-range').removeClass('active');
|
||||
control.find('.mobile-range').removeClass('active');
|
||||
control.find('.' + device + '-range').addClass('active');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
theme_controls.unbind().on('click', '.preview-desktop.active', function () {
|
||||
jQuery( this ).parent().parent().toggleClass( 'responsive-switchers-open' );
|
||||
});
|
||||
|
||||
theme_controls.on('input', '.range-slider__range', function () {
|
||||
var slider = jQuery(this);
|
||||
var input = jQuery(this).next();
|
||||
var control = jQuery(this).parent().parent();
|
||||
syncRangeText( slider, input, 'slider');
|
||||
updateValues( control );
|
||||
});
|
||||
|
||||
theme_controls.on('keyup', '.range-slider-value', function(){
|
||||
var control = jQuery(this).parent().parent();
|
||||
updateValues( control );
|
||||
});
|
||||
theme_controls.on('keydown', '.range-slider-value', function(){
|
||||
var slider = jQuery(this).prev();
|
||||
var input = jQuery(this);
|
||||
syncRangeText( slider, input, 'input');
|
||||
});
|
||||
|
||||
|
||||
theme_controls.on('click', '.range-reset-slider', function (event) {
|
||||
event.preventDefault();
|
||||
var input = jQuery(this).prev();
|
||||
var slider = input.prev();
|
||||
var control = jQuery(this).parent().parent();
|
||||
var defaultValue = slider.data('default');
|
||||
input.val( defaultValue );
|
||||
slider.val( defaultValue );
|
||||
updateValues( control );
|
||||
});
|
||||
|
||||
responsiveSwitcher();
|
||||
|
||||
if ( 'postMessage' === control.setting.transport ) {
|
||||
changeAction = 'mousemove change';
|
||||
} else {
|
||||
changeAction = 'change';
|
||||
}
|
||||
|
||||
// Change the value
|
||||
this.container.on( changeAction, '.range-collector', function() {
|
||||
control.setting.set( jQuery( this ).val() );
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/* Upsale */
|
||||
( function( api ) {
|
||||
|
||||
// Extends our custom "chromax" section.
|
||||
api.sectionConstructor['chromax'] = api.Section.extend( {
|
||||
|
||||
// No events for this type of section.
|
||||
attachEvents: function () {},
|
||||
|
||||
// Always make the section active.
|
||||
isContextuallyActive: function () {
|
||||
return true;
|
||||
}
|
||||
} );
|
||||
|
||||
} )( wp.customize );
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
jQuery("#sub-accordion-section-chromax_sidebar_options select:not(#_customize-input-chromax_default_pg_sidebar_option), #sub-accordion-section-chromax_typography_options select, #sub-accordion-section-chromax_headings_typography select").prop('disabled', true);
|
||||
});
|
||||
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
jQuery('.contact-icon-picker.iconPicker').fontIconPicker();
|
||||
});
|
||||
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
|
||||
<defs>
|
||||
<font id="iconpicker" horiz-adv-x="1000" >
|
||||
<font-face font-family="iconpicker" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
||||
<missing-glyph horiz-adv-x="1000" />
|
||||
<glyph glyph-name="spin3" unicode="" d="m494 850c-266 0-483-210-494-472c-1-19 13-20 13-20l84 0c16 0 19 10 19 18c10 199 176 358 378 358c107 0 205-45 273-118l-58-57c-11-12-11-27 5-31l247-50c21-5 46 11 37 44l-58 227c-2 9-16 22-29 13l-65-60c-89 91-214 148-352 148z m409-508c-16 0-19-10-19-18c-10-199-176-358-377-358c-108 0-205 45-274 118l59 57c10 12 10 27-5 31l-248 50c-21 5-46-11-37-44l58-227c2-9 16-22 30-13l64 60c89-91 214-148 353-148c265 0 482 210 493 473c1 18-13 19-13 19l-84 0z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="search" unicode="" d="m643 386q0 103-74 176t-176 74t-177-74t-73-176t73-177t177-73t176 73t74 177z m286-465q0-29-22-50t-50-21q-30 0-50 21l-191 191q-100-69-223-69q-80 0-153 31t-125 84t-84 125t-31 153t31 152t84 126t125 84t153 31t152-31t126-84t84-126t31-152q0-123-69-223l191-191q21-21 21-51z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="cancel" unicode="" d="m724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165l-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164l-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164l164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164l164-164q15-15 15-38z" horiz-adv-x="785.7" />
|
||||
<glyph glyph-name="block" unicode="" d="m732 352q0 90-48 164l-421-420q76-50 166-50q62 0 118 25t96 65t65 97t24 119z m-557-167l421 421q-75 50-167 50q-83 0-153-40t-110-112t-41-152q0-91 50-167z m682 167q0-88-34-168t-91-137t-137-92t-166-34t-167 34t-137 92t-91 137t-34 168t34 167t91 137t137 91t167 34t166-34t137-91t91-137t34-167z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="down-dir" unicode="" d="m571 457q0-14-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 11-11 25t11 25t25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
|
||||
<glyph glyph-name="up-dir" unicode="" d="m571 171q0-14-10-25t-25-10h-500q-15 0-25 10t-11 25t11 26l250 250q10 10 25 10t25-10l250-250q10-11 10-26z" horiz-adv-x="571.4" />
|
||||
<glyph glyph-name="left-dir" unicode="" d="m357 600v-500q0-14-10-25t-26-11t-25 11l-250 250q-10 11-10 25t10 25l250 250q11 11 25 11t26-11t10-25z" horiz-adv-x="357.1" />
|
||||
<glyph glyph-name="right-dir" unicode="" d="m321 350q0-14-10-25l-250-250q-11-11-25-11t-25 11t-11 25v500q0 15 11 25t25 11t25-11l250-250q10-10 10-25z" horiz-adv-x="357.1" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,328 @@
|
||||
/* fontIconPicker main CSS file {@link https://github.com/micc83/fontIconPicker} */
|
||||
|
||||
.icons-selector * {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
.icons-selector,
|
||||
.icons-selector *,
|
||||
.icons-selector :after,
|
||||
.icons-selector :before,
|
||||
.icons-selector:after,
|
||||
.icons-selector:before {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box
|
||||
}
|
||||
|
||||
.icons-selector {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
text-align: left
|
||||
}
|
||||
|
||||
.icons-selector .selector {
|
||||
width: 100px;
|
||||
height: 40px
|
||||
}
|
||||
|
||||
.icons-selector .selector-button {
|
||||
width: 39px;
|
||||
height: 100%;
|
||||
display: block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
float: left
|
||||
}
|
||||
|
||||
.icons-selector .selector-button i {
|
||||
line-height: 38px;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.icons-selector .selected-icon {
|
||||
display: block;
|
||||
width: 60px;
|
||||
height: 100%;
|
||||
float: left;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.icons-selector .selected-icon i {
|
||||
line-height: 40px;
|
||||
font-size: 18px;
|
||||
cursor: default
|
||||
}
|
||||
|
||||
.icons-selector .selector-popup {
|
||||
position: absolute;
|
||||
z-index: 10000;
|
||||
background-color: #fefefe;
|
||||
padding: 5px;
|
||||
height: auto;
|
||||
width: 342px;
|
||||
margin-top: -1px
|
||||
}
|
||||
|
||||
.icons-selector .selector-category select,
|
||||
.icons-selector .selector-search input[type=text] {
|
||||
border: 0;
|
||||
line-height: 20px;
|
||||
padding: 10px 2.5%;
|
||||
width: 100%;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 5px;
|
||||
font-size: 12px;
|
||||
display: block
|
||||
}
|
||||
|
||||
.icons-selector .selector-category select {
|
||||
height: 40px
|
||||
}
|
||||
|
||||
.icons-selector .selector-category select option {
|
||||
padding: 10px
|
||||
}
|
||||
|
||||
.icons-selector input::-webkit-input-placeholder {
|
||||
text-transform: uppercase
|
||||
}
|
||||
|
||||
.icons-selector input:-moz-placeholder {
|
||||
text-transform: uppercase
|
||||
}
|
||||
|
||||
.icons-selector input::-moz-placeholder {
|
||||
text-transform: uppercase
|
||||
}
|
||||
|
||||
.icons-selector input:-ms-input-placeholder {
|
||||
text-transform: uppercase
|
||||
}
|
||||
|
||||
.icons-selector .selector-search {
|
||||
position: relative
|
||||
}
|
||||
|
||||
.icons-selector .selector-search i {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 7px
|
||||
}
|
||||
|
||||
.icons-selector .fip-icons-container {
|
||||
width: 100%;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
padding: 5px
|
||||
}
|
||||
|
||||
.icons-selector .fip-icons-container .loading {
|
||||
font-size: 24px;
|
||||
margin: 0 auto;
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.icons-selector .fip-box {
|
||||
display: inline-block;
|
||||
margin: 2px;
|
||||
width: 60px;
|
||||
line-height: 42px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
vertical-align: top;
|
||||
height: 40px
|
||||
}
|
||||
|
||||
.icons-selector .selector-footer {
|
||||
line-height: 12px;
|
||||
padding: 5px 5px 0;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.icons-selector .selector-footer,
|
||||
.icons-selector .selector-footer i {
|
||||
font-size: 14px
|
||||
}
|
||||
|
||||
.icons-selector .selector-arrows {
|
||||
float: right
|
||||
}
|
||||
|
||||
.icons-selector .selector-pages {
|
||||
font-size: 11px;
|
||||
float: left
|
||||
}
|
||||
|
||||
.icons-selector .selector-arrows i {
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
.icons-selector .selector-footer em {
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
.icons-selector .icons-picker-error i:before {
|
||||
color: #eee
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: iconpicker;
|
||||
src: url(iconpicker.eot?90190138);
|
||||
src: url(iconpicker.eot?90190138#iefix) format('embedded-opentype'), url(iconpicker.woff?90190138) format('woff'), url(iconpicker.ttf?90190138) format('truetype'), url(iconpicker.svg?90190138#iconpicker) format('svg');
|
||||
font-weight: 400;
|
||||
font-style: normal
|
||||
}
|
||||
|
||||
.icons-selector [class*=" fip-icon-"]:before,
|
||||
.icons-selector [class^=fip-icon-]:before {
|
||||
font-family: iconpicker;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
speak: none;
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
width: 1em;
|
||||
margin-right: .2em;
|
||||
text-align: center;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1em;
|
||||
margin-left: .2em
|
||||
}
|
||||
|
||||
.icons-selector .fip-icon-search:before {
|
||||
content: '\e812';
|
||||
cursor: default
|
||||
}
|
||||
|
||||
.icons-selector .fip-icon-cancel:before {
|
||||
content: '\e814';
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
.icons-selector .fa-times-circle-o:before {
|
||||
color: #fed0d0;
|
||||
font-size: 18px;
|
||||
line-height: 1.85;
|
||||
}
|
||||
|
||||
.icons-selector .fip-icon-block:before {
|
||||
content: '\e84e';
|
||||
color: #fed0d0
|
||||
}
|
||||
|
||||
.icons-selector .fip-icon-down-dir:before {
|
||||
content: '\e800'
|
||||
}
|
||||
|
||||
.icons-selector .fip-icon-up-dir:before {
|
||||
content: '\e813'
|
||||
}
|
||||
|
||||
.icons-selector .fip-icon-left-dir:before {
|
||||
content: '\e801'
|
||||
}
|
||||
|
||||
.icons-selector .fip-icon-right-dir:before {
|
||||
content: '\e802'
|
||||
}
|
||||
|
||||
.icons-selector .fip-icon-spin3:before {
|
||||
content: '\e815'
|
||||
}
|
||||
|
||||
.icons-selector .fip-icon-spin3 {
|
||||
-moz-animation: spin 2s infinite linear;
|
||||
-o-animation: spin 2s infinite linear;
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
animation: spin 2s infinite linear;
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
@-moz-keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg)
|
||||
}
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
-o-transform: rotate(359deg);
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg)
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg)
|
||||
}
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
-o-transform: rotate(359deg);
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg)
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg)
|
||||
}
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
-o-transform: rotate(359deg);
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg)
|
||||
}
|
||||
}
|
||||
|
||||
@-ms-keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg)
|
||||
}
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
-o-transform: rotate(359deg);
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg)
|
||||
}
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
-o-transform: rotate(359deg);
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg)
|
||||
}
|
||||
}
|
||||
|
||||
.icons-selector .selector-popup {
|
||||
width: 280px;
|
||||
}
|
||||
@@ -0,0 +1,415 @@
|
||||
/**
|
||||
* jQuery fontIconPicker - v2.0.0
|
||||
*
|
||||
* An icon picker built on top of font icons and jQuery
|
||||
*
|
||||
* http://codeb.it/fontIconPicker
|
||||
*
|
||||
* Made by Alessandro Benoit & Swashata
|
||||
* Under MIT License
|
||||
*
|
||||
* {@link https://github.com/micc83/fontIconPicker}
|
||||
*/
|
||||
!(function(a) {
|
||||
"use strict";
|
||||
|
||||
function c(c, d) {
|
||||
(this.element = a(c)),
|
||||
(this.settings = a.extend({}, b, d)),
|
||||
this.settings.emptyIcon && this.settings.iconsPerPage--,
|
||||
(this.iconPicker = a("<div/>", {
|
||||
class: "icons-selector",
|
||||
style: "position: relative",
|
||||
html: '<div class="selector"><span class="selected-icon"><i class="fa-times-circle"></i></span><span class="selector-button"><i class="fip-icon-down-dir"></i></span></div><div class="selector-popup" style="display: none;">' +
|
||||
(this.settings.hasSearch ? '<div class="selector-search"><input type="text" name="" value="" placeholder="Search icon" class="icons-search-input"/><i class="fip-icon-search"></i></div>' : "") +
|
||||
'<div class="selector-category">' +
|
||||
'<select name="" class="icon-category-select" style="display: none">' +
|
||||
"</select>" +
|
||||
"</div>" +
|
||||
'<div class="fip-icons-container"></div>' +
|
||||
'<div class="selector-footer" style="display:none;">' +
|
||||
'<span class="selector-pages">1/2</span>' +
|
||||
'<span class="selector-arrows">' +
|
||||
'<span class="selector-arrow-left" style="display:none;">' +
|
||||
'<i class="fip-icon-left-dir"></i>' +
|
||||
"</span>" +
|
||||
'<span class="selector-arrow-right">' +
|
||||
'<i class="fip-icon-right-dir"></i>' +
|
||||
"</span>" +
|
||||
"</span>" +
|
||||
"</div>" +
|
||||
"</div>",
|
||||
})),
|
||||
(this.iconContainer = this.iconPicker.find(".fip-icons-container")),
|
||||
(this.searchIcon = this.iconPicker.find(".selector-search i")),
|
||||
(this.iconsSearched = []),
|
||||
(this.isSearch = !1),
|
||||
(this.totalPage = 1),
|
||||
(this.currentPage = 1),
|
||||
(this.currentIcon = !1),
|
||||
(this.iconsCount = 0),
|
||||
(this.open = !1),
|
||||
(this.searchValues = []),
|
||||
(this.availableCategoriesSearch = []),
|
||||
(this.triggerEvent = null),
|
||||
(this.backupSource = []),
|
||||
(this.backupSearch = []),
|
||||
(this.isCategorized = !1),
|
||||
(this.selectCategory = this.iconPicker.find(".icon-category-select")),
|
||||
(this.selectedCategory = !1),
|
||||
(this.availableCategories = []),
|
||||
(this.unCategorizedKey = null),
|
||||
this.init();
|
||||
}
|
||||
var b = {
|
||||
theme: "fip-grey",
|
||||
source: !1,
|
||||
emptyIcon: !0,
|
||||
emptyIconValue: "",
|
||||
iconsPerPage: 20,
|
||||
hasSearch: !0,
|
||||
searchSource: !1,
|
||||
useAttribute: !1,
|
||||
attributeName: "data-icon",
|
||||
convertToHex: !0,
|
||||
allCategoryText: "From all categories",
|
||||
unCategorizedText: "Uncategorized",
|
||||
};
|
||||
(c.prototype = {
|
||||
init: function() {
|
||||
this.iconPicker.addClass(this.settings.theme), this.iconPicker.css({
|
||||
left: -9999
|
||||
}).appendTo("body");
|
||||
var b = this.iconPicker.outerHeight(),
|
||||
c = this.iconPicker.outerWidth();
|
||||
if (
|
||||
(this.iconPicker.css({
|
||||
left: ""
|
||||
}),
|
||||
this.element.before(this.iconPicker),
|
||||
this.element.css({
|
||||
visibility: "hidden",
|
||||
top: 0,
|
||||
position: "relative",
|
||||
zIndex: "-1",
|
||||
left: "-" + c + "px",
|
||||
display: "inline-block",
|
||||
height: b + "px",
|
||||
width: c + "px",
|
||||
padding: "0",
|
||||
margin: "0 -" + c + "px 0 0",
|
||||
border: "0 none",
|
||||
verticalAlign: "top",
|
||||
}), !this.element.is("select"))
|
||||
) {
|
||||
var d = (function() {
|
||||
for (var a = 3, b = document.createElement("div"), c = b.all || [];
|
||||
(b.innerHTML = "<!--[if gt IE " + ++a + "]><br><![endif]-->"), c[0];);
|
||||
return a > 4 ? a : !a;
|
||||
})(),
|
||||
e = document.createElement("div");
|
||||
this.triggerEvent = 9 !== d && "oninput" in e ? ["input", "keyup"] : ["keyup"];
|
||||
}!this.settings.source && this.element.is("select") ?
|
||||
((this.settings.source = []),
|
||||
(this.settings.searchSource = []),
|
||||
this.element.find("optgroup").length ?
|
||||
((this.isCategorized = !0),
|
||||
this.element.find("optgroup").each(
|
||||
a.proxy(function(b, c) {
|
||||
var d = this.availableCategories.length,
|
||||
e = a("<option />");
|
||||
e.attr("value", d),
|
||||
e.html(a(c).attr("label")),
|
||||
this.selectCategory.append(e),
|
||||
(this.availableCategories[d] = []),
|
||||
(this.availableCategoriesSearch[d] = []),
|
||||
a(c)
|
||||
.find("option")
|
||||
.each(
|
||||
a.proxy(function(b, c) {
|
||||
var e = a(c).val(),
|
||||
f = a(c).html();
|
||||
e && e !== this.settings.emptyIconValue && (this.settings.source.push(e), this.availableCategories[d].push(e), this.searchValues.push(f), this.availableCategoriesSearch[d].push(f));
|
||||
}, this)
|
||||
);
|
||||
}, this)
|
||||
),
|
||||
this.element.find("> option").length &&
|
||||
this.element.find("> option").each(
|
||||
a.proxy(function(b, c) {
|
||||
var d = a(c).val(),
|
||||
e = a(c).html();
|
||||
return d && "" !== d && d != this.settings.emptyIconValue ?
|
||||
(null === this.unCategorizedKey &&
|
||||
((this.unCategorizedKey = this.availableCategories.length),
|
||||
(this.availableCategories[this.unCategorizedKey] = []),
|
||||
(this.availableCategoriesSearch[this.unCategorizedKey] = []),
|
||||
a("<option />").attr("value", this.unCategorizedKey).html(this.settings.unCategorizedText).appendTo(this.selectCategory)),
|
||||
this.settings.source.push(d),
|
||||
this.availableCategories[this.unCategorizedKey].push(d),
|
||||
this.searchValues.push(e),
|
||||
this.availableCategoriesSearch[this.unCategorizedKey].push(e),
|
||||
void 0) :
|
||||
!0;
|
||||
}, this)
|
||||
)) :
|
||||
this.element.find("option").each(
|
||||
a.proxy(function(b, c) {
|
||||
var d = a(c).val(),
|
||||
e = a(c).html();
|
||||
d && (this.settings.source.push(d), this.searchValues.push(e));
|
||||
}, this)
|
||||
),
|
||||
(this.backupSource = this.settings.source.slice(0)),
|
||||
(this.backupSearch = this.searchValues.slice(0)),
|
||||
this.loadCategories()) :
|
||||
this.initSourceIndex(),
|
||||
this.loadIcons(),
|
||||
this.selectCategory.on(
|
||||
"change keyup",
|
||||
a.proxy(function(b) {
|
||||
if (this.isCategorized === !1) return !1;
|
||||
var c = a(b.currentTarget),
|
||||
d = c.val();
|
||||
if ("all" === c.val())(this.settings.source = this.backupSource), (this.searchValues = this.backupSearch);
|
||||
else {
|
||||
var e = parseInt(d, 10);
|
||||
this.availableCategories[e] && ((this.settings.source = this.availableCategories[e]), (this.searchValues = this.availableCategoriesSearch[e]));
|
||||
}
|
||||
this.resetSearch(), this.loadIcons();
|
||||
}, this)
|
||||
),
|
||||
this.iconPicker.find(".selector-button").click(
|
||||
a.proxy(function() {
|
||||
this.toggleIconSelector();
|
||||
}, this)
|
||||
),
|
||||
this.iconPicker.find(".selector-arrow-right").click(
|
||||
a.proxy(function(b) {
|
||||
this.currentPage < this.totalPage && (this.iconPicker.find(".selector-arrow-left").show(), (this.currentPage = this.currentPage + 1), this.renderIconContainer()),
|
||||
this.currentPage === this.totalPage && a(b.currentTarget).hide();
|
||||
}, this)
|
||||
),
|
||||
this.iconPicker.find(".selector-arrow-left").click(
|
||||
a.proxy(function(b) {
|
||||
this.currentPage > 1 && (this.iconPicker.find(".selector-arrow-right").show(), (this.currentPage = this.currentPage - 1), this.renderIconContainer()), 1 === this.currentPage && a(b.currentTarget).hide();
|
||||
}, this)
|
||||
),
|
||||
this.iconPicker.find(".icons-search-input").keyup(
|
||||
a.proxy(function(b) {
|
||||
var c = a(b.currentTarget).val();
|
||||
return "" === c ?
|
||||
(this.resetSearch(), void 0) :
|
||||
(this.searchIcon.removeClass("fip-icon-search"),
|
||||
this.searchIcon.addClass("fip-icon-cancel"),
|
||||
(this.isSearch = !0),
|
||||
(this.currentPage = 1),
|
||||
(this.iconsSearched = []),
|
||||
a.grep(
|
||||
this.searchValues,
|
||||
a.proxy(function(a, b) {
|
||||
return a.toLowerCase().search(c.toLowerCase()) >= 0 ? ((this.iconsSearched[this.iconsSearched.length] = this.settings.source[b]), !0) : void 0;
|
||||
}, this)
|
||||
),
|
||||
this.renderIconContainer(),
|
||||
void 0);
|
||||
}, this)
|
||||
),
|
||||
this.iconPicker.find(".selector-search").on(
|
||||
"click",
|
||||
".fip-icon-cancel",
|
||||
a.proxy(function() {
|
||||
this.iconPicker.find(".icons-search-input").focus(), this.resetSearch();
|
||||
}, this)
|
||||
),
|
||||
this.iconContainer.on(
|
||||
"click",
|
||||
".fip-box",
|
||||
a.proxy(function(b) {
|
||||
this.setSelectedIcon(a(b.currentTarget).find("i").attr("data-fip-value")), this.toggleIconSelector();
|
||||
}, this)
|
||||
),
|
||||
this.iconPicker.click(function(a) {
|
||||
return a.stopPropagation(), !1;
|
||||
}),
|
||||
a("html").click(
|
||||
a.proxy(function() {
|
||||
this.open && this.toggleIconSelector();
|
||||
}, this)
|
||||
);
|
||||
},
|
||||
initSourceIndex: function() {
|
||||
if ("object" == typeof this.settings.source) {
|
||||
if (a.isArray(this.settings.source))
|
||||
(this.isCategorized = !1),
|
||||
this.selectCategory.html("").hide(),
|
||||
(this.settings.source = a.map(this.settings.source, function(a) {
|
||||
return "function" == typeof a.toString ? a.toString() : a;
|
||||
})),
|
||||
(this.searchValues = a.isArray(this.settings.searchSource) ?
|
||||
a.map(this.settings.searchSource, function(a) {
|
||||
return "function" == typeof a.toString ? a.toString() : a;
|
||||
}) :
|
||||
this.settings.source.slice(0));
|
||||
else {
|
||||
var b = a.extend(!0, {}, this.settings.source);
|
||||
(this.settings.source = []),
|
||||
(this.searchValues = []),
|
||||
(this.availableCategoriesSearch = []),
|
||||
(this.selectedCategory = !1),
|
||||
(this.availableCategories = []),
|
||||
(this.unCategorizedKey = null),
|
||||
(this.isCategorized = !0),
|
||||
this.selectCategory.html("");
|
||||
for (var c in b) {
|
||||
var d = this.availableCategories.length,
|
||||
e = a("<option />");
|
||||
e.attr("value", d), e.html(c), this.selectCategory.append(e), (this.availableCategories[d] = []), (this.availableCategoriesSearch[d] = []);
|
||||
for (var f in b[c]) {
|
||||
var g = b[c][f],
|
||||
h = this.settings.searchSource && this.settings.searchSource[c] && this.settings.searchSource[c][f] ? this.settings.searchSource[c][f] : g;
|
||||
"function" == typeof g.toString && (g = g.toString()),
|
||||
g && g !== this.settings.emptyIconValue && (this.settings.source.push(g), this.availableCategories[d].push(g), this.searchValues.push(h), this.availableCategoriesSearch[d].push(h));
|
||||
}
|
||||
}
|
||||
}
|
||||
(this.backupSource = this.settings.source.slice(0)), (this.backupSearch = this.searchValues.slice(0)), this.loadCategories();
|
||||
}
|
||||
},
|
||||
loadCategories: function() {
|
||||
this.isCategorized !== !1 && (a('<option value="all">' + this.settings.allCategoryText + "</option>").prependTo(this.selectCategory), this.selectCategory.show().val("all").trigger("change"));
|
||||
},
|
||||
loadIcons: function() {
|
||||
this.iconContainer.html('<i class="fip-icon-spin3 animate-spin loading"></i>'), this.settings.source instanceof Array && this.renderIconContainer();
|
||||
},
|
||||
renderIconContainer: function() {
|
||||
var b,
|
||||
c = [];
|
||||
if (
|
||||
((c = this.isSearch ? this.iconsSearched : this.settings.source),
|
||||
(this.iconsCount = c.length),
|
||||
(this.totalPage = Math.ceil(this.iconsCount / this.settings.iconsPerPage)),
|
||||
this.totalPage > 1 ? this.iconPicker.find(".selector-footer").show() : this.iconPicker.find(".selector-footer").hide(),
|
||||
this.iconPicker.find(".selector-pages").html(this.currentPage + "/" + this.totalPage + " <em>(" + this.iconsCount + ")</em>"),
|
||||
(b = (this.currentPage - 1) * this.settings.iconsPerPage),
|
||||
this.settings.emptyIcon)
|
||||
)
|
||||
this.iconContainer.html('<span class="fip-box"><i class="fas fa-times-circle" data-fip-value="fa-times-circle"></i></span>');
|
||||
else {
|
||||
if (c.length < 1) return this.iconContainer.html('<span class="icons-picker-error"><i class="fas fa-times-circle" data-fip-value="fa-times-circle"></i></span>'), void 0;
|
||||
this.iconContainer.html("");
|
||||
}
|
||||
c = c.slice(b, b + this.settings.iconsPerPage);
|
||||
for (var e, d = 0;
|
||||
(e = c[d++]);) {
|
||||
var f = e;
|
||||
a.grep(
|
||||
this.settings.source,
|
||||
a.proxy(function(a, b) {
|
||||
return a === e ? ((f = this.searchValues[b]), !0) : !1;
|
||||
}, this)
|
||||
),
|
||||
a("<span/>", {
|
||||
html: '<i data-fip-value="' +
|
||||
e +
|
||||
'" ' +
|
||||
(this.settings.useAttribute ? this.settings.attributeName + '="' + (this.settings.convertToHex ? "&#x" + parseInt(e, 10).toString(16) + ";" : e) + '"' : 'class=" ' + e + '"') +
|
||||
"></i>",
|
||||
class: "fip-box",
|
||||
title: f,
|
||||
}).appendTo(this.iconContainer);
|
||||
}
|
||||
this.settings.emptyIcon || (this.element.val() && -1 !== a.inArray(this.element.val(), this.settings.source)) ?
|
||||
-1 === a.inArray(this.element.val(), this.settings.source) ?
|
||||
this.setSelectedIcon() :
|
||||
this.setSelectedIcon(this.element.val()) :
|
||||
this.setSelectedIcon(c[0]);
|
||||
},
|
||||
setHighlightedIcon: function() {
|
||||
this.iconContainer.find(".current-icon").removeClass("current-icon"),
|
||||
this.currentIcon &&
|
||||
this.iconContainer
|
||||
.find('[data-fip-value="' + this.currentIcon + '"]')
|
||||
.parent("span")
|
||||
.addClass("current-icon");
|
||||
},
|
||||
setSelectedIcon: function(a) {
|
||||
if (
|
||||
("fa-times-circle" === a && (a = ""),
|
||||
this.settings.useAttribute ?
|
||||
a ?
|
||||
this.iconPicker.find(".selected-icon").html("<i " + this.settings.attributeName + '="' + (this.settings.convertToHex ? "&#x" + parseInt(a, 10).toString(16) + ";" : a) + '"></i>') :
|
||||
this.iconPicker.find(".selected-icon").html('<i class="fa-times-circle"></i>') :
|
||||
this.iconPicker.find(".selected-icon").html('<i class="fas ' + (a || "fa-times-circle") + '"></i>'),
|
||||
this.element.val("" === a ? this.settings.emptyIconValue : a).trigger("change"),
|
||||
null !== this.triggerEvent)
|
||||
)
|
||||
for (var b in this.triggerEvent) this.element.trigger(this.triggerEvent[b]);
|
||||
(this.currentIcon = a), this.setHighlightedIcon();
|
||||
},
|
||||
toggleIconSelector: function() {
|
||||
(this.open = this.open ? 0 : 1),
|
||||
this.iconPicker.find(".selector-popup").slideToggle(300),
|
||||
this.iconPicker.find(".selector-button i").toggleClass("fip-icon-down-dir"),
|
||||
this.iconPicker.find(".selector-button i").toggleClass("fip-icon-up-dir"),
|
||||
this.open && this.iconPicker.find(".icons-search-input").focus().select();
|
||||
},
|
||||
resetSearch: function() {
|
||||
this.iconPicker.find(".icons-search-input").val(""),
|
||||
this.searchIcon.removeClass("fip-icon-cancel"),
|
||||
this.searchIcon.addClass("fip-icon-search"),
|
||||
this.iconPicker.find(".selector-arrow-left").hide(),
|
||||
(this.currentPage = 1),
|
||||
(this.isSearch = !1),
|
||||
this.renderIconContainer(),
|
||||
this.totalPage > 1 && this.iconPicker.find(".selector-arrow-right").show();
|
||||
},
|
||||
}),
|
||||
(a.fn.fontIconPicker = function(b) {
|
||||
return (
|
||||
this.each(function() {
|
||||
a.data(this, "fontIconPicker") || a.data(this, "fontIconPicker", new c(this, b));
|
||||
}),
|
||||
(this.setIcons = a.proxy(function(b, c) {
|
||||
void 0 === b && (b = !1),
|
||||
void 0 === c && (c = !1),
|
||||
this.each(function() {
|
||||
(a.data(this, "fontIconPicker").settings.source = b),
|
||||
(a.data(this, "fontIconPicker").settings.searchSource = c),
|
||||
a.data(this, "fontIconPicker").initSourceIndex(),
|
||||
a.data(this, "fontIconPicker").resetSearch(),
|
||||
a.data(this, "fontIconPicker").loadIcons();
|
||||
});
|
||||
}, this)),
|
||||
(this.destroyPicker = a.proxy(function() {
|
||||
this.each(function() {
|
||||
a.data(this, "fontIconPicker") &&
|
||||
(a.data(this, "fontIconPicker").iconPicker.remove(),
|
||||
a.data(this, "fontIconPicker").element.css({
|
||||
visibility: "",
|
||||
top: "",
|
||||
position: "",
|
||||
zIndex: "",
|
||||
left: "",
|
||||
display: "",
|
||||
height: "",
|
||||
width: "",
|
||||
padding: "",
|
||||
margin: "",
|
||||
border: "",
|
||||
verticalAlign: ""
|
||||
}),
|
||||
a.removeData(this, "fontIconPicker"));
|
||||
});
|
||||
}, this)),
|
||||
(this.refreshPicker = a.proxy(function(d) {
|
||||
d || (d = b),
|
||||
this.destroyPicker(),
|
||||
this.each(function() {
|
||||
a.data(this, "fontIconPicker") || a.data(this, "fontIconPicker", new c(this, d));
|
||||
});
|
||||
}, this)),
|
||||
this
|
||||
);
|
||||
});
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user