File manager - Edit - /home/theblueo/tv/fb4e3b/unminified.tar
Back
customizer-dependency.js 0000666 00000026337 15214245400 0011436 0 ustar 00 /** * Customizer controls * * @package Astra */ (function ($) { 'use strict'; /* Internal shorthand */ var api = wp.customize; /** * Helper class for the main Customizer interface. * * @since 1.4.3 * @class Astra_Customizer */ var Astra_Customizer = { controls: {}, /** * Initializes the logic for showing and hiding controls * when a setting changes. * * @since 1.4.3 * @access private * @method init */ init: function () { var $this = this; $this.handleDependency(); $this.hideEmptySections(); api.bind('change', function ( setting, data ) { var has_dependents = $this.hasDependentControls( setting.id ); if( has_dependents ) { $this.handleDependency(); $this.hideEmptySections(); } }); }, hasDependentControls: function( control_id ) { var check = false; $.each(astra.config, function (index, val) { if( !_.isUndefined( val.conditions ) ) { var conditions = val.conditions; $.each( conditions, function (index, val) { var control = val[0]; if( control_id == control ) { check = true; return; } }); } else { var control = val[0]; if( control_id == control ) { check = true; return; } } }); return check; }, /** * Handles dependency for controls. * * @since 1.4.3 * @access private * @method handleDependency */ handleDependency: function () { var $this = this; var values = api.get(); $this.checked_controls = {}; _.each(values, function (value, id) { var control = api.control(id); $this.checkControlVisibility( control, id ); }); }, /** * Hide OR display controls according to dependency * * @since 1.4.3 * @access private * @method checkControlVisibility */ checkControlVisibility: function (control, id) { var $this = this; var values = api.get(); if ( !_.isUndefined( control ) ) { // If control has dependency defined if ( 'undefined' != typeof astra.config[id] ) { var check = false; var required_param = astra.config[id]; var conditions = !_.isUndefined(required_param.conditions) ? required_param.conditions : required_param; var operator = !_.isUndefined(required_param.operator) ? required_param.operator : 'AND'; if ( 'undefined' !== typeof conditions ) { check = $this.checkDependency(conditions, values, operator); this.checked_controls[id] = check; if (!check) { control.container.addClass('ast-hide'); } else { control.container.removeClass('ast-hide'); } } } } }, /** * Checks dependency condtions for controls * * @since 1.4.3 * @access private * @method checkDependency */ checkDependency: function (conditions, values, compare_operator) { var control = this; var check = true; var returnNow = false; var test = conditions[0]; if ( _.isString( test ) ) { var cond = conditions[1]; var cond_val = conditions[2]; var value; if ( !_.isUndefined( astra.config[test] ) ) { var conditions = !_.isUndefined(astra.config[test]['conditions']) ? astra.config[test]['conditions'] : astra.config[test]; var operator = !_.isUndefined(astra.config[test]['operator']) ? astra.config[test]['operator'] : 'AND'; if ( !_.isUndefined( conditions ) ) { // Check visibility for dependent controls also if ( ! control.checkDependency( conditions, values, operator ) ) { returnNow = true; check = false; if( 'AND' == compare_operator ) { return; } } else { var control_obj = api.control(test); control_obj.container.removeClass('ast-hide'); } } } if ( !_.isUndefined( values[test] ) && !returnNow && check ) { value = values[test]; check = control.compareValues( value, cond, cond_val ); } } else if ( _.isArray( test ) ) { $.each( conditions, function ( index, val ) { var cond_key = val[0]; var cond_cond = val[1]; var cond_val = val[2]; var t_val = !_.isUndefined( values[cond_key] ) ? values[cond_key] : ''; if ( 'undefined' !== typeof astra.config[cond_key] ) { var conditions = !_.isUndefined(astra.config[cond_key]['conditions']) ? astra.config[cond_key]['conditions'] : astra.config[cond_key]; var operator = !_.isUndefined(astra.config[cond_key]['operator']) ? astra.config[cond_key]['operator'] : 'AND'; if ( !_.isUndefined( conditions ) ) { // Check visibility for dependent controls also if ( ! control.checkDependency( conditions, values, operator ) ) { check = false; if( 'AND' == compare_operator ) { return; } } else { check = true; var control_obj = api.control(cond_key); control_obj.container.removeClass('ast-hide'); } } } else { check = true; } if( check ) { if ( 'AND' == compare_operator ) { if ( ! control.compareValues( t_val, cond_cond, cond_val ) ) { check = false; return false; } } else { if ( control.compareValues( t_val, cond_cond, cond_val ) ) { returnNow = true; check = true; } else { check = false; } } } }); // Break loop in case of OR operator if ( returnNow && 'OR' == compare_operator ) { check = true; } } return check; }, /** * Hide Section without Controls. * */ hideEmptySections: function () { $('ul.accordion-section.control-section-ast_section').each(function () { var parentId = $(this).attr('id'); var visibleIt = false; var controls = $(this).find(' > .customize-control'); if ( controls.length > 0 ) { controls.each(function () { if ( ! $(this).hasClass('ast-hide') && $(this).css('display') != 'none' ) { visibleIt = true; } }); if (!visibleIt) { $('.control-section[aria-owns="' + parentId + '"]').addClass('ast-hide'); } else { $('.control-section[aria-owns="' + parentId + '"]').removeClass('ast-hide'); } } }); }, /** * Compare values * * @since 1.4.3 * @access private * @method compareValues */ compareValues: function (value1, cond, value2) { var equal = false; switch (cond) { case '===': equal = (value1 === value2) ? true : false; break; case '>': equal = (value1 > value2) ? true : false; break; case '<': equal = (value1 < value2) ? true : false; break; case '<=': equal = (value1 <= value2) ? true : false; break; case '>=': equal = (value1 >= value2) ? true : false; break; case '!=': equal = (value1 != value2) ? true : false; break; case 'empty': var _v = _.clone(value1); if (_.isObject(_v) || _.isArray(_v)) { _.each(_v, function (v, i) { if (_.isEmpty(v)) { delete _v[i]; } }); equal = _.isEmpty(_v) ? true : false; } else { equal = _.isNull(_v) || _v == '' ? true : false; } break; case 'not_empty': var _v = _.clone(value1); if (_.isObject(_v) || _.isArray(_v)) { _.each(_v, function (v, i) { if (_.isEmpty(v)) { delete _v[i]; } }) } equal = _.isEmpty(_v) ? false : true; break; case 'contains': if (_.isArray(value1)) { if ($.inArray(value2, value1) !== -1) { equal = true; } } break; default: if (_.isArray(value2)) { if (!_.isEmpty(value2) && !_.isEmpty(value1)) { equal = _.contains(value2, value1); } else { equal = false; } } else { equal = (value1 == value2) ? true : false; } } return equal; }, }; $(function () { Astra_Customizer.init(); }); })(jQuery); extend-customizer.js 0000666 00000014601 15214245400 0010576 0 ustar 00 /** * Extend Customizer Panel * * @package Astra */ ( function( $ ) { var api = wp.customize; api.bind( 'pane-contents-reflowed', function() { // Reflow sections var sections = []; api.section.each( function( section ) { if ( 'ast_section' !== section.params.type || 'undefined' === typeof section.params.section ) { return; } sections.push( section ); }); sections.sort( api.utils.prioritySort ).reverse(); $.each( sections, function( i, section ) { var parentContainer = $( '#sub-accordion-section-' + section.params.section ); parentContainer.children( '.section-meta' ).after( section.headContainer ); }); // Reflow panels var panels = []; api.panel.each( function( panel ) { if ( 'ast_panel' !== panel.params.type || 'undefined' === typeof panel.params.panel ) { return; } panels.push( panel ); }); panels.sort( api.utils.prioritySort ).reverse(); $.each( panels, function( i, panel ) { var parentContainer = $( '#sub-accordion-panel-' + panel.params.panel ); parentContainer.children( '.panel-meta' ).after( panel.headContainer ); }); }); // Extend Panel var _panelEmbed = wp.customize.Panel.prototype.embed; var _panelIsContextuallyActive = wp.customize.Panel.prototype.isContextuallyActive; var _panelAttachEvents = wp.customize.Panel.prototype.attachEvents; wp.customize.Panel = wp.customize.Panel.extend({ attachEvents: function() { if ( 'ast_panel' !== this.params.type || 'undefined' === typeof this.params.panel ) { _panelAttachEvents.call( this ); return; } _panelAttachEvents.call( this ); var panel = this; panel.expanded.bind( function( expanded ) { var parent = api.panel( panel.params.panel ); if ( expanded ) { parent.contentContainer.addClass( 'current-panel-parent' ); } else { parent.contentContainer.removeClass( 'current-panel-parent' ); } }); panel.container.find( '.customize-panel-back' ) .off( 'click keydown' ) .on( 'click keydown', function( event ) { if ( api.utils.isKeydownButNotEnterEvent( event ) ) { return; } event.preventDefault(); // Keep this AFTER the key filter above if ( panel.expanded() ) { api.panel( panel.params.panel ).expand(); } }); }, embed: function() { if ( 'ast_panel' !== this.params.type || 'undefined' === typeof this.params.panel ) { _panelEmbed.call( this ); return; } _panelEmbed.call( this ); var panel = this; var parentContainer = $( '#sub-accordion-panel-' + this.params.panel ); parentContainer.append( panel.headContainer ); }, isContextuallyActive: function() { if ( 'ast_panel' !== this.params.type ) { return _panelIsContextuallyActive.call( this ); } var panel = this; var children = this._children( 'panel', 'section' ); api.panel.each( function( child ) { if ( ! child.params.panel ) { return; } if ( child.params.panel !== panel.id ) { return; } children.push( child ); }); children.sort( api.utils.prioritySort ); var activeCount = 0; _( children ).each( function ( child ) { if ( child.active() && child.isContextuallyActive() ) { activeCount += 1; } }); return ( activeCount !== 0 ); } }); // Extend Section var _sectionEmbed = wp.customize.Section.prototype.embed; var _sectionIsContextuallyActive = wp.customize.Section.prototype.isContextuallyActive; var _sectionAttachEvents = wp.customize.Section.prototype.attachEvents; wp.customize.Section = wp.customize.Section.extend({ attachEvents: function() { if ( 'ast_section' !== this.params.type || 'undefined' === typeof this.params.section ) { _sectionAttachEvents.call( this ); return; } _sectionAttachEvents.call( this ); var section = this; section.expanded.bind( function( expanded ) { var parent = api.section( section.params.section ); if ( expanded ) { parent.contentContainer.addClass( 'current-section-parent' ); } else { parent.contentContainer.removeClass( 'current-section-parent' ); } }); section.container.find( '.customize-section-back' ) .off( 'click keydown' ) .on( 'click keydown', function( event ) { if ( api.utils.isKeydownButNotEnterEvent( event ) ) { return; } event.preventDefault(); // Keep this AFTER the key filter above if ( section.expanded() ) { api.section( section.params.section ).expand(); } }); }, embed: function() { if ( 'ast_section' !== this.params.type || 'undefined' === typeof this.params.section ) { _sectionEmbed.call( this ); return; } _sectionEmbed.call( this ); var section = this; var parentContainer = $( '#sub-accordion-section-' + this.params.section ); parentContainer.append( section.headContainer ); }, isContextuallyActive: function() { if ( 'ast_section' !== this.params.type ) { return _sectionIsContextuallyActive.call( this ); } var section = this; var children = this._children( 'section', 'control' ); api.section.each( function( child ) { if ( ! child.params.section ) { return; } if ( child.params.section !== section.id ) { return; } children.push( child ); }); children.sort( api.utils.prioritySort ); var activeCount = 0; _( children ).each( function ( child ) { if ( 'undefined' !== typeof child.isContextuallyActive ) { if ( child.active() && child.isContextuallyActive() ) { activeCount += 1; } } else { if ( child.active() ) { activeCount += 1; } } }); return ( activeCount !== 0 ); } }); })( jQuery ); style.js 0000666 00000046747 15214245400 0006265 0 ustar 00 /** * File navigation.js * * Handles toggling the navigation menu for small screens and enables tab * support for dropdown menus. * * @package Astra */ /** * Get all of an element's parent elements up the DOM tree * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var getParents = function ( elem, selector ) { // Element.matches() polyfill. if ( ! Element.prototype.matches) { Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function(s) { var matches = (this.document || this.ownerDocument).querySelectorAll( s ), i = matches.length; while (--i >= 0 && matches.item( i ) !== this) {} return i > -1; }; } // Setup parents array. var parents = []; // Get matching parent elements. for ( ; elem && elem !== document; elem = elem.parentNode ) { // Add matching parents to array. if ( selector ) { if ( elem.matches( selector ) ) { parents.push( elem ); } } else { parents.push( elem ); } } return parents; }; /** * Toggle Class funtion * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var toggleClass = function ( el, className ) { if ( el.classList.contains( className ) ) { el.classList.remove( className ); } else { el.classList.add( className ); } }; // CustomEvent() constructor functionality in Internet Explorer 9 and higher. (function () { if (typeof window.CustomEvent === "function") return false; function CustomEvent(event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; })(); /** * Trigget custom JS Event. * * @since 1.4.6 * * @link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent * @param {Node} el Dom Node element on which the event is to be triggered. * @param {Node} typeArg A DOMString representing the name of the event. * @param {String} A CustomEventInit dictionary, having the following fields: * "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event. */ var astraTriggerEvent = function astraTriggerEvent( el, typeArg ) { var customEventInit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var event = new CustomEvent(typeArg, customEventInit); el.dispatchEvent(event); }; ( function() { var menu_toggle_all = document.querySelectorAll( '.main-header-menu-toggle' ); var menu_click_listeners = {}; /* Add break point Class and related trigger */ var updateHeaderBreakPoint = function () { // Content overrflowing out of screen can give incorrect window.innerWidth. // Adding overflow hidden and then calculating the window.innerWidth fixes the problem. var originalOverflow = document.querySelector('body').style.overflow; document.querySelector('body').style.overflow = 'hidden'; var ww = window.innerWidth; document.querySelector('body').style.overflow = originalOverflow; var break_point = astra.break_point, headerWrap = document.querySelectorAll('.main-header-bar-wrap'); if (headerWrap.length > 0) { for (var i = 0; i < headerWrap.length; i++) { if (headerWrap[i].tagName == 'DIV' && headerWrap[i].classList.contains('main-header-bar-wrap')) { if (ww > break_point) { //remove menu toggled class. if (null != menu_toggle_all[i]) { menu_toggle_all[i].classList.remove('toggled'); } document.body.classList.remove("ast-header-break-point"); document.body.classList.add("ast-desktop"); astraTriggerEvent(document.body, "astra-header-responsive-enabled"); } else { document.body.classList.add("ast-header-break-point"); document.body.classList.remove("ast-desktop"); astraTriggerEvent(document.body, "astra-header-responsive-disabled") } } } } } updateHeaderBreakPoint(); AstraToggleSubMenu = function() { var parent_li = this.parentNode; if (parent_li.classList.contains('ast-submenu-expanded') && document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) { if (!this.classList.contains('ast-menu-toggle')) { var link = parent_li.querySelector('a').getAttribute('href'); if ('' !== link || '#' !== link) { window.location = link; } } } var parent_li_child = parent_li.querySelectorAll('.menu-item-has-children, .page_item_has_children'); for (var j = 0; j < parent_li_child.length; j++) { parent_li_child[j].classList.remove('ast-submenu-expanded'); var parent_li_child_sub_menu = parent_li_child[j].querySelector('.sub-menu, .children'); parent_li_child_sub_menu.style.display = 'none'; }; var parent_li_sibling = parent_li.parentNode.querySelectorAll('.menu-item-has-children, .page_item_has_children'); for (var j = 0; j < parent_li_sibling.length; j++) { if (parent_li_sibling[j] != parent_li) { parent_li_sibling[j].classList.remove('ast-submenu-expanded'); var all_sub_menu = parent_li_sibling[j].querySelectorAll('.sub-menu, .children'); for (var k = 0; k < all_sub_menu.length; k++) { all_sub_menu[k].style.display = 'none'; }; } }; if (parent_li.classList.contains('menu-item-has-children') || parent_li.classList.contains('page_item_has_children')) { toggleClass(parent_li, 'ast-submenu-expanded'); if (parent_li.classList.contains('ast-submenu-expanded')) { parent_li.querySelector('.sub-menu, .children').style.display = 'block'; } else { parent_li.querySelector('.sub-menu, .children').style.display = 'none'; } } }; AstraNavigationMenu = function( parentList ) { console.warn( 'AstraNavigationMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future.' ); }; AstraToggleMenu = function( astra_menu_toggle ) { console.warn('AstraToggleMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future. Use AstraToggleSubMenu() instead.'); // Add Eventlisteners for Submenu. if (astra_menu_toggle.length > 0) { for (var i = 0; i < astra_menu_toggle.length; i++) { astra_menu_toggle[i].addEventListener('click', AstraToggleSubMenu, false); }; } }; AstraToggleSetup = function () { var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); if (menu_toggle_all.length > 0) { for (var i = 0; i < menu_toggle_all.length; i++) { menu_toggle_all[i].setAttribute('data-index', i); if ( ! menu_click_listeners[i] ) { menu_click_listeners[i] = menu_toggle_all[i]; menu_toggle_all[i].addEventListener('click', astraNavMenuToggle, false); } if ('undefined' !== typeof __main_header_all[i]) { if (document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) { var astra_menu_toggle = __main_header_all[i].querySelectorAll('.ast-header-break-point .main-header-menu .menu-item-has-children > a, .ast-header-break-point .main-header-menu .page_item_has_children > a, .ast-header-break-point ul.main-header-menu .ast-menu-toggle'); } else { var astra_menu_toggle = __main_header_all[i].querySelectorAll('ul.main-header-menu .ast-menu-toggle'); } // Add Eventlisteners for Submenu. if (astra_menu_toggle.length > 0) { for (var j = 0; j < astra_menu_toggle.length; j++) { astra_menu_toggle[j].addEventListener('click', AstraToggleSubMenu, false); }; } } }; } }; astraNavMenuToggle = function ( event ) { event.preventDefault(); var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); var event_index = this.getAttribute('data-index'); if ('undefined' === typeof __main_header_all[event_index]) { return false; } var menuHasChildren = __main_header_all[event_index].querySelectorAll('.menu-item-has-children, .page_item_has_children'); for (var i = 0; i < menuHasChildren.length; i++) { menuHasChildren[i].classList.remove('ast-submenu-expanded'); var menuHasChildrenSubMenu = menuHasChildren[i].querySelectorAll('.sub-menu, .children'); for (var j = 0; j < menuHasChildrenSubMenu.length; j++) { menuHasChildrenSubMenu[j].style.display = 'none'; }; } var menu_class = this.getAttribute('class') || ''; if ( menu_class.indexOf('main-header-menu-toggle') !== -1 ) { toggleClass(__main_header_all[event_index], 'toggle-on'); toggleClass(menu_toggle_all[event_index], 'toggled'); if (__main_header_all[event_index].classList.contains('toggle-on')) { __main_header_all[event_index].style.display = 'block'; document.body.classList.add("ast-main-header-nav-open"); } else { __main_header_all[event_index].style.display = ''; document.body.classList.remove("ast-main-header-nav-open"); } } }; document.body.addEventListener("astra-header-responsive-enabled", function () { var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); if (__main_header_all.length > 0) { for (var i = 0; i < __main_header_all.length; i++) { if (null != __main_header_all[i]) { __main_header_all[i].classList.remove('toggle-on'); __main_header_all[i].style.display = ''; } var sub_menu = __main_header_all[i].getElementsByClassName('sub-menu'); for (var j = 0; j < sub_menu.length; j++) { sub_menu[j].style.display = ''; } var child_menu = __main_header_all[i].getElementsByClassName('children'); for (var k = 0; k < child_menu.length; k++) { child_menu[k].style.display = ''; } var searchIcons = __main_header_all[i].getElementsByClassName('ast-search-menu-icon'); for (var l = 0; l < searchIcons.length; l++) { searchIcons[l].classList.remove('ast-dropdown-active'); searchIcons[l].style.display = ''; } } } }, false); window.addEventListener('resize', function () { // Skip resize event when keyboard display event triggers on devices. if( 'INPUT' !== document.activeElement.tagName ) { updateHeaderBreakPoint(); AstraToggleSetup(); } }); document.addEventListener('DOMContentLoaded', function () { AstraToggleSetup(); /** * Navigation Keyboard Navigation. */ var container, button, menu, links, subMenus, i, len, count; container = document.querySelectorAll( '.navigation-accessibility' ); for ( count = 0; count <= container.length - 1; count++ ) { if ( container[count] ) { navigation_accessibility( container[count] ); } } }); var get_browser = function () { var ua = navigator.userAgent,tem,M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; if(/trident/i.test(M[1])) { tem = /\brv[ :]+(\d+)/g.exec(ua) || []; return; } if( 'Chrome' === M[1] ) { tem = ua.match(/\bOPR|Edge\/(\d+)/) if(tem != null) { return; } } M = M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?']; if((tem = ua.match(/version\/(\d+)/i)) != null) { M.splice(1,1,tem[1]); } bodyElement = document.body; if( 'Safari' === M[0] && M[1] < 11 ) { bodyElement.classList.add( "ast-safari-browser-less-than-11" ); } } get_browser(); /* Search Script */ var SearchIcons = document.getElementsByClassName( 'astra-search-icon' ); for (var i = 0; i < SearchIcons.length; i++) { SearchIcons[i].onclick = function(event) { if ( this.classList.contains( 'slide-search' ) ) { event.preventDefault(); var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); if ( ! sibling.classList.contains( 'ast-dropdown-active' ) ) { sibling.classList.add( 'ast-dropdown-active' ); sibling.querySelector( '.search-field' ).setAttribute('autocomplete','off'); setTimeout(function() { sibling.querySelector( '.search-field' ).focus(); },200); } else { var searchTerm = sibling.querySelector( '.search-field' ).value || ''; if( '' !== searchTerm ) { sibling.querySelector( '.search-form' ).submit(); } sibling.classList.remove( 'ast-dropdown-active' ); } } } }; /* Hide Dropdown on body click*/ document.body.onclick = function( event ) { if ( typeof event.target.classList !== 'undefined' ) { if ( ! event.target.classList.contains( 'ast-search-menu-icon' ) && getParents( event.target, '.ast-search-menu-icon' ).length === 0 && getParents( event.target, '.ast-search-icon' ).length === 0 ) { var dropdownSearchWrap = document.getElementsByClassName( 'ast-search-menu-icon' ); for (var i = 0; i < dropdownSearchWrap.length; i++) { dropdownSearchWrap[i].classList.remove( 'ast-dropdown-active' ); }; } } } /** * Navigation Keyboard Navigation. */ function navigation_accessibility( container ) { if ( ! container ) { return; } button = container.getElementsByTagName( 'button' )[0]; if ( 'undefined' === typeof button ) { button = container.getElementsByTagName( 'a' )[0]; if ( 'undefined' === typeof button ) { return; } } menu = container.getElementsByTagName( 'ul' )[0]; // Hide menu toggle button if menu is empty and return early. if ( 'undefined' === typeof menu ) { button.style.display = 'none'; return; } menu.setAttribute( 'aria-expanded', 'false' ); if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { menu.className += ' nav-menu'; } button.onclick = function() { if ( -1 !== container.className.indexOf( 'toggled' ) ) { container.className = container.className.replace( ' toggled', '' ); button.setAttribute( 'aria-expanded', 'false' ); menu.setAttribute( 'aria-expanded', 'false' ); } else { container.className += ' toggled'; button.setAttribute( 'aria-expanded', 'true' ); menu.setAttribute( 'aria-expanded', 'true' ); } }; // Get all the link elements within the menu. links = menu.getElementsByTagName( 'a' ); subMenus = menu.getElementsByTagName( 'ul' ); // Set menu items with submenus to aria-haspopup="true". for ( i = 0, len = subMenus.length; i < len; i++ ) { subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' ); } // Each time a menu link is focused or blurred, toggle focus. for ( i = 0, len = links.length; i < len; i++ ) { links[i].addEventListener( 'focus', toggleFocus, true ); links[i].addEventListener( 'blur', toggleBlurFocus, true ); links[i].addEventListener( 'click', toggleClose, true ); } } /** * Close the Toggle Menu on Click on hash (#) link. * * @since 1.3.2 * @return void */ function toggleClose( ) { var self = this || '', hash = '#'; if( self && ! self.classList.contains('astra-search-icon') ) { var link = new String( self ); if( link.indexOf( hash ) !== -1 ) { var link_parent = self.parentNode; if ( document.body.classList.contains('ast-header-break-point') && ! ( document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link") && link_parent.classList.contains("menu-item-has-children") ) ) { /* Close Main Header Menu */ var main_header_menu_toggle = document.querySelector( '.main-header-menu-toggle' ); main_header_menu_toggle.classList.remove( 'toggled' ); var main_header_bar_navigation = document.querySelector( '.main-header-bar-navigation' ); main_header_bar_navigation.classList.remove( 'toggle-on' ); main_header_bar_navigation.style.display = 'none'; /* Close Below Header Menu */ var before_header_menu_toggle = document.querySelector( '.menu-below-header-toggle' ); var before_header_bar_navigation = document.querySelector( '.ast-below-header' ); var before_header_bar = document.querySelector( '.ast-below-header-actual-nav' ); if ( before_header_menu_toggle && before_header_bar_navigation && before_header_bar ) { before_header_menu_toggle.classList.remove( 'toggled' ); before_header_bar_navigation.classList.remove( 'toggle-on' ); before_header_bar.style.display = 'none'; } /* Close After Header Menu */ var after_header_menu_toggle = document.querySelector( '.menu-above-header-toggle' ); var after_header_bar_navigation = document.querySelector( '.ast-above-header' ); var after_header_bar = document.querySelector( '.ast-above-header-navigation' ); if ( after_header_menu_toggle && after_header_bar_navigation && after_header_bar ) { after_header_menu_toggle.classList.remove( 'toggled' ); after_header_bar_navigation.classList.remove( 'toggle-on' ); after_header_bar.style.display = 'none'; } astraTriggerEvent( document.querySelector('body'), 'astraMenuHashLinkClicked' ); } else { while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } } self = self.parentElement; } } } } } /** * Sets or removes .focus class on an element on focus. */ function toggleFocus() { var self = this; // Move up through the ancestors of the current link until we hit .nav-menu. while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } else { self.className += ' focus'; } } self = self.parentElement; } } /** * Sets or removes .focus class on an element on blur. */ function toggleBlurFocus() { var self = this || '', hash = '#'; link = new String( self ); if( link.indexOf( hash ) !== -1 && document.body.classList.contains('ast-mouse-clicked') ) { return; } // Move up through the ancestors of the current link until we hit .nav-menu. while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } else { self.className += ' focus'; } } self = self.parentElement; } } /* Add class if mouse clicked and remove if tab pressed */ if ( 'querySelector' in document && 'addEventListener' in window ) { var body = document.body; body.addEventListener( 'mousedown', function() { body.classList.add( 'ast-mouse-clicked' ); } ); body.addEventListener( 'keydown', function() { body.classList.remove( 'ast-mouse-clicked' ); } ); } } )(); customizer-controls.js 0000666 00000003734 15214245400 0011157 0 ustar 00 /** * Customizer controls * * @package Astra */ ( function( $ ) { /* Internal shorthand */ var api = wp.customize; /** * Helper class for the main Customizer interface. * * @since 1.0.0 * @class ASTCustomizer */ ASTCustomizer = { controls : {}, /** * Initializes our custom logic for the Customizer. * * @since 1.0.0 * @method init */ init: function() { ASTCustomizer._initToggles(); }, /** * Initializes the logic for showing and hiding controls * when a setting changes. * * @since 1.0.0 * @access private * @method _initToggles */ _initToggles: function() { // Trigger the Adv Tab Click trigger. ASTControlTrigger.triggerHook( 'astra-toggle-control', api ); // Loop through each setting. $.each( ASTCustomizerToggles, function( settingId, toggles ) { // Get the setting object. api( settingId, function( setting ) { // Loop though the toggles for the setting. $.each( toggles, function( i, toggle ) { // Loop through the controls for the toggle. $.each( toggle.controls, function( k, controlId ) { // Get the control object. api.control( controlId, function( control ) { // Define the visibility callback. var visibility = function( to ) { control.container.toggle( toggle.callback( to ) ); }; // Init visibility. visibility( setting.get() ); // Bind the visibility callback to the setting. setting.bind( visibility ); }); }); }); }); }); } }; $( function() { ASTCustomizer.init(); } ); })( jQuery ); ( function( api ) { // Extends our custom astra-pro section. api.sectionConstructor['astra-pro'] = api.Section.extend( { // No events for this type of section. attachEvents: function () {}, // Always make the section active. isContextuallyActive: function () { return true; } } ); } )( wp.customize ); wp-color-picker-alpha.js 0000666 00000036361 15214245400 0011214 0 ustar 00 /**! * wp-color-picker-alpha * * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker * Only run in input and is defined data alpha in true * * Version: 2.1.3 * https://github.com/kallookoo/wp-color-picker-alpha * Licensed under the GPLv2 license or later. */ ( function( $ ) { // Prevent double-init. if ( $.wp.wpColorPicker.prototype._hasAlpha ) { return; } // Variable for some backgrounds ( grid ) var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==', // html stuff for wpColorPicker copy of the original color-picker.js _after = '<div class="wp-picker-holder" />', _wrap = '<div class="wp-picker-container" />', _button = '<input type="button" class="button button-small" />', // Prevent CSS issues in < WordPress 4.9 _deprecated = ( wpColorPickerL10n.current !== undefined ); // Declare some global variables when is deprecated or not if ( _deprecated ) { var _before = '<a tabindex="0" class="wp-color-result" />'; } else { var _before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>', _wrappingLabel = '<label></label>', _wrappingLabelText = '<span class="screen-reader-text"></span>'; } /** * Overwrite Color * for enable support rbga */ Color.fn.toString = function() { if ( this._alpha < 1 ) return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' ); var hex = parseInt( this._color, 10 ).toString( 16 ); if ( this.error ) return ''; if ( hex.length < 6 ) hex = ( '00000' + hex ).substr( -6 ); return '#' + hex; }; /** * Overwrite wpColorPicker */ $.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, { _hasAlpha: true, /** * @summary Creates the color picker. * * Creates the color picker, sets default values, css classes and wraps it all in HTML. * * @since 3.5.0 * * @access private * * @returns {void} */ _create: function() { // Return early if Iris support is missing. if ( ! $.support.iris ) { return; } var self = this, el = self.element; // Override default options with options bound to the element. $.extend( self.options, el.data() ); // Create a color picker which only allows adjustments to the hue. if ( self.options.type === 'hue' ) { return self._createHueOnly(); } // Bind the close event. self.close = $.proxy( self.close, self ); self.initialValue = el.val(); // Add a CSS class to the input field. el.addClass( 'wp-color-picker' ); if ( _deprecated ) { el.hide().wrap( _wrap ); self.wrap = el.parent(); self.toggler = $( _before ) .insertBefore( el ) .css( { backgroundColor : self.initialValue } ) .attr( 'title', wpColorPickerL10n.pick ) .attr( 'data-current', wpColorPickerL10n.current ); self.pickerContainer = $( _after ).insertAfter( el ); self.button = $( _button ).addClass('hidden'); } else { /* * Check if there's already a wrapping label, e.g. in the Customizer. * If there's no label, add a default one to match the Customizer template. */ if ( ! el.parent( 'label' ).length ) { // Wrap the input field in the default label. el.wrap( _wrappingLabel ); // Insert the default label text. self.wrappingLabelText = $( _wrappingLabelText ) .insertBefore( el ) .text( wpColorPickerL10n.defaultLabel ); } /* * At this point, either it's the standalone version or the Customizer * one, we have a wrapping label to use as hook in the DOM, let's store it. */ self.wrappingLabel = el.parent(); // Wrap the label in the main wrapper. self.wrappingLabel.wrap( _wrap ); // Store a reference to the main wrapper. self.wrap = self.wrappingLabel.parent(); // Set up the toggle button and insert it before the wrapping label. self.toggler = $( _before ) .insertBefore( self.wrappingLabel ) .css( { backgroundColor: self.initialValue } ); // Set the toggle button span element text. self.toggler.find( '.wp-color-result-text' ).text( wpColorPickerL10n.pick ); // Set up the Iris container and insert it after the wrapping label. self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel ); // Store a reference to the Clear/Default button. self.button = $( _button ); } // Set up the Clear/Default button. if ( self.options.defaultColor ) { self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString ); if ( ! _deprecated ) { self.button.attr( 'aria-label', wpColorPickerL10n.defaultAriaLabel ); } } else { self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear ); if ( ! _deprecated ) { self.button.attr( 'aria-label', wpColorPickerL10n.clearAriaLabel ); } } if ( _deprecated ) { el.wrap( '<span class="wp-picker-input-wrap" />' ).after( self.button ); } else { // Wrap the wrapping label in its wrapper and append the Clear/Default button. self.wrappingLabel .wrap( '<span class="wp-picker-input-wrap hidden" />' ) .after( self.button ); /* * The input wrapper now contains the label+input+Clear/Default button. * Store a reference to the input wrapper: we'll use this to toggle * the controls visibility. */ self.inputWrapper = el.closest( '.wp-picker-input-wrap' ); } el.iris( { target: self.pickerContainer, hide: self.options.hide, width: self.options.width, mode: self.options.mode, palettes: self.options.palettes, /** * @summary Handles the onChange event if one has been defined in the options. * * Handles the onChange event if one has been defined in the options and additionally * sets the background color for the toggler element. * * @since 3.5.0 * * @param {Event} event The event that's being called. * @param {HTMLElement} ui The HTMLElement containing the color picker. * * @returns {void} */ change: function( event, ui ) { if ( self.options.alpha ) { self.toggler.css( { 'background-image' : 'url(' + image + ')' } ); if ( _deprecated ) { self.toggler.html( '<span class="color-alpha" />' ); } else { self.toggler.css( { 'position' : 'relative' } ); if ( self.toggler.find('span.color-alpha').length == 0 ) { self.toggler.append('<span class="color-alpha" />'); } } self.toggler.find( 'span.color-alpha' ).css( { 'width' : '30px', 'height' : '28px', 'position' : 'absolute', 'top' : 0, 'left' : 0, 'border-top-left-radius' : '2px', 'border-bottom-left-radius' : '2px', 'background' : ui.color.toString() } ); } else { self.toggler.css( { backgroundColor : ui.color.toString() } ); } if ( $.isFunction( self.options.change ) ) { self.options.change.call( this, event, ui ); } } } ); el.val( self.initialValue ); self._addListeners(); // Force the color picker to always be closed on initial load. if ( ! self.options.hide ) { self.toggler.click(); } }, /** * @summary Binds event listeners to the color picker. * * @since 3.5.0 * * @access private * * @returns {void} */ _addListeners: function() { var self = this; /** * @summary Prevent any clicks inside this widget from leaking to the top and closing it. * * @since 3.5.0 * * @param {Event} event The event that's being called. * * @returs {void} */ self.wrap.on( 'click.wpcolorpicker', function( event ) { event.stopPropagation(); }); /** * @summary Open or close the color picker depending on the class. * * @since 3.5 */ self.toggler.click( function(){ if ( self.toggler.hasClass( 'wp-picker-open' ) ) { self.close(); } else { self.open(); } }); /** * @summary Checks if value is empty when changing the color in the color picker. * * Checks if value is empty when changing the color in the color picker. * If so, the background color is cleared. * * @since 3.5.0 * * @param {Event} event The event that's being called. * * @returns {void} */ self.element.on( 'change', function( event ) { // Empty or Error = clear if ( $( this ).val() === '' || self.element.hasClass( 'iris-error' ) ) { if ( self.options.alpha ) { if ( _deprecated ) { self.toggler.removeAttr( 'style' ); } self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' ); } else { self.toggler.css( 'backgroundColor', '' ); } // fire clear callback if we have one if ( $.isFunction( self.options.clear ) ) self.options.clear.call( this, event ); } } ); /** * @summary Enables the user to clear or revert the color in the color picker. * * Enables the user to either clear the color in the color picker or revert back to the default color. * * @since 3.5.0 * * @param {Event} event The event that's being called. * * @returns {void} */ self.button.on( 'click', function( event ) { if ( $( this ).hasClass( 'wp-picker-clear' ) ) { self.element.val( '' ); if ( self.options.alpha ) { if ( _deprecated ) { self.toggler.removeAttr( 'style' ); } self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' ); } else { self.toggler.css( 'backgroundColor', '' ); } if ( $.isFunction( self.options.clear ) ) self.options.clear.call( this, event ); self.element.trigger( 'change' ); } else if ( $( this ).hasClass( 'wp-picker-default' ) ) { self.element.val( self.options.defaultColor ).change(); } }); }, }); /** * Overwrite iris */ $.widget( 'a8c.iris', $.a8c.iris, { _create: function() { this._super(); // Global option for check is mode rbga is enabled this.options.alpha = this.element.data( 'alpha' ) || false; // Is not input disabled if ( ! this.element.is( ':input' ) ) this.options.alpha = false; if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) { var self = this, el = self.element, _html = '<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>', aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ), aSlider = aContainer.find( '.iris-slider-offset-alpha' ), controls = { aContainer : aContainer, aSlider : aSlider }; if ( typeof el.data( 'custom-width' ) !== 'undefined' ) { self.options.customWidth = parseInt( el.data( 'custom-width' ) ) || 0; } else { self.options.customWidth = 100; } // Set default width for input reset self.options.defaultWidth = el.width(); // Update width for input if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != -1 ) el.width( parseInt( 88 ) ); // Push new controls $.each( controls, function( k, v ) { self.controls[k] = v; } ); // Change size strip and add margin for sliders self.controls.square.css( { 'margin-right': '0' } ); var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ), stripsMargin = ( emptyWidth / 6 ), stripsWidth = ( ( emptyWidth / 2 ) - stripsMargin ); $.each( [ 'aContainer', 'strip' ], function( k, v ) { self.controls[v].width( stripsWidth ).css( { 'margin-left' : stripsMargin + 'px' } ); } ); // Add new slider self._initControls(); // For updated widget self._change(); } }, _initControls: function() { this._super(); if ( this.options.alpha ) { var self = this, controls = self.controls; controls.aSlider.slider({ orientation : 'vertical', min : 0, max : 100, step : 1, value : parseInt( self._color._alpha * 100 ), slide : function( event, ui ) { // Update alpha value self._color._alpha = parseFloat( ui.value / 100 ); self._change.apply( self, arguments ); } }); } }, _change: function() { this._super(); var self = this, el = self.element; if ( this.options.alpha ) { var controls = self.controls, alpha = parseInt( self._color._alpha * 100 ), color = self._color.toRgb(), gradient = [ 'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%', 'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%' ], defaultWidth = self.options.defaultWidth, customWidth = self.options.customWidth, target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' ); // Generate background slider alpha, only for CSS3 old browser fuck!! :) controls.aContainer.css( { 'background' : 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' } ); if ( target.hasClass( 'wp-picker-open' ) ) { // Update alpha value controls.aSlider.slider( 'value', alpha ); /** * Disabled change opacity in default slider Saturation ( only is alpha enabled ) * and change input width for view all value */ if ( self._color._alpha < 1 ) { controls.strip.attr( 'style', controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' ) ); el.width( parseInt( 88 ) ); } else { el.width( defaultWidth ); } } } var reset = el.data( 'reset-alpha' ) || false; if ( reset ) { self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() { self._color._alpha = 1; self.active = 'external'; self._change(); } ); } el.trigger( 'change' ); }, _addInputListeners: function( input ) { var self = this, debounceTimeout = 100, callback = function( event ) { var color = new Color( input.val() ), val = input.val(); input.removeClass( 'iris-error' ); // we gave a bad color if ( color.error ) { // don't error on an empty input if ( val !== '' ) input.addClass( 'iris-error' ); } else { if ( color.toString() !== self._color.toString() ) { // let's not do this on keyup for hex shortcodes if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) ) self._setOption( 'color', color.toString() ); } } }; input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) ); // If we initialized hidden, show on first focus. The rest is up to you. if ( self.options.hide ) { input.on( 'focus', function() { self.show(); } ); } } } ); }( jQuery ) ); // Auto Call plugin is class is color-picker jQuery( document ).ready( function( $ ) { $( '.color-picker' ).wpColorPicker(); } ); customizer-controls-toggle.js 0000666 00000005263 15214245400 0012435 0 ustar 00 /** * Customizer controls toggles * * @package Astra */ ( function( $ ) { /* Internal shorthand */ var api = wp.customize; /** * Trigger hooks */ ASTControlTrigger = { /** * Trigger a hook. * * @since 1.0.0 * @method triggerHook * @param {String} hook The hook to trigger. * @param {Array} args An array of args to pass to the hook. */ triggerHook: function( hook, args ) { $( 'body' ).trigger( 'astra-control-trigger.' + hook, args ); }, /** * Add a hook. * * @since 1.0.0 * @method addHook * @param {String} hook The hook to add. * @param {Function} callback A function to call when the hook is triggered. */ addHook: function( hook, callback ) { $( 'body' ).on( 'astra-control-trigger.' + hook, callback ); }, /** * Remove a hook. * * @since 1.0.0 * @method removeHook * @param {String} hook The hook to remove. * @param {Function} callback The callback function to remove. */ removeHook: function( hook, callback ) { $( 'body' ).off( 'astra-control-trigger.' + hook, callback ); }, }; /** * Helper class that contains data for showing and hiding controls. * * @since 1.0.0 * @class ASTCustomizerToggles */ ASTCustomizerToggles = { 'astra-settings[display-site-title]' : [], 'astra-settings[display-site-tagline]' : [], 'astra-settings[ast-header-retina-logo]' :[], 'custom_logo' : [], /** * Section - Header * * @link ?autofocus[section]=section-header */ /** * Layout 2 */ // Layout 2 > Right Section > Text / HTML // Layout 2 > Right Section > Search Type // Layout 2 > Right Section > Search Type > Search Box Type. 'astra-settings[header-main-rt-section]' : [], 'astra-settings[hide-custom-menu-mobile]' :[], /** * Blog */ 'astra-settings[blog-width]' :[], 'astra-settings[blog-post-structure]' :[], /** * Blog Single */ 'astra-settings[blog-single-post-structure]' : [], 'astra-settings[blog-single-width]' : [], 'astra-settings[blog-single-meta]' :[], /** * Small Footer */ 'astra-settings[footer-sml-layout]' : [], 'astra-settings[footer-sml-section-1]' :[], 'astra-settings[footer-sml-section-2]' :[], 'astra-settings[footer-sml-divider]' :[], 'astra-settings[header-main-sep]' :[], 'astra-settings[disable-primary-nav]' :[], /** * Footer Widgets */ 'astra-settings[footer-adv]' :[], 'astra-settings[shop-archive-width]' :[], 'astra-settings[mobile-header-logo]' :[], 'astra-settings[different-mobile-logo]' :[], }; } )( jQuery ); navigation.js 0000666 00000046747 15214245400 0007264 0 ustar 00 /** * File navigation.js * * Handles toggling the navigation menu for small screens and enables tab * support for dropdown menus. * * @package Astra */ /** * Get all of an element's parent elements up the DOM tree * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var getParents = function ( elem, selector ) { // Element.matches() polyfill. if ( ! Element.prototype.matches) { Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function(s) { var matches = (this.document || this.ownerDocument).querySelectorAll( s ), i = matches.length; while (--i >= 0 && matches.item( i ) !== this) {} return i > -1; }; } // Setup parents array. var parents = []; // Get matching parent elements. for ( ; elem && elem !== document; elem = elem.parentNode ) { // Add matching parents to array. if ( selector ) { if ( elem.matches( selector ) ) { parents.push( elem ); } } else { parents.push( elem ); } } return parents; }; /** * Toggle Class funtion * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var toggleClass = function ( el, className ) { if ( el.classList.contains( className ) ) { el.classList.remove( className ); } else { el.classList.add( className ); } }; // CustomEvent() constructor functionality in Internet Explorer 9 and higher. (function () { if (typeof window.CustomEvent === "function") return false; function CustomEvent(event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; })(); /** * Trigget custom JS Event. * * @since 1.4.6 * * @link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent * @param {Node} el Dom Node element on which the event is to be triggered. * @param {Node} typeArg A DOMString representing the name of the event. * @param {String} A CustomEventInit dictionary, having the following fields: * "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event. */ var astraTriggerEvent = function astraTriggerEvent( el, typeArg ) { var customEventInit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var event = new CustomEvent(typeArg, customEventInit); el.dispatchEvent(event); }; ( function() { var menu_toggle_all = document.querySelectorAll( '.main-header-menu-toggle' ); var menu_click_listeners = {}; /* Add break point Class and related trigger */ var updateHeaderBreakPoint = function () { // Content overrflowing out of screen can give incorrect window.innerWidth. // Adding overflow hidden and then calculating the window.innerWidth fixes the problem. var originalOverflow = document.querySelector('body').style.overflow; document.querySelector('body').style.overflow = 'hidden'; var ww = window.innerWidth; document.querySelector('body').style.overflow = originalOverflow; var break_point = astra.break_point, headerWrap = document.querySelectorAll('.main-header-bar-wrap'); if (headerWrap.length > 0) { for (var i = 0; i < headerWrap.length; i++) { if (headerWrap[i].tagName == 'DIV' && headerWrap[i].classList.contains('main-header-bar-wrap')) { if (ww > break_point) { //remove menu toggled class. if (null != menu_toggle_all[i]) { menu_toggle_all[i].classList.remove('toggled'); } document.body.classList.remove("ast-header-break-point"); document.body.classList.add("ast-desktop"); astraTriggerEvent(document.body, "astra-header-responsive-enabled"); } else { document.body.classList.add("ast-header-break-point"); document.body.classList.remove("ast-desktop"); astraTriggerEvent(document.body, "astra-header-responsive-disabled") } } } } } updateHeaderBreakPoint(); AstraToggleSubMenu = function() { var parent_li = this.parentNode; if (parent_li.classList.contains('ast-submenu-expanded') && document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) { if (!this.classList.contains('ast-menu-toggle')) { var link = parent_li.querySelector('a').getAttribute('href'); if ('' !== link || '#' !== link) { window.location = link; } } } var parent_li_child = parent_li.querySelectorAll('.menu-item-has-children, .page_item_has_children'); for (var j = 0; j < parent_li_child.length; j++) { parent_li_child[j].classList.remove('ast-submenu-expanded'); var parent_li_child_sub_menu = parent_li_child[j].querySelector('.sub-menu, .children'); parent_li_child_sub_menu.style.display = 'none'; }; var parent_li_sibling = parent_li.parentNode.querySelectorAll('.menu-item-has-children, .page_item_has_children'); for (var j = 0; j < parent_li_sibling.length; j++) { if (parent_li_sibling[j] != parent_li) { parent_li_sibling[j].classList.remove('ast-submenu-expanded'); var all_sub_menu = parent_li_sibling[j].querySelectorAll('.sub-menu, .children'); for (var k = 0; k < all_sub_menu.length; k++) { all_sub_menu[k].style.display = 'none'; }; } }; if (parent_li.classList.contains('menu-item-has-children') || parent_li.classList.contains('page_item_has_children')) { toggleClass(parent_li, 'ast-submenu-expanded'); if (parent_li.classList.contains('ast-submenu-expanded')) { parent_li.querySelector('.sub-menu, .children').style.display = 'block'; } else { parent_li.querySelector('.sub-menu, .children').style.display = 'none'; } } }; AstraNavigationMenu = function( parentList ) { console.warn( 'AstraNavigationMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future.' ); }; AstraToggleMenu = function( astra_menu_toggle ) { console.warn('AstraToggleMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future. Use AstraToggleSubMenu() instead.'); // Add Eventlisteners for Submenu. if (astra_menu_toggle.length > 0) { for (var i = 0; i < astra_menu_toggle.length; i++) { astra_menu_toggle[i].addEventListener('click', AstraToggleSubMenu, false); }; } }; AstraToggleSetup = function () { var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); if (menu_toggle_all.length > 0) { for (var i = 0; i < menu_toggle_all.length; i++) { menu_toggle_all[i].setAttribute('data-index', i); if ( ! menu_click_listeners[i] ) { menu_click_listeners[i] = menu_toggle_all[i]; menu_toggle_all[i].addEventListener('click', astraNavMenuToggle, false); } if ('undefined' !== typeof __main_header_all[i]) { if (document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) { var astra_menu_toggle = __main_header_all[i].querySelectorAll('.ast-header-break-point .main-header-menu .menu-item-has-children > a, .ast-header-break-point .main-header-menu .page_item_has_children > a, .ast-header-break-point ul.main-header-menu .ast-menu-toggle'); } else { var astra_menu_toggle = __main_header_all[i].querySelectorAll('ul.main-header-menu .ast-menu-toggle'); } // Add Eventlisteners for Submenu. if (astra_menu_toggle.length > 0) { for (var j = 0; j < astra_menu_toggle.length; j++) { astra_menu_toggle[j].addEventListener('click', AstraToggleSubMenu, false); }; } } }; } }; astraNavMenuToggle = function ( event ) { event.preventDefault(); var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); var event_index = this.getAttribute('data-index'); if ('undefined' === typeof __main_header_all[event_index]) { return false; } var menuHasChildren = __main_header_all[event_index].querySelectorAll('.menu-item-has-children, .page_item_has_children'); for (var i = 0; i < menuHasChildren.length; i++) { menuHasChildren[i].classList.remove('ast-submenu-expanded'); var menuHasChildrenSubMenu = menuHasChildren[i].querySelectorAll('.sub-menu, .children'); for (var j = 0; j < menuHasChildrenSubMenu.length; j++) { menuHasChildrenSubMenu[j].style.display = 'none'; }; } var menu_class = this.getAttribute('class') || ''; if ( menu_class.indexOf('main-header-menu-toggle') !== -1 ) { toggleClass(__main_header_all[event_index], 'toggle-on'); toggleClass(menu_toggle_all[event_index], 'toggled'); if (__main_header_all[event_index].classList.contains('toggle-on')) { __main_header_all[event_index].style.display = 'block'; document.body.classList.add("ast-main-header-nav-open"); } else { __main_header_all[event_index].style.display = ''; document.body.classList.remove("ast-main-header-nav-open"); } } }; document.body.addEventListener("astra-header-responsive-enabled", function () { var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); if (__main_header_all.length > 0) { for (var i = 0; i < __main_header_all.length; i++) { if (null != __main_header_all[i]) { __main_header_all[i].classList.remove('toggle-on'); __main_header_all[i].style.display = ''; } var sub_menu = __main_header_all[i].getElementsByClassName('sub-menu'); for (var j = 0; j < sub_menu.length; j++) { sub_menu[j].style.display = ''; } var child_menu = __main_header_all[i].getElementsByClassName('children'); for (var k = 0; k < child_menu.length; k++) { child_menu[k].style.display = ''; } var searchIcons = __main_header_all[i].getElementsByClassName('ast-search-menu-icon'); for (var l = 0; l < searchIcons.length; l++) { searchIcons[l].classList.remove('ast-dropdown-active'); searchIcons[l].style.display = ''; } } } }, false); window.addEventListener('resize', function () { // Skip resize event when keyboard display event triggers on devices. if( 'INPUT' !== document.activeElement.tagName ) { updateHeaderBreakPoint(); AstraToggleSetup(); } }); document.addEventListener('DOMContentLoaded', function () { AstraToggleSetup(); /** * Navigation Keyboard Navigation. */ var container, button, menu, links, subMenus, i, len, count; container = document.querySelectorAll( '.navigation-accessibility' ); for ( count = 0; count <= container.length - 1; count++ ) { if ( container[count] ) { navigation_accessibility( container[count] ); } } }); var get_browser = function () { var ua = navigator.userAgent,tem,M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; if(/trident/i.test(M[1])) { tem = /\brv[ :]+(\d+)/g.exec(ua) || []; return; } if( 'Chrome' === M[1] ) { tem = ua.match(/\bOPR|Edge\/(\d+)/) if(tem != null) { return; } } M = M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?']; if((tem = ua.match(/version\/(\d+)/i)) != null) { M.splice(1,1,tem[1]); } bodyElement = document.body; if( 'Safari' === M[0] && M[1] < 11 ) { bodyElement.classList.add( "ast-safari-browser-less-than-11" ); } } get_browser(); /* Search Script */ var SearchIcons = document.getElementsByClassName( 'astra-search-icon' ); for (var i = 0; i < SearchIcons.length; i++) { SearchIcons[i].onclick = function(event) { if ( this.classList.contains( 'slide-search' ) ) { event.preventDefault(); var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); if ( ! sibling.classList.contains( 'ast-dropdown-active' ) ) { sibling.classList.add( 'ast-dropdown-active' ); sibling.querySelector( '.search-field' ).setAttribute('autocomplete','off'); setTimeout(function() { sibling.querySelector( '.search-field' ).focus(); },200); } else { var searchTerm = sibling.querySelector( '.search-field' ).value || ''; if( '' !== searchTerm ) { sibling.querySelector( '.search-form' ).submit(); } sibling.classList.remove( 'ast-dropdown-active' ); } } } }; /* Hide Dropdown on body click*/ document.body.onclick = function( event ) { if ( typeof event.target.classList !== 'undefined' ) { if ( ! event.target.classList.contains( 'ast-search-menu-icon' ) && getParents( event.target, '.ast-search-menu-icon' ).length === 0 && getParents( event.target, '.ast-search-icon' ).length === 0 ) { var dropdownSearchWrap = document.getElementsByClassName( 'ast-search-menu-icon' ); for (var i = 0; i < dropdownSearchWrap.length; i++) { dropdownSearchWrap[i].classList.remove( 'ast-dropdown-active' ); }; } } } /** * Navigation Keyboard Navigation. */ function navigation_accessibility( container ) { if ( ! container ) { return; } button = container.getElementsByTagName( 'button' )[0]; if ( 'undefined' === typeof button ) { button = container.getElementsByTagName( 'a' )[0]; if ( 'undefined' === typeof button ) { return; } } menu = container.getElementsByTagName( 'ul' )[0]; // Hide menu toggle button if menu is empty and return early. if ( 'undefined' === typeof menu ) { button.style.display = 'none'; return; } menu.setAttribute( 'aria-expanded', 'false' ); if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { menu.className += ' nav-menu'; } button.onclick = function() { if ( -1 !== container.className.indexOf( 'toggled' ) ) { container.className = container.className.replace( ' toggled', '' ); button.setAttribute( 'aria-expanded', 'false' ); menu.setAttribute( 'aria-expanded', 'false' ); } else { container.className += ' toggled'; button.setAttribute( 'aria-expanded', 'true' ); menu.setAttribute( 'aria-expanded', 'true' ); } }; // Get all the link elements within the menu. links = menu.getElementsByTagName( 'a' ); subMenus = menu.getElementsByTagName( 'ul' ); // Set menu items with submenus to aria-haspopup="true". for ( i = 0, len = subMenus.length; i < len; i++ ) { subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' ); } // Each time a menu link is focused or blurred, toggle focus. for ( i = 0, len = links.length; i < len; i++ ) { links[i].addEventListener( 'focus', toggleFocus, true ); links[i].addEventListener( 'blur', toggleBlurFocus, true ); links[i].addEventListener( 'click', toggleClose, true ); } } /** * Close the Toggle Menu on Click on hash (#) link. * * @since 1.3.2 * @return void */ function toggleClose( ) { var self = this || '', hash = '#'; if( self && ! self.classList.contains('astra-search-icon') ) { var link = new String( self ); if( link.indexOf( hash ) !== -1 ) { var link_parent = self.parentNode; if ( document.body.classList.contains('ast-header-break-point') && ! ( document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link") && link_parent.classList.contains("menu-item-has-children") ) ) { /* Close Main Header Menu */ var main_header_menu_toggle = document.querySelector( '.main-header-menu-toggle' ); main_header_menu_toggle.classList.remove( 'toggled' ); var main_header_bar_navigation = document.querySelector( '.main-header-bar-navigation' ); main_header_bar_navigation.classList.remove( 'toggle-on' ); main_header_bar_navigation.style.display = 'none'; /* Close Below Header Menu */ var before_header_menu_toggle = document.querySelector( '.menu-below-header-toggle' ); var before_header_bar_navigation = document.querySelector( '.ast-below-header' ); var before_header_bar = document.querySelector( '.ast-below-header-actual-nav' ); if ( before_header_menu_toggle && before_header_bar_navigation && before_header_bar ) { before_header_menu_toggle.classList.remove( 'toggled' ); before_header_bar_navigation.classList.remove( 'toggle-on' ); before_header_bar.style.display = 'none'; } /* Close After Header Menu */ var after_header_menu_toggle = document.querySelector( '.menu-above-header-toggle' ); var after_header_bar_navigation = document.querySelector( '.ast-above-header' ); var after_header_bar = document.querySelector( '.ast-above-header-navigation' ); if ( after_header_menu_toggle && after_header_bar_navigation && after_header_bar ) { after_header_menu_toggle.classList.remove( 'toggled' ); after_header_bar_navigation.classList.remove( 'toggle-on' ); after_header_bar.style.display = 'none'; } astraTriggerEvent( document.querySelector('body'), 'astraMenuHashLinkClicked' ); } else { while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } } self = self.parentElement; } } } } } /** * Sets or removes .focus class on an element on focus. */ function toggleFocus() { var self = this; // Move up through the ancestors of the current link until we hit .nav-menu. while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } else { self.className += ' focus'; } } self = self.parentElement; } } /** * Sets or removes .focus class on an element on blur. */ function toggleBlurFocus() { var self = this || '', hash = '#'; link = new String( self ); if( link.indexOf( hash ) !== -1 && document.body.classList.contains('ast-mouse-clicked') ) { return; } // Move up through the ancestors of the current link until we hit .nav-menu. while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } else { self.className += ' focus'; } } self = self.parentElement; } } /* Add class if mouse clicked and remove if tab pressed */ if ( 'querySelector' in document && 'addEventListener' in window ) { var body = document.body; body.addEventListener( 'mousedown', function() { body.classList.add( 'ast-mouse-clicked' ); } ); body.addEventListener( 'keydown', function() { body.classList.remove( 'ast-mouse-clicked' ); } ); } } )(); customizer-preview.js 0000666 00000161054 15214245400 0010775 0 ustar 00 /** * This file adds some LIVE to the Theme Customizer live preview. To leverage * this, set your custom settings to 'postMessage' and then add your handling * here. Your javascript should grab settings from customizer controls, and * then make any necessary changes to the page using jQuery. * * @package Astra */ /** * Generate font size in PX & REM */ function astra_font_size_rem( size, with_rem, device ) { var css = ''; if( size != '' ) { var device = ( typeof device != undefined ) ? device : 'desktop'; // font size with 'px'. css = 'font-size: ' + size + 'px;'; // font size with 'rem'. if ( with_rem ) { var body_font_size = wp.customize( 'astra-settings[font-size-body]' ).get(); body_font_size['desktop'] = ( body_font_size['desktop'] != '' ) ? body_font_size['desktop'] : 15; body_font_size['tablet'] = ( body_font_size['tablet'] != '' ) ? body_font_size['tablet'] : body_font_size['desktop']; body_font_size['mobile'] = ( body_font_size['mobile'] != '' ) ? body_font_size['mobile'] : body_font_size['tablet']; css += 'font-size: ' + ( size / body_font_size[device] ) + 'rem;'; } } return css; } /** * Apply CSS for the element */ function astra_color_responsive_css( addon, control, css_property, selector ) { wp.customize( control, function( value ) { value.bind( function( value ) { if ( value.desktop || value.mobile || value.tablet ) { // Remove <style> first! control = control.replace( '[', '-' ); control = control.replace( ']', '' ); jQuery( 'style#' + control + '-' + addon ).remove(); var DeskVal = '', TabletFontVal = '', MobileVal = ''; if ( '' != value.desktop ) { DeskVal = css_property + ': ' + value.desktop; } if ( '' != value.tablet ) { TabletFontVal = css_property + ': ' + value.tablet; } if ( '' != value.mobile ) { MobileVal = css_property + ': ' + value.mobile; } // Concat and append new <style>. jQuery( 'head' ).append( '<style id="' + control + '-' + addon + '">' + selector + ' { ' + DeskVal + ' }' + '@media (max-width: 768px) {' + selector + ' { ' + TabletFontVal + ' } }' + '@media (max-width: 544px) {' + selector + ' { ' + MobileVal + ' } }' + '</style>' ); } else { wp.customize.preview.send( 'refresh' ); jQuery( 'style#' + control + '-' + addon ).remove(); } } ); } ); } /** * Responsive Font Size CSS */ function astra_responsive_font_size( control, selector ) { wp.customize( control, function( value ) { value.bind( function( value ) { if ( value.desktop || value.mobile || value.tablet ) { // Remove <style> first! control = control.replace( '[', '-' ); control = control.replace( ']', '' ); jQuery( 'style#' + control + '-' + css_property ).remove(); var fontSize = '', tabletFontSize = '', mobileFontSize = '', css_property = 'font-size'; if ( '' != value.desktop ) { fontSize = 'font-size: ' + value.desktop + value['desktop-unit']; } if ( '' != value.tablet ) { tabletFontSize = 'font-size: ' + value.tablet + value['tablet-unit']; } if ( '' != value.mobile ) { mobileFontSize = 'font-size: ' + value.mobile + value['mobile-unit']; } if( value['desktop-unit'] == 'px' ) { fontSize = astra_font_size_rem( value.desktop, true, 'desktop' ); } // Concat and append new <style>. jQuery( 'head' ).append( '<style id="' + control + '-' + css_property + '">' + selector + ' { ' + fontSize + ' }' + '@media (max-width: 768px) {' + selector + ' { ' + tabletFontSize + ' } }' + '@media (max-width: 544px) {' + selector + ' { ' + mobileFontSize + ' } }' + '</style>' ); } else { jQuery( 'style#' + control ).remove(); } } ); } ); } /** * Responsive Spacing CSS */ function astra_responsive_spacing( control, selector, type, side ) { wp.customize( control, function( value ) { value.bind( function( value ) { var sidesString = ""; var spacingType = "padding"; if ( value.desktop.top || value.desktop.right || value.desktop.bottom || value.desktop.left || value.tablet.top || value.tablet.right || value.tablet.bottom || value.tablet.left || value.mobile.top || value.mobile.right || value.mobile.bottom || value.mobile.left ) { if ( typeof side != undefined ) { sidesString = side + ""; sidesString = sidesString.replace(/,/g , "-"); } if ( typeof type != undefined ) { spacingType = type + ""; } // Remove <style> first! control = control.replace( '[', '-' ); control = control.replace( ']', '' ); jQuery( 'style#' + control + '-' + spacingType + '-' + sidesString ).remove(); var desktopPadding = '', tabletPadding = '', mobilePadding = ''; var paddingSide = ( typeof side != undefined ) ? side : [ 'top','bottom','right','left' ]; jQuery.each(paddingSide, function( index, sideValue ){ if ( '' != value['desktop'][sideValue] ) { desktopPadding += spacingType + '-' + sideValue +': ' + value['desktop'][sideValue] + value['desktop-unit'] +';'; } }); jQuery.each(paddingSide, function( index, sideValue ){ if ( '' != value['tablet'][sideValue] ) { tabletPadding += spacingType + '-' + sideValue +': ' + value['tablet'][sideValue] + value['tablet-unit'] +';'; } }); jQuery.each(paddingSide, function( index, sideValue ){ if ( '' != value['mobile'][sideValue] ) { mobilePadding += spacingType + '-' + sideValue +': ' + value['mobile'][sideValue] + value['mobile-unit'] +';'; } }); // Concat and append new <style>. jQuery( 'head' ).append( '<style id="' + control + '-' + spacingType + '-' + sidesString + '">' + selector + ' { ' + desktopPadding +' }' + '@media (max-width: 768px) {' + selector + ' { ' + tabletPadding + ' } }' + '@media (max-width: 544px) {' + selector + ' { ' + mobilePadding + ' } }' + '</style>' ); } else { wp.customize.preview.send( 'refresh' ); jQuery( 'style#' + control + '-' + spacingType + '-' + sidesString ).remove(); } } ); } ); } /** * CSS */ function astra_css_font_size( control, selector ) { wp.customize( control, function( value ) { value.bind( function( size ) { if ( size ) { // Remove <style> first! control = control.replace( '[', '-' ); control = control.replace( ']', '' ); jQuery( 'style#' + control ).remove(); var fontSize = 'font-size: ' + size; if ( ! isNaN( size ) || size.indexOf( 'px' ) >= 0 ) { size = size.replace( 'px', '' ); fontSize = astra_font_size_rem( size, true ); } // Concat and append new <style>. jQuery( 'head' ).append( '<style id="' + control + '">' + selector + ' { ' + fontSize + ' }' + '</style>' ); } else { jQuery( 'style#' + control ).remove(); } } ); } ); } /** * Return get_hexdec() */ function get_hexdec( hex ) { var hexString = hex.toString( 16 ); return parseInt( hexString, 16 ); } /** * Apply CSS for the element */ function astra_css( control, css_property, selector, unit ) { wp.customize( control, function( value ) { value.bind( function( new_value ) { // Remove <style> first! control = control.replace( '[', '-' ); control = control.replace( ']', '' ); if ( new_value ) { /** * If ( unit == 'url' ) then = url('{VALUE}') * If ( unit == 'px' ) then = {VALUE}px * If ( unit == 'em' ) then = {VALUE}em * If ( unit == 'rem' ) then = {VALUE}rem. */ if ( 'undefined' != typeof unit) { if ( 'url' === unit ) { new_value = 'url(' + new_value + ')'; } else { new_value = new_value + unit; } } // Remove old. jQuery( 'style#' + control + '-' + css_property ).remove(); // Concat and append new <style>. jQuery( 'head' ).append( '<style id="' + control + '-' + css_property + '">' + selector + ' { ' + css_property + ': ' + new_value + ' }' + '</style>' ); } else { // Remove old. jQuery( 'style#' + control ).remove(); } } ); } ); } /** * Dynamic Internal/Embedded Style for a Control */ function astra_add_dynamic_css( control, style ) { control = control.replace( '[', '-' ); control = control.replace( ']', '' ); jQuery( 'style#' + control ).remove(); jQuery( 'head' ).append( '<style id="' + control + '">' + style + '</style>' ); } /** * Generate background_obj CSS */ function astra_background_obj_css( wp_customize, bg_obj, ctrl_name, style ) { var gen_bg_css = ''; var bg_img = bg_obj['background-image']; var bg_color = bg_obj['background-color']; if( '' === bg_color && '' === bg_img ) { wp_customize.preview.send( 'refresh' ); }else{ if ( '' !== bg_img && '' !== bg_color) { if ( undefined !== bg_color ) { gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_img + ');'; } }else if ( '' !== bg_img ) { gen_bg_css = 'background-image: url(' + bg_img + ');'; }else if ( '' !== bg_color ) { gen_bg_css = 'background-color: ' + bg_color + ';'; gen_bg_css += 'background-image: none;'; } if ( '' !== bg_img ) { gen_bg_css += 'background-repeat: ' + bg_obj['background-repeat'] + ';'; gen_bg_css += 'background-position: ' + bg_obj['background-position'] + ';'; gen_bg_css += 'background-size: ' + bg_obj['background-size'] + ';'; gen_bg_css += 'background-attachment: ' + bg_obj['background-attachment'] + ';'; } var dynamicStyle = style.replace( "{{css}}", gen_bg_css ); astra_add_dynamic_css( ctrl_name, dynamicStyle ); } } /** * Apply CSS for the element */ function astra_apply_background_css(group, subControl, selector ) { wp.customize(group, function (control) { control.bind(function (value, oldValue) { var parse_bg_obj = JSON.parse(value); bg_obj = parse_bg_obj[subControl]; if ( '' === bg_obj || undefined === bg_obj ) { return; } jQuery( 'style#' + subControl ).remove(); var gen_bg_css = ''; var bg_img = bg_obj['background-image']; var bg_color = bg_obj['background-color']; if ('' !== bg_img && '' !== bg_color) { if (undefined !== bg_color) { gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_img + ');'; } } else if ('' !== bg_img) { gen_bg_css = 'background-image: url(' + bg_img + ');'; } else if ('' !== bg_color) { gen_bg_css = 'background-color: ' + bg_color + ';'; } if ('' == bg_img) { gen_bg_css += 'background-image: none;'; } else { gen_bg_css += 'background-repeat: ' + bg_obj['background-repeat'] + ';'; gen_bg_css += 'background-position: ' + bg_obj['background-position'] + ';'; gen_bg_css += 'background-size: ' + bg_obj['background-size'] + ';'; gen_bg_css += 'background-attachment: ' + bg_obj['background-attachment'] + ';'; } var dynamicStyle = '<style id="' + subControl + '">' + selector + ' { ' + gen_bg_css + ' }' + '</style>' // Concat and append new <style>. jQuery('head').append( dynamicStyle ); }); }); } /* * Generate Font Family CSS */ function astra_generate_outside_font_family_css( control, selector ) { wp.customize( control, function (value) { value.bind( function ( value, oldValue ) { var cssProperty = 'font-family'; var link = ''; var fontName = value.split(",")[0]; fontName = fontName.replace(/'/g, ''); // Remove <style> first! control = control.replace( '[', '-' ); control = control.replace( ']', '' ); jQuery('style#' + control + '-' + cssProperty ).remove(); if ( fontName in astraCustomizer.googleFonts ) { // Remove old. var fontName = fontName.split(' ').join('+'); jQuery('link#' + control).remove(); link = '<link id="' + control + '" href="https://fonts.googleapis.com/css?family=' + fontName + '" rel="stylesheet">'; } // Concat and append new <style> and <link>. jQuery('head').append( '<style id="' + control + '-' + cssProperty + '">' + selector + ' { ' + cssProperty + ': ' + value + ' }' + '</style>' + link ); }); }); } /* * Generate Font Weight CSS */ function astra_generate_font_weight_css( font_control, control, css_property, selector ) { wp.customize( control, function( value ) { value.bind( function( new_value ) { control = control.replace( '[', '-' ); control = control.replace( ']', '' ); if ( new_value ) { /** * If ( unit == 'url' ) then = url('{VALUE}') * If ( unit == 'px' ) then = {VALUE}px * If ( unit == 'em' ) then = {VALUE}em * If ( unit == 'rem' ) then = {VALUE}rem. */ if ( 'undefined' != typeof unit) { if ( 'url' === unit ) { new_value = 'url(' + new_value + ')'; } else { new_value = new_value + unit; } } fontName = wp.customize._value[font_control]._value; fontName = fontName.split(','); fontName = fontName[0].replace( /'/g, '' ); // Remove old. jQuery( 'style#' + control + '-' + css_property ).remove(); if ( fontName in astraCustomizer.googleFonts ) { // Remove old. jQuery('#' + font_control).remove(); link = '<link id="' + font_control + '" href="https://fonts.googleapis.com/css?family=' + fontName + '" rel="stylesheet">'; } // Concat and append new <style>. jQuery( 'head' ).append( '<style id="' + control + '-' + css_property + '">' + selector + ' { ' + css_property + ': ' + new_value + ' }' + '</style>' + link ); } else { // Remove old. jQuery( 'style#' + control ).remove(); } } ); }); } /** * Apply CSS for the element */ function astra_apply_responsive_background_css( control, selector, device, singleColorSelector, addon ) { wp.customize( control, function( value ) { value.bind( function( bg_obj ) { addon = addon || ''; singleColorSelector = singleColorSelector || ''; addon = ( addon ) ? addon : 'header'; control = control.replace( '[', '-' ); control = control.replace( ']', '' ); if( '' === bg_obj[device] || undefined === bg_obj[device] ){ return; } var gen_bg_css = ''; var bg_img = bg_obj[device]['background-image']; var bg_tab_img = bg_obj['tablet']['background-image']; var bg_desk_img = bg_obj['desktop']['background-image']; var bg_color = bg_obj[device]['background-color']; var tablet_css = ( bg_obj['tablet']['background-image'] ) ? true : false; var desktop_css = ( bg_obj['desktop']['background-image'] ) ? true : false; if ( '' !== bg_img && '' !== bg_color && undefined !== bg_color ) { gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_img + ');'; } else if ( '' !== bg_img ) { gen_bg_css = 'background-image: url(' + bg_img + ');'; } else if ( '' !== bg_color ) { if( 'mobile' === device ) { if( true == desktop_css && true == tablet_css ) { gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_tab_img + ');'; } else if( true == desktop_css ) { gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_desk_img + ');'; } else if( true == tablet_css ) { gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_tab_img + ');'; } else { gen_bg_css = 'background-color: ' + bg_color + ';'; gen_bg_css += 'background-image: none;'; } } else if( 'tablet' === device ) { if( true == desktop_css ) { gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_desk_img + ');'; } else { gen_bg_css = 'background-color: ' + bg_color + ';'; gen_bg_css += 'background-image: none;'; } } else { gen_bg_css = 'background-color: ' + bg_color + ';'; gen_bg_css += 'background-image: none;'; } if( ! selector.includes( singleColorSelector ) ) { selector += ', ' + singleColorSelector; } } if ( '' != bg_img ) { gen_bg_css += 'background-repeat: ' + bg_obj[device]['background-repeat'] + ';'; gen_bg_css += 'background-position: ' + bg_obj[device]['background-position'] + ';'; gen_bg_css += 'background-size: ' + bg_obj[device]['background-size'] + ';'; gen_bg_css += 'background-attachment: ' + bg_obj[device]['background-attachment'] + ';'; } // Remove old. jQuery( 'style#' + control + '-' + device + '-' + addon ).remove(); if ( 'desktop' == device ) { var dynamicStyle = '<style id="' + control + '-' + device + '-' + addon + '">' + selector + ' { ' + gen_bg_css + ' }' + '</style>' } if ( 'tablet' == device ) { var dynamicStyle = '<style id="' + control + '-' + device + '-' + addon + '">' + '@media (max-width: 768px) {' + selector + ' { ' + gen_bg_css + ' } }' + '</style>' } if ( 'mobile' == device ) { var dynamicStyle = '<style id="' + control + '-' + device + '-' + addon + '">' + '@media (max-width: 544px) {' + selector + ' { ' + gen_bg_css + ' } }' + '</style>' } // Concat and append new <style>. jQuery( 'head' ).append( dynamicStyle ); }); }); } function getChangedKey( value, other ) { value = isJsonString(value) ? JSON.parse(value) : value; other = isJsonString(other) ? JSON.parse(other) : other; // Compare two items var compare = function ( item1, item2 ) { // Get the object type var itemType = Object.prototype.toString.call(item1); // If an object or array, compare recursively if (['[object Array]', '[object Object]'].indexOf(itemType) >= 0) { if ('string' == typeof getChangedKey(item1, item2)) { return false; } } // Otherwise, do a simple comparison else { // If the two items are not the same type, return false if (itemType !== Object.prototype.toString.call(item2)) return false; // Else if it's a function, convert to a string and compare // Otherwise, just compare if (itemType === '[object Function]') { if (item1.toString() !== item2.toString()) return false; } else { if (item1 !== item2) return false; } } }; for ( var key in value ) { if ( other.hasOwnProperty(key) && value.hasOwnProperty(key) ) { if ( compare( value[key], other[key] ) === false ) return key; } else { return key; } } // If nothing failed, return true return true; } function isJsonString( str ) { try { JSON.parse(str); } catch (e) { return false; } return true; } ( function( $ ) { /* * Site Identity Logo Width */ wp.customize( 'astra-settings[ast-header-responsive-logo-width]', function( setting ) { setting.bind( function( logo_width ) { if ( logo_width['desktop'] != '' || logo_width['tablet'] != '' || logo_width['mobile'] != '' ) { var dynamicStyle = '#masthead .site-logo-img .custom-logo-link img { max-width: ' + logo_width['desktop'] + 'px;} .astra-logo-svg{width: ' + logo_width['desktop'] + 'px;} @media( max-width: 768px ) { #masthead .site-logo-img .custom-logo-link img { max-width: ' + logo_width['tablet'] + 'px;} .astra-logo-svg{width: ' + logo_width['tablet'] + 'px; } } @media( max-width: 544px ) { .ast-header-break-point .site-branding img, .ast-header-break-point #masthead .site-logo-img .custom-logo-link img { max-width: ' + logo_width['mobile'] + 'px;} .astra-logo-svg{width: ' + logo_width['mobile'] + 'px; } }'; astra_add_dynamic_css( 'ast-header-responsive-logo-width', dynamicStyle ); var mobileLogoStyle = '.ast-header-break-point #masthead .site-logo-img .custom-mobile-logo-link img { max-width: ' + logo_width['tablet'] + 'px; } @media( max-width: 768px ) { .ast-header-break-point #masthead .site-logo-img .custom-mobile-logo-link img { max-width: ' + logo_width['tablet'] + 'px; } @media( max-width: 544px ) { .ast-header-break-point #masthead .site-logo-img .custom-mobile-logo-link img { max-width: ' + logo_width['mobile'] + 'px; }'; astra_add_dynamic_css( 'mobile-header-logo-width', mobileLogoStyle ); } else{ wp.customize.preview.send( 'refresh' ); } } ); } ); /* * Full width layout */ wp.customize( 'astra-settings[site-content-width]', function( setting ) { setting.bind( function( width ) { var dynamicStyle = '@media (min-width: 554px) {'; dynamicStyle += '.ast-container, .fl-builder #content .entry-header { max-width: ' + ( 40 + parseInt( width ) ) + 'px } '; dynamicStyle += '}'; if ( jQuery( 'body' ).hasClass( 'ast-page-builder-template' ) ) { dynamicStyle += '@media (min-width: 554px) {'; dynamicStyle += '.ast-page-builder-template .comments-area { max-width: ' + ( 40 + parseInt( width ) ) + 'px } '; dynamicStyle += '}'; } astra_add_dynamic_css( 'site-content-width', dynamicStyle ); } ); } ); /* * Full width layout */ wp.customize( 'astra-settings[header-main-menu-label]', function( setting ) { setting.bind( function( label ) { if( $('button.main-header-menu-toggle .mobile-menu-wrap .mobile-menu').length > 0 ) { if ( label != '' ) { $('button.main-header-menu-toggle .mobile-menu-wrap .mobile-menu').text(label); } else { $('button.main-header-menu-toggle .mobile-menu-wrap').remove(); } } else { var html = $('button.main-header-menu-toggle').html(); if( '' != label ) { html += '<div class="mobile-menu-wrap"><span class="mobile-menu">'+ label +'</span> </div>'; } $('button.main-header-menu-toggle').html( html ) } } ); } ); /* * Layout Body Background */ astra_apply_responsive_background_css( 'astra-settings[site-layout-outside-bg-obj-responsive]', 'body, .ast-separate-container', 'desktop' ); astra_apply_responsive_background_css( 'astra-settings[site-layout-outside-bg-obj-responsive]', 'body, .ast-separate-container', 'tablet' ); astra_apply_responsive_background_css( 'astra-settings[site-layout-outside-bg-obj-responsive]', 'body, .ast-separate-container', 'mobile' ); /* * Blog Custom Width */ wp.customize( 'astra-settings[blog-max-width]', function( setting ) { setting.bind( function( width ) { var dynamicStyle = '@media all and ( min-width: 921px ) {'; if ( ! jQuery( 'body' ).hasClass( 'ast-woo-shop-archive' ) ) { dynamicStyle += '.blog .site-content > .ast-container,.archive .site-content > .ast-container{ max-width: ' + ( parseInt( width ) ) + 'px } '; } if ( jQuery( 'body' ).hasClass( 'ast-fluid-width-layout' ) ) { dynamicStyle += '.blog .site-content > .ast-container,.archive .site-content > .ast-container{ padding-left:20px; padding-right:20px; } '; } dynamicStyle += '}'; astra_add_dynamic_css( 'blog-max-width', dynamicStyle ); } ); } ); /* * Single Blog Custom Width */ wp.customize( 'astra-settings[blog-single-max-width]', function( setting ) { setting.bind( function( width ) { var dynamicStyle = '@media all and ( min-width: 921px ) {'; dynamicStyle += '.single-post .site-content > .ast-container{ max-width: ' + ( 40 + parseInt( width ) ) + 'px } '; if ( jQuery( 'body' ).hasClass( 'ast-fluid-width-layout' ) ) { dynamicStyle += '.single-post .site-content > .ast-container{ padding-left:20px; padding-right:20px; } '; } dynamicStyle += '}'; astra_add_dynamic_css( 'blog-single-max-width', dynamicStyle ); } ); } ); /* * EDD Archive Custom Width */ wp.customize( 'astra-settings[edd-archive-max-width]', function( setting ) { setting.bind( function( width ) { var dynamicStyle = '.ast-edd-archive-page .site-content > .ast-container { max-width: ' + parseInt( width ) + 'px } '; astra_add_dynamic_css( 'edd-archive-max-width', dynamicStyle ); } ); } ); /** * Primary Width Option */ wp.customize( 'astra-settings[site-sidebar-width]', function( setting ) { setting.bind( function( width ) { if ( ! jQuery( 'body' ).hasClass( 'ast-no-sidebar' ) && width >= 15 && width <= 50 ) { var dynamicStyle = '@media (min-width: 769px) {'; dynamicStyle += '#primary { width: ' + ( 100 - parseInt( width ) ) + '% } '; dynamicStyle += '#secondary { width: ' + width + '% } '; dynamicStyle += '}'; astra_add_dynamic_css( 'site-sidebar-width', dynamicStyle ); } } ); } ); /** * Header Bottom Border */ wp.customize( 'astra-settings[header-main-sep]', function( setting ) { setting.bind( function( border ) { var dynamicStyle = 'body.ast-header-break-point .site-header { border-bottom-width: ' + border + 'px }'; dynamicStyle += '.ast-desktop .main-header-bar {'; dynamicStyle += 'border-bottom-width: ' + border + 'px'; dynamicStyle += '}'; astra_add_dynamic_css( 'header-main-sep', dynamicStyle ); } ); } ); /** * Small Footer Top Border */ wp.customize( 'astra-settings[footer-sml-divider]', function( value ) { value.bind( function( border_width ) { jQuery( '.ast-small-footer' ).css( 'border-top-width', border_width + 'px' ); } ); } ); /** * Footer Widget Top Border */ wp.customize( 'astra-settings[footer-adv-border-width]', function( value ) { value.bind( function( border_width ) { jQuery( '.footer-adv .footer-adv-overlay' ).css( 'border-top-width', border_width + 'px' ); } ); } ); wp.customize( 'astra-settings[footer-adv-border-color]', function( value ) { value.bind( function( border_color ) { jQuery( '.footer-adv .footer-adv-overlay' ).css( 'border-top-color', border_color ); } ); } ); /** * Small Footer Top Border Color */ wp.customize( 'astra-settings[footer-sml-divider-color]', function( value ) { value.bind( function( border_color ) { jQuery( '.ast-small-footer' ).css( 'border-top-color', border_color ); } ); } ); /** * Button Border Radius */ wp.customize( 'astra-settings[theme-button-border-group]', function( setting ) { setting.bind( function( border ) { var dynamicStyle = '.menu-toggle,button,.ast-button,input#submit,input[type="button"],input[type="submit"],input[type="reset"] { border-radius: ' + ( parseInt( border ) ) + 'px } '; if ( jQuery( 'body' ).hasClass( 'woocommerce' ) ) { dynamicStyle += '.woocommerce a.button, .woocommerce button.button, .woocommerce .product a.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled] { border-radius: ' + ( parseInt( border ) ) + 'px } '; } astra_add_dynamic_css( 'button-radius', dynamicStyle ); } ); } ); /** * Header Bottom Border width */ wp.customize( 'astra-settings[header-main-sep]', function( value ) { value.bind( function( border ) { var dynamicStyle = ' body.ast-header-break-point .site-header { border-bottom-width: ' + border + 'px } '; dynamicStyle += '.ast-desktop .main-header-bar {'; dynamicStyle += 'border-bottom-width: ' + border + 'px'; dynamicStyle += '}'; astra_add_dynamic_css( 'header-main-sep', dynamicStyle ); } ); } ); /** * Header Bottom Border color */ wp.customize( 'astra-settings[header-main-sep-color]', function( value ) { value.bind( function( color ) { if (color == '') { wp.customize.preview.send( 'refresh' ); } if ( color ) { var dynamicStyle = ' .ast-desktop .main-header-bar { border-bottom-color: ' + color + '; } '; dynamicStyle += ' body.ast-header-break-point .site-header { border-bottom-color: ' + color + '; } '; astra_add_dynamic_css( 'header-main-sep-color', dynamicStyle ); } } ); } ); /** * Primary Toggle Button Color */ wp.customize( 'astra-settings[mobile-header-toggle-btn-style-color]', function( setting ) { setting.bind( function( toggle_button_color ) { if ( toggle_button_color != '' ) { if( jQuery( '.menu-toggle' ).hasClass( 'ast-mobile-menu-buttons-fill' ) ) { var dynamicStyle = '.ast-header-break-point .ast-mobile-menu-buttons-fill.menu-toggle { background: ' + toggle_button_color + '}'; } else if( jQuery( '.menu-toggle' ).hasClass( 'ast-mobile-menu-buttons-outline' ) ) { var dynamicStyle = '.ast-header-break-point .ast-mobile-menu-buttons-outline.menu-toggle { border: 1px solid ' + toggle_button_color + '; color: ' + toggle_button_color + '}'; } else { var dynamicStyle = '.ast-header-break-point .ast-mobile-menu-buttons-minimal.menu-toggle { color: ' + toggle_button_color + '}'; } astra_add_dynamic_css( 'primary-toggle-button-color', dynamicStyle ); } else{ wp.customize.preview.send( 'refresh' ); } }); }); astra_responsive_font_size( 'astra-settings[font-size-site-tagline]', '.site-header .site-description' ); astra_responsive_font_size( 'astra-settings[font-size-site-title]', '.site-title' ); astra_responsive_font_size( 'astra-settings[font-size-entry-title]', '.ast-single-post .entry-title, .page-title' ); astra_responsive_font_size( 'astra-settings[font-size-archive-summary-title]', '.ast-archive-description .ast-archive-title' ); astra_responsive_font_size( 'astra-settings[font-size-page-title]', 'body:not(.ast-single-post) .entry-title' ); // Check if anchors should be loaded in the CSS for headings. if (true == astraCustomizer.includeAnchorsInHeadindsCss) { astra_responsive_font_size('astra-settings[font-size-h1]', 'h1, .entry-content h1, .entry-content h1 a'); astra_responsive_font_size('astra-settings[font-size-h2]', 'h2, .entry-content h2, .entry-content h2 a'); astra_responsive_font_size('astra-settings[font-size-h3]', 'h3, .entry-content h3, .entry-content h3 a'); astra_responsive_font_size('astra-settings[font-size-h4]', 'h4, .entry-content h4, .entry-content h4 a'); astra_responsive_font_size('astra-settings[font-size-h5]', 'h5, .entry-content h5, .entry-content h5 a'); astra_responsive_font_size('astra-settings[font-size-h6]', 'h6, .entry-content h6, .entry-content h6 a'); } else { astra_responsive_font_size('astra-settings[font-size-h1]', 'h1, .entry-content h1'); astra_responsive_font_size('astra-settings[font-size-h2]', 'h2, .entry-content h2'); astra_responsive_font_size('astra-settings[font-size-h3]', 'h3, .entry-content h3'); astra_responsive_font_size('astra-settings[font-size-h4]', 'h4, .entry-content h4'); astra_responsive_font_size('astra-settings[font-size-h5]', 'h5, .entry-content h5'); astra_responsive_font_size('astra-settings[font-size-h6]', 'h6, .entry-content h6'); } // paragraph margin bottom. wp.customize( 'astra-settings[para-margin-bottom]', function( value ) { value.bind( function( marginBottom ) { if ( marginBottom == '' ) { wp.customize.preview.send( 'refresh' ); } if ( marginBottom ) { var dynamicStyle = ' p, .entry-content p { margin-bottom: ' + marginBottom + 'em; } '; astra_add_dynamic_css( 'para-margin-bottom', dynamicStyle ); } } ); } ); if ( astraCustomizer.page_builder_button_style_css ) { if (true == astraCustomizer.includeAnchorsInHeadindsCss) { if ( 'color-typo' == astraCustomizer.elementor_default_color_font_setting || 'typo' == astraCustomizer.elementor_default_color_font_setting ) { astra_css('astra-settings[headings-line-height]', 'line-height', '.elementor-widget-heading h1.elementor-heading-title, .elementor-widget-heading h2.elementor-heading-title, .elementor-widget-heading h3.elementor-heading-title, .elementor-widget-heading h4.elementor-heading-title, .elementor-widget-heading h5.elementor-heading-title, .elementor-widget-heading h6.elementor-heading-title'); } astra_css('astra-settings[headings-line-height]', 'line-height', 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a'); } else { if ( 'color-typo' == astraCustomizer.elementor_default_color_font_setting || 'typo' == astraCustomizer.elementor_default_color_font_setting ) { astra_css('astra-settings[headings-line-height]', 'line-height', '.elementor-widget-heading h1.elementor-heading-title, .elementor-widget-heading h2.elementor-heading-title, .elementor-widget-heading h3.elementor-heading-title, .elementor-widget-heading h4.elementor-heading-title, .elementor-widget-heading h5.elementor-heading-title, .elementor-widget-heading h6.elementor-heading-title'); } astra_css('astra-settings[headings-line-height]', 'line-height', 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a'); } } else { if (true == astraCustomizer.includeAnchorsInHeadindsCss) { astra_css('astra-settings[headings-line-height]', 'line-height', 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a'); } else { astra_css('astra-settings[headings-line-height]', 'line-height', 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a'); } } // Check if anchors should be loaded in the CSS for headings. if (true == astraCustomizer.includeAnchorsInHeadindsCss) { astra_generate_outside_font_family_css('astra-settings[headings-font-family]', 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a'); astra_css('astra-settings[headings-font-weight]', 'font-weight', 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a'); astra_css('astra-settings[headings-text-transform]', 'text-transform', 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a'); } else { astra_generate_outside_font_family_css('astra-settings[headings-font-family]', 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a'); astra_css('astra-settings[headings-font-weight]', 'font-weight', 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a'); astra_css('astra-settings[headings-text-transform]', 'text-transform', 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a'); } // Footer Bar. astra_css( 'astra-settings[footer-color]', 'color', '.ast-small-footer' ); astra_css( 'astra-settings[footer-link-color]', 'color', '.ast-small-footer a' ); astra_css( 'astra-settings[footer-link-h-color]', 'color', '.ast-small-footer a:hover' ); wp.customize( 'astra-settings[footer-bg-obj]', function( value ) { value.bind( function( bg_obj ) { var dynamicStyle = ' .ast-small-footer > .ast-footer-overlay { {{css}} }'; astra_background_obj_css( wp.customize, bg_obj, 'footer-bg-obj', dynamicStyle ); } ); } ); // Footer Widgets. astra_css( 'astra-settings[footer-adv-wgt-title-color]', 'color', '.footer-adv .widget-title, .footer-adv .widget-title a' ); astra_css( 'astra-settings[footer-adv-text-color]', 'color', '.footer-adv' ); astra_css( 'astra-settings[footer-adv-link-color]', 'color', '.footer-adv a' ); astra_css( 'astra-settings[footer-adv-link-h-color]', 'color', '.footer-adv a:hover, .footer-adv .no-widget-text a:hover, .footer-adv a:focus, .footer-adv .no-widget-text a:focus' ); wp.customize( 'astra-settings[footer-adv-bg-obj]', function( value ) { value.bind( function( bg_obj ) { var dynamicStyle = ' .footer-adv-overlay { {{css}} }'; astra_background_obj_css( wp.customize, bg_obj, 'footer-adv-bg-obj', dynamicStyle ); } ); } ); /* * Woocommerce Shop Archive Custom Width */ wp.customize( 'astra-settings[shop-archive-max-width]', function( setting ) { setting.bind( function( width ) { var dynamicStyle = '@media all and ( min-width: 921px ) {'; dynamicStyle += '.ast-woo-shop-archive .site-content > .ast-container{ max-width: ' + ( parseInt( width ) ) + 'px } '; if ( jQuery( 'body' ).hasClass( 'ast-fluid-width-layout' ) ) { dynamicStyle += '.ast-woo-shop-archive .site-content > .ast-container{ padding-left:20px; padding-right:20px; } '; } dynamicStyle += '}'; astra_add_dynamic_css( 'shop-archive-max-width', dynamicStyle ); } ); } ); //[1] Primary Menu Toggle Button Style. wp.customize( 'astra-settings[mobile-header-toggle-btn-style]', function( setting ) { setting.bind( function( icon_style ) { var buttons = $(document).find('.ast-mobile-menu-buttons .menu-toggle'); buttons.removeClass('ast-mobile-menu-buttons-default ast-mobile-menu-buttons-fill ast-mobile-menu-buttons-outline'); buttons.removeClass('ast-mobile-menu-buttons-default ast-mobile-menu-buttons-fill ast-mobile-menu-buttons-minimal'); buttons.addClass( 'ast-mobile-menu-buttons-' + icon_style ); } ); } ); //[1] Toggle Button Border Radius. wp.customize( 'astra-settings[mobile-header-toggle-btn-border-radius]', function( setting ) { setting.bind( function( border ) { var dynamicStyle = '.ast-header-break-point .main-header-bar .ast-button-wrap .menu-toggle { border-radius: ' + ( parseInt( border ) ) + 'px } '; astra_add_dynamic_css( 'mobile-header-toggle-btn-border-radius', dynamicStyle ); } ); } ); /** * Primary Submenu border */ wp.customize( 'astra-settings[primary-submenu-border]', function( value ) { value.bind( function( border ) { var color = wp.customize( 'astra-settings[primary-submenu-b-color]' ).get(); if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) { var dynamicStyle = '.ast-desktop .main-header-menu.submenu-with-border .sub-menu, .ast-desktop .main-header-menu.submenu-with-border .children'; dynamicStyle += '{'; dynamicStyle += 'border-top-width:' + border.top + 'px;'; dynamicStyle += 'border-right-width:' + border.right + 'px;'; dynamicStyle += 'border-left-width:' + border.left + 'px;'; dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;'; dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += 'border-style: solid;'; dynamicStyle += '}'; dynamicStyle += '.ast-desktop .main-header-menu.submenu-with-border .sub-menu .sub-menu, .ast-desktop .main-header-menu.submenu-with-border .children .children'; dynamicStyle += '{'; dynamicStyle += 'top:-' + border.top + 'px;'; dynamicStyle += '}'; // Submenu items goes outside? dynamicStyle += '@media (min-width: 769px){'; dynamicStyle += '.main-header-menu .sub-menu li.ast-left-align-sub-menu:hover > ul, .main-header-menu .sub-menu li.ast-left-align-sub-menu.focus > ul'; dynamicStyle += '{'; dynamicStyle += 'margin-left:-' + ( +border.left + +border.right ) + 'px;'; dynamicStyle += '}'; dynamicStyle += '}'; astra_add_dynamic_css( 'primary-submenu-border', dynamicStyle ); } else { wp.customize.preview.send( 'refresh' ); } } ); } ); /** * Primary Submenu border COlor */ wp.customize( 'astra-settings[primary-submenu-b-color]', function( value ) { value.bind( function( color ) { var border = wp.customize( 'astra-settings[primary-submenu-border]' ).get(); if ( '' != color ) { if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) { var dynamicStyle = '.ast-desktop .main-header-menu.submenu-with-border .sub-menu, .ast-desktop .main-header-menu.submenu-with-border .children'; dynamicStyle += '{'; dynamicStyle += 'border-top-width:' + border.top + 'px;'; dynamicStyle += 'border-right-width:' + border.right + 'px;'; dynamicStyle += 'border-left-width:' + border.left + 'px;'; dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;'; dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += 'border-style: solid;'; dynamicStyle += '}'; dynamicStyle += '.ast-desktop .main-header-menu.submenu-with-border .sub-menu .sub-menu, .ast-desktop .main-header-menu.submenu-with-border .children .children'; dynamicStyle += '{'; dynamicStyle += 'top:-' + border.top + 'px;'; dynamicStyle += '}'; // Submenu items goes outside? dynamicStyle += '@media (min-width: 769px){'; dynamicStyle += '.main-header-menu .sub-menu li.ast-left-align-sub-menu:hover > ul, .main-header-menu .sub-menu li.ast-left-align-sub-menu.focus > ul'; dynamicStyle += '{'; dynamicStyle += 'margin-left:-' + ( +border.left + +border.right ) + 'px;'; dynamicStyle += '}'; dynamicStyle += '}'; astra_add_dynamic_css( 'primary-submenu-border-color', dynamicStyle ); } } else { wp.customize.preview.send( 'refresh' ); } } ); } ); /** * Primary Submenu border COlor */ wp.customize('astra-settings[primary-submenu-item-b-color]', function (value) { value.bind(function (color) { var insideBorder = wp.customize('astra-settings[primary-submenu-item-border]').get(); if ('' != color) { if ( true == insideBorder ) { var dynamicStyle = ''; dynamicStyle += '.ast-desktop .main-header-menu.submenu-with-border .sub-menu a, .ast-desktop .main-header-menu.submenu-with-border .children a'; dynamicStyle += '{'; dynamicStyle += 'border-bottom-width:' + ( ( true === insideBorder ) ? '1px;' : '0px;' ); dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += 'border-style: solid;'; dynamicStyle += '}'; astra_add_dynamic_css('primary-submenu-item-b-color', dynamicStyle); } } else { wp.customize.preview.send('refresh'); } }); }); /** * Primary Submenu border COlor */ wp.customize( 'astra-settings[primary-submenu-item-border]', function( value ) { value.bind( function( border ) { var color = wp.customize( 'astra-settings[primary-submenu-item-b-color]' ).get(); if( true === border ) { var dynamicStyle = '.ast-desktop .main-header-menu.submenu-with-border .sub-menu a, .ast-desktop .main-header-menu.submenu-with-border .children a'; dynamicStyle += '{'; dynamicStyle += 'border-bottom-width:' + ( ( true === border ) ? '1px;' : '0px;' ); dynamicStyle += 'border-color:' + color + ';'; dynamicStyle += 'border-style: solid;'; dynamicStyle += '}'; astra_add_dynamic_css( 'primary-submenu-item-border', dynamicStyle ); } else { wp.customize.preview.send( 'refresh' ); } } ); } ); astra_css( 'astra-settings[header-main-rt-section-button-text-color]', 'color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' ); astra_css( 'astra-settings[header-main-rt-section-button-back-color]', 'background-color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' ); astra_css( 'astra-settings[header-main-rt-section-button-text-h-color]', 'color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' ); astra_css( 'astra-settings[header-main-rt-section-button-back-h-color]', 'background-color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' ); astra_css( 'astra-settings[header-main-rt-section-button-border-radius]', 'border-radius', '.main-header-bar .ast-container .button-custom-menu-item .ast-custom-button-link .ast-custom-button', 'px' ); astra_css( 'astra-settings[header-main-rt-section-button-border-color]', 'border-color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' ); astra_css( 'astra-settings[header-main-rt-section-button-border-h-color]', 'border-color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' ); astra_responsive_spacing( 'astra-settings[header-main-rt-section-button-padding]','.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button', 'padding', ['top', 'right', 'bottom', 'left' ] ); var ele_border_radius_selector = ''; var ele_border_width_selector = ''; var ele_padding_selector = ''; if ( astraCustomizer.page_builder_button_style_css ) { if ( 'color-typo' == astraCustomizer.elementor_default_color_font_setting || 'color' == astraCustomizer.elementor_default_color_font_setting || 'font' == astraCustomizer.elementor_default_color_font_setting ) { ele_border_radius_selector = ', .elementor-button-wrapper .elementor-button.elementor-size-sm, .elementor-button-wrapper .elementor-button.elementor-size-xs, .elementor-button-wrapper .elementor-button.elementor-size-md, .elementor-button-wrapper .elementor-button.elementor-size-lg, .elementor-button-wrapper .elementor-button.elementor-size-xl, .elementor-button-wrapper .elementor-button'; ele_border_width_selector = ', .elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited'; ele_padding_selector = ', .elementor-button-wrapper .elementor-button.elementor-size-sm, .elementor-button-wrapper .elementor-button.elementor-size-xs, .elementor-button-wrapper .elementor-button.elementor-size-md, .elementor-button-wrapper .elementor-button.elementor-size-lg, .elementor-button-wrapper .elementor-button.elementor-size-xl, .elementor-button-wrapper .elementor-button'; } } astra_css( 'astra-settings[button-radius]', 'border-radius', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + ele_border_radius_selector, 'px' ); /** * Button border */ wp.customize( 'astra-settings[theme-button-border-group-border-size]', function( value ) { value.bind( function( border ) { if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) { var dynamicStyle = '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link' + ele_border_width_selector; dynamicStyle += '{'; dynamicStyle += 'border-top-width:' + border.top + 'px;'; dynamicStyle += 'border-right-width:' + border.right + 'px;'; dynamicStyle += 'border-left-width:' + border.left + 'px;'; dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;'; dynamicStyle += 'border-style: solid;'; dynamicStyle += '}'; astra_add_dynamic_css( 'theme-button-border-group-border-size', dynamicStyle ); } } ); } ); astra_responsive_spacing( 'astra-settings[theme-button-padding]','.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .woocommerce a.button, .woocommerce button.button, .woocommerce .product a.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled], .wp-block-button .wp-block-button__link' + ele_padding_selector, 'padding', [ 'top', 'bottom' ] ); astra_responsive_spacing( 'astra-settings[theme-button-padding]','.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .woocommerce a.button, .woocommerce button.button, .woocommerce .product a.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled], .wp-block-button .wp-block-button__link' + ele_padding_selector, 'padding', [ 'left', 'right' ] ); /** * Button border */ wp.customize( 'astra-settings[transparent-header-button-border-group]', function( value ) { value.bind( function( value ) { var optionValue = JSON.parse(value); var border = optionValue['header-main-rt-trans-section-button-border-size']; if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) { var dynamicStyle = '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button'; dynamicStyle += '{'; dynamicStyle += 'border-top-width:' + border.top + 'px;'; dynamicStyle += 'border-right-width:' + border.right + 'px;'; dynamicStyle += 'border-left-width:' + border.left + 'px;'; dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;'; dynamicStyle += 'border-style: solid;'; dynamicStyle += '}'; astra_add_dynamic_css( 'header-main-rt-trans-section-button-border-size', dynamicStyle ); } } ); } ); // Site Title - Font family astra_generate_outside_font_family_css( 'astra-settings[font-family-site-title]', '.site-title, .site-title a' ); // Site Title - Font Weight astra_css( 'astra-settings[font-weight-site-title]', 'font-weight', '.site-title, .site-title a' ); // Site Title - Font Size astra_responsive_font_size( 'astra-settings[font-size-site-title]', '.site-title, .site-title a' ); // Site Title - Line Height astra_css( 'astra-settings[line-height-site-title]', 'line-height', '.site-title, .site-title a' ); // Site Title - Text Transform astra_css( 'astra-settings[text-transform-site-title]', 'text-transform', '.site-title, .site-title a' ); // Site tagline - Font family astra_generate_outside_font_family_css( 'astra-settings[font-family-site-tagline]', '.site-header .site-description' ); // Site Tagline - Font Weight astra_css( 'astra-settings[font-weight-site-tagline]', 'font-weight', '.site-header .site-description' ); // Site Tagline - Font Size astra_responsive_font_size( 'astra-settings[font-size-site-tagline]', '.site-header .site-description' ); // Site Tagline - Line Height astra_css( 'astra-settings[line-height-site-tagline]', 'line-height', '.site-header .site-description' ); // Site Tagline - Text Transform astra_css( 'astra-settings[text-transform-site-tagline]', 'text-transform', '.site-header .site-description' ); if ( astraCustomizer.page_builder_button_style_css ) { var btn_color_ele = ''; var btn_bg_color_ele = ''; var btn_h_color_ele = ''; var btn_bg_h_color_ele = ''; var btn_border_color_ele = ''; var btn_border_h_color_ele = ''; if ( 'color-typo' == astraCustomizer.elementor_default_color_font_setting || 'color' == astraCustomizer.elementor_default_color_font_setting ) { // Theme Button - Text Color btn_color_ele = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited'; // Theme Button - Background Color btn_bg_color_ele = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited'; // Theme Button - Text Hover Color btn_h_color_ele = ',.elementor-button-wrapper .elementor-button:hover, .elementor-button-wrapper .elementor-button:focus'; // Theme Button - Background Hover Color btn_bg_h_color_ele = ',.elementor-button-wrapper .elementor-button:hover, .elementor-button-wrapper .elementor-button:focus'; // Theme Button - Border Color btn_border_color_ele = ', .elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited'; // Theme Button - Border Hover Color btn_border_h_color_ele = ',.elementor-button-wrapper .elementor-button:hover, .elementor-button-wrapper .elementor-button:focus'; } // Theme Button - Text Color astra_css( 'astra-settings[button-color]', 'color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link' + btn_color_ele ); // Theme Button - Background Color astra_css( 'astra-settings[button-bg-color]', 'background-color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link' + btn_bg_color_ele ); // Theme Button - Text Hover Color astra_css( 'astra-settings[button-h-color]', 'color', 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' + btn_h_color_ele ); // Theme Button - Background Hover Color astra_css( 'astra-settings[button-bg-h-color]', 'background-color', 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' + btn_bg_h_color_ele ); astra_css( 'astra-settings[theme-button-border-group-border-color]', 'border-color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link' + btn_border_color_ele ); // Theme Button - Border Hover Color astra_css( 'astra-settings[theme-button-border-group-border-h-color]', 'border-color', 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' + btn_border_h_color_ele ); } else { // Theme Button - Text Color astra_css( 'astra-settings[button-color]', 'color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' ); // Theme Button - Background Color astra_css( 'astra-settings[button-bg-color]', 'background-color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' ); // Theme Button - Border Color astra_css( 'astra-settings[button-bg-color]', 'border-color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' ); // Theme Button - Text Hover Color astra_css( 'astra-settings[button-h-color]', 'color', 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus' ); // Theme Button - Background Hover Color astra_css( 'astra-settings[button-bg-h-color]', 'background-color', 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus' ); astra_responsive_spacing( 'astra-settings[theme-button-padding]','.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .woocommerce a.button, .woocommerce button.button, .woocommerce .product a.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled]', 'padding', [ 'top', 'bottom' ] ); astra_responsive_spacing( 'astra-settings[theme-button-padding]','.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .woocommerce a.button, .woocommerce button.button, .woocommerce .product a.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled]', 'padding', [ 'left', 'right' ] ); } } )( jQuery ); flexibility.js 0000666 00000062025 15214245400 0007434 0 ustar 00 /** * Flexibility is a JavaScript polyfill for Flexbox By Jonathan Neal, 10up. (https://github.com/jonathantneal/flexibility) * Licensed under MIT ( https://github.com/jonathantneal/flexibility/blob/master/LICENSE.md ) */ ! function(e) { if ("object" == typeof exports && "undefined" != typeof module) module.exports = e(); else if ("function" == typeof define && define.amd) define([], e); else { var t; t = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, t.flexibility = e() } }(function() { return function e(t, r, l) { function n(f, i) { if (!r[f]) { if (!t[f]) { var s = "function" == typeof require && require; if (!i && s) return s(f, !0); if (o) return o(f, !0); var a = new Error("Cannot find module '" + f + "'"); throw a.code = "MODULE_NOT_FOUND", a } var c = r[f] = { exports: {} }; t[f][0].call(c.exports, function(e) { var r = t[f][1][e]; return n(r ? r : e) }, c, c.exports, e, t, r, l) } return r[f].exports } for (var o = "function" == typeof require && require, f = 0; f < l.length; f++) n(l[f]); return n }({ 1: [function(e, t, r) { t.exports = function(e) { var t, r, l, n = -1; if (e.lines.length > 1 && "flex-start" === e.style.alignContent) for (t = 0; l = e.lines[++n];) l.crossStart = t, t += l.cross; else if (e.lines.length > 1 && "flex-end" === e.style.alignContent) for (t = e.flexStyle.crossSpace; l = e.lines[++n];) l.crossStart = t, t += l.cross; else if (e.lines.length > 1 && "center" === e.style.alignContent) for (t = e.flexStyle.crossSpace / 2; l = e.lines[++n];) l.crossStart = t, t += l.cross; else if (e.lines.length > 1 && "space-between" === e.style.alignContent) for (r = e.flexStyle.crossSpace / (e.lines.length - 1), t = 0; l = e.lines[++n];) l.crossStart = t, t += l.cross + r; else if (e.lines.length > 1 && "space-around" === e.style.alignContent) for (r = 2 * e.flexStyle.crossSpace / (2 * e.lines.length), t = r / 2; l = e.lines[++n];) l.crossStart = t, t += l.cross + r; else for (r = e.flexStyle.crossSpace / e.lines.length, t = e.flexStyle.crossInnerBefore; l = e.lines[++n];) l.crossStart = t, l.cross += r, t += l.cross } }, {}], 2: [function(e, t, r) { t.exports = function(e) { for (var t, r = -1; line = e.lines[++r];) for (t = -1; child = line.children[++t];) { var l = child.style.alignSelf; "auto" === l && (l = e.style.alignItems), "flex-start" === l ? child.flexStyle.crossStart = line.crossStart : "flex-end" === l ? child.flexStyle.crossStart = line.crossStart + line.cross - child.flexStyle.crossOuter : "center" === l ? child.flexStyle.crossStart = line.crossStart + (line.cross - child.flexStyle.crossOuter) / 2 : (child.flexStyle.crossStart = line.crossStart, child.flexStyle.crossOuter = line.cross, child.flexStyle.cross = child.flexStyle.crossOuter - child.flexStyle.crossBefore - child.flexStyle.crossAfter) } } }, {}], 3: [function(e, t, r) { t.exports = function l(e, l) { var t = "row" === l || "row-reverse" === l, r = e.mainAxis; if (r) { var n = t && "inline" === r || !t && "block" === r; n || (e.flexStyle = { main: e.flexStyle.cross, cross: e.flexStyle.main, mainOffset: e.flexStyle.crossOffset, crossOffset: e.flexStyle.mainOffset, mainBefore: e.flexStyle.crossBefore, mainAfter: e.flexStyle.crossAfter, crossBefore: e.flexStyle.mainBefore, crossAfter: e.flexStyle.mainAfter, mainInnerBefore: e.flexStyle.crossInnerBefore, mainInnerAfter: e.flexStyle.crossInnerAfter, crossInnerBefore: e.flexStyle.mainInnerBefore, crossInnerAfter: e.flexStyle.mainInnerAfter, mainBorderBefore: e.flexStyle.crossBorderBefore, mainBorderAfter: e.flexStyle.crossBorderAfter, crossBorderBefore: e.flexStyle.mainBorderBefore, crossBorderAfter: e.flexStyle.mainBorderAfter }) } else t ? e.flexStyle = { main: e.style.width, cross: e.style.height, mainOffset: e.style.offsetWidth, crossOffset: e.style.offsetHeight, mainBefore: e.style.marginLeft, mainAfter: e.style.marginRight, crossBefore: e.style.marginTop, crossAfter: e.style.marginBottom, mainInnerBefore: e.style.paddingLeft, mainInnerAfter: e.style.paddingRight, crossInnerBefore: e.style.paddingTop, crossInnerAfter: e.style.paddingBottom, mainBorderBefore: e.style.borderLeftWidth, mainBorderAfter: e.style.borderRightWidth, crossBorderBefore: e.style.borderTopWidth, crossBorderAfter: e.style.borderBottomWidth } : e.flexStyle = { main: e.style.height, cross: e.style.width, mainOffset: e.style.offsetHeight, crossOffset: e.style.offsetWidth, mainBefore: e.style.marginTop, mainAfter: e.style.marginBottom, crossBefore: e.style.marginLeft, crossAfter: e.style.marginRight, mainInnerBefore: e.style.paddingTop, mainInnerAfter: e.style.paddingBottom, crossInnerBefore: e.style.paddingLeft, crossInnerAfter: e.style.paddingRight, mainBorderBefore: e.style.borderTopWidth, mainBorderAfter: e.style.borderBottomWidth, crossBorderBefore: e.style.borderLeftWidth, crossBorderAfter: e.style.borderRightWidth }, "content-box" === e.style.boxSizing && ("number" == typeof e.flexStyle.main && (e.flexStyle.main += e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter), "number" == typeof e.flexStyle.cross && (e.flexStyle.cross += e.flexStyle.crossInnerBefore + e.flexStyle.crossInnerAfter + e.flexStyle.crossBorderBefore + e.flexStyle.crossBorderAfter)); e.mainAxis = t ? "inline" : "block", e.crossAxis = t ? "block" : "inline", "number" == typeof e.style.flexBasis && (e.flexStyle.main = e.style.flexBasis + e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter), e.flexStyle.mainOuter = e.flexStyle.main, e.flexStyle.crossOuter = e.flexStyle.cross, "auto" === e.flexStyle.mainOuter && (e.flexStyle.mainOuter = e.flexStyle.mainOffset), "auto" === e.flexStyle.crossOuter && (e.flexStyle.crossOuter = e.flexStyle.crossOffset), "number" == typeof e.flexStyle.mainBefore && (e.flexStyle.mainOuter += e.flexStyle.mainBefore), "number" == typeof e.flexStyle.mainAfter && (e.flexStyle.mainOuter += e.flexStyle.mainAfter), "number" == typeof e.flexStyle.crossBefore && (e.flexStyle.crossOuter += e.flexStyle.crossBefore), "number" == typeof e.flexStyle.crossAfter && (e.flexStyle.crossOuter += e.flexStyle.crossAfter) } }, {}], 4: [function(e, t, r) { var l = e("../reduce"); t.exports = function(e) { if (e.mainSpace > 0) { var t = l(e.children, function(e, t) { return e + parseFloat(t.style.flexGrow) }, 0); t > 0 && (e.main = l(e.children, function(r, l) { return "auto" === l.flexStyle.main ? l.flexStyle.main = l.flexStyle.mainOffset + parseFloat(l.style.flexGrow) / t * e.mainSpace : l.flexStyle.main += parseFloat(l.style.flexGrow) / t * e.mainSpace, l.flexStyle.mainOuter = l.flexStyle.main + l.flexStyle.mainBefore + l.flexStyle.mainAfter, r + l.flexStyle.mainOuter }, 0), e.mainSpace = 0) } } }, { "../reduce": 12 }], 5: [function(e, t, r) { var l = e("../reduce"); t.exports = function(e) { if (e.mainSpace < 0) { var t = l(e.children, function(e, t) { return e + parseFloat(t.style.flexShrink) }, 0); t > 0 && (e.main = l(e.children, function(r, l) { return l.flexStyle.main += parseFloat(l.style.flexShrink) / t * e.mainSpace, l.flexStyle.mainOuter = l.flexStyle.main + l.flexStyle.mainBefore + l.flexStyle.mainAfter, r + l.flexStyle.mainOuter }, 0), e.mainSpace = 0) } } }, { "../reduce": 12 }], 6: [function(e, t, r) { var l = e("../reduce"); t.exports = function(e) { var t; e.lines = [t = { main: 0, cross: 0, children: [] }]; for (var r, n = -1; r = e.children[++n];) "nowrap" === e.style.flexWrap || 0 === t.children.length || "auto" === e.flexStyle.main || e.flexStyle.main - e.flexStyle.mainInnerBefore - e.flexStyle.mainInnerAfter - e.flexStyle.mainBorderBefore - e.flexStyle.mainBorderAfter >= t.main + r.flexStyle.mainOuter ? (t.main += r.flexStyle.mainOuter, t.cross = Math.max(t.cross, r.flexStyle.crossOuter)) : e.lines.push(t = { main: r.flexStyle.mainOuter, cross: r.flexStyle.crossOuter, children: [] }), t.children.push(r); e.flexStyle.mainLines = l(e.lines, function(e, t) { return Math.max(e, t.main) }, 0), e.flexStyle.crossLines = l(e.lines, function(e, t) { return e + t.cross }, 0), "auto" === e.flexStyle.main && (e.flexStyle.main = Math.max(e.flexStyle.mainOffset, e.flexStyle.mainLines + e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter)), "auto" === e.flexStyle.cross && (e.flexStyle.cross = Math.max(e.flexStyle.crossOffset, e.flexStyle.crossLines + e.flexStyle.crossInnerBefore + e.flexStyle.crossInnerAfter + e.flexStyle.crossBorderBefore + e.flexStyle.crossBorderAfter)), e.flexStyle.crossSpace = e.flexStyle.cross - e.flexStyle.crossInnerBefore - e.flexStyle.crossInnerAfter - e.flexStyle.crossBorderBefore - e.flexStyle.crossBorderAfter - e.flexStyle.crossLines, e.flexStyle.mainOuter = e.flexStyle.main + e.flexStyle.mainBefore + e.flexStyle.mainAfter, e.flexStyle.crossOuter = e.flexStyle.cross + e.flexStyle.crossBefore + e.flexStyle.crossAfter } }, { "../reduce": 12 }], 7: [function(e, t, r) { function l(t) { for (var r, l = -1; r = t.children[++l];) e("./flex-direction")(r, t.style.flexDirection); e("./flex-direction")(t, t.style.flexDirection), e("./order")(t), e("./flexbox-lines")(t), e("./align-content")(t), l = -1; for (var n; n = t.lines[++l];) n.mainSpace = t.flexStyle.main - t.flexStyle.mainInnerBefore - t.flexStyle.mainInnerAfter - t.flexStyle.mainBorderBefore - t.flexStyle.mainBorderAfter - n.main, e("./flex-grow")(n), e("./flex-shrink")(n), e("./margin-main")(n), e("./margin-cross")(n), e("./justify-content")(n, t.style.justifyContent, t); e("./align-items")(t) } t.exports = l }, { "./align-content": 1, "./align-items": 2, "./flex-direction": 3, "./flex-grow": 4, "./flex-shrink": 5, "./flexbox-lines": 6, "./justify-content": 8, "./margin-cross": 9, "./margin-main": 10, "./order": 11 }], 8: [function(e, t, r) { t.exports = function(e, t, r) { var l, n, o, f = r.flexStyle.mainInnerBefore, i = -1; if ("flex-end" === t) for (l = e.mainSpace, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter; else if ("center" === t) for (l = e.mainSpace / 2, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter; else if ("space-between" === t) for (n = e.mainSpace / (e.children.length - 1), l = 0, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter + n; else if ("space-around" === t) for (n = 2 * e.mainSpace / (2 * e.children.length), l = n / 2, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter + n; else for (l = 0, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter } }, {}], 9: [function(e, t, r) { t.exports = function(e) { for (var t, r = -1; t = e.children[++r];) { var l = 0; "auto" === t.flexStyle.crossBefore && ++l, "auto" === t.flexStyle.crossAfter && ++l; var n = e.cross - t.flexStyle.crossOuter; "auto" === t.flexStyle.crossBefore && (t.flexStyle.crossBefore = n / l), "auto" === t.flexStyle.crossAfter && (t.flexStyle.crossAfter = n / l), "auto" === t.flexStyle.cross ? t.flexStyle.crossOuter = t.flexStyle.crossOffset + t.flexStyle.crossBefore + t.flexStyle.crossAfter : t.flexStyle.crossOuter = t.flexStyle.cross + t.flexStyle.crossBefore + t.flexStyle.crossAfter } } }, {}], 10: [function(e, t, r) { t.exports = function(e) { for (var t, r = 0, l = -1; t = e.children[++l];) "auto" === t.flexStyle.mainBefore && ++r, "auto" === t.flexStyle.mainAfter && ++r; if (r > 0) { for (l = -1; t = e.children[++l];) "auto" === t.flexStyle.mainBefore && (t.flexStyle.mainBefore = e.mainSpace / r), "auto" === t.flexStyle.mainAfter && (t.flexStyle.mainAfter = e.mainSpace / r), "auto" === t.flexStyle.main ? t.flexStyle.mainOuter = t.flexStyle.mainOffset + t.flexStyle.mainBefore + t.flexStyle.mainAfter : t.flexStyle.mainOuter = t.flexStyle.main + t.flexStyle.mainBefore + t.flexStyle.mainAfter; e.mainSpace = 0 } } }, {}], 11: [function(e, t, r) { var l = /^(column|row)-reverse$/; t.exports = function(e) { e.children.sort(function(e, t) { return e.style.order - t.style.order || e.index - t.index }), l.test(e.style.flexDirection) && e.children.reverse() } }, {}], 12: [function(e, t, r) { function l(e, t, r) { for (var l = e.length, n = -1; ++n < l;) n in e && (r = t(r, e[n], n)); return r } t.exports = l }, {}], 13: [function(e, t, r) { function l(e) { i(f(e)) } var n = e("./read"), o = e("./write"), f = e("./readAll"), i = e("./writeAll"); t.exports = l, t.exports.read = n, t.exports.write = o, t.exports.readAll = f, t.exports.writeAll = i }, { "./read": 15, "./readAll": 16, "./write": 17, "./writeAll": 18 }], 14: [function(e, t, r) { function l(e, t, r) { var l = e[t], f = String(l).match(o); if (!f) { var a = t.match(s); if (a) { var c = e["border" + a[1] + "Style"]; return "none" === c ? 0 : i[l] || 0 } return l } var y = f[1], x = f[2]; return "px" === x ? 1 * y : "cm" === x ? .3937 * y * 96 : "in" === x ? 96 * y : "mm" === x ? .3937 * y * 96 / 10 : "pc" === x ? 12 * y * 96 / 72 : "pt" === x ? 96 * y / 72 : "rem" === x ? 16 * y : n(l, r) } function n(e, t) { f.style.cssText = "border:none!important;clip:rect(0 0 0 0)!important;display:block!important;font-size:1em!important;height:0!important;margin:0!important;padding:0!important;position:relative!important;width:" + e + "!important", t.parentNode.insertBefore(f, t.nextSibling); var r = f.offsetWidth; return t.parentNode.removeChild(f), r } t.exports = l; var o = /^([-+]?\d*\.?\d+)(%|[a-z]+)$/, f = document.createElement("div"), i = { medium: 4, none: 0, thick: 6, thin: 2 }, s = /^border(Bottom|Left|Right|Top)Width$/ }, {}], 15: [function(e, t, r) { function l(e) { var t = { alignContent: "stretch", alignItems: "stretch", alignSelf: "auto", borderBottomStyle: "none", borderBottomWidth: 0, borderLeftStyle: "none", borderLeftWidth: 0, borderRightStyle: "none", borderRightWidth: 0, borderTopStyle: "none", borderTopWidth: 0, boxSizing: "content-box", display: "inline", flexBasis: "auto", flexDirection: "row", flexGrow: 0, flexShrink: 1, flexWrap: "nowrap", justifyContent: "flex-start", height: "auto", marginTop: 0, marginRight: 0, marginLeft: 0, marginBottom: 0, paddingTop: 0, paddingRight: 0, paddingLeft: 0, paddingBottom: 0, maxHeight: "none", maxWidth: "none", minHeight: 0, minWidth: 0, order: 0, position: "static", width: "auto" }, r = e instanceof Element; if (r) { var l = e.hasAttribute("data-style"), i = l ? e.getAttribute("data-style") : e.getAttribute("style") || ""; l || e.setAttribute("data-style", i); var s = window.getComputedStyle && getComputedStyle(e) || {}; f(t, s); var c = e.currentStyle || {}; n(t, c), o(t, i); for (var y in t) t[y] = a(t, y, e); var x = e.getBoundingClientRect(); t.offsetHeight = x.height || e.offsetHeight, t.offsetWidth = x.width || e.offsetWidth } var S = { element: e, style: t }; return S } function n(e, t) { for (var r in e) { var l = r in t; if (l) e[r] = t[r]; else { var n = r.replace(/[A-Z]/g, "-$&").toLowerCase(), o = n in t; o && (e[r] = t[n]) } } var f = "-js-display" in t; f && (e.display = t["-js-display"]) } function o(e, t) { for (var r; r = i.exec(t);) { var l = r[1].toLowerCase().replace(/-[a-z]/g, function(e) { return e.slice(1).toUpperCase() }); e[l] = r[2] } } function f(e, t) { for (var r in e) { var l = r in t; l && !s.test(r) && (e[r] = t[r]) } } t.exports = l; var i = /([^\s:;]+)\s*:\s*([^;]+?)\s*(;|$)/g, s = /^(alignSelf|height|width)$/, a = e("./getComputedLength") }, { "./getComputedLength": 14 }], 16: [function(e, t, r) { function l(e) { var t = []; return n(e, t), t } function n(e, t) { for (var r, l = o(e), i = [], s = -1; r = e.childNodes[++s];) { var a = 3 === r.nodeType && !/^\s*$/.test(r.nodeValue); if (l && a) { var c = r; r = e.insertBefore(document.createElement("flex-item"), c), r.appendChild(c) } var y = r instanceof Element; if (y) { var x = n(r, t); if (l) { var S = r.style; S.display = "inline-block", S.position = "absolute", x.style = f(r).style, i.push(x) } } } var m = { element: e, children: i }; return l && (m.style = f(e).style, t.push(m)), m } function o(e) { var t = e instanceof Element, r = t && e.getAttribute("data-style"), l = t && e.currentStyle && e.currentStyle["-js-display"], n = i.test(r) || s.test(l); return n } t.exports = l; var f = e("../read"), i = /(^|;)\s*display\s*:\s*(inline-)?flex\s*(;|$)/i, s = /^(inline-)?flex$/i }, { "../read": 15 }], 17: [function(e, t, r) { function l(e) { o(e); var t = e.element.style, r = "inline" === e.mainAxis ? ["main", "cross"] : ["cross", "main"]; t.boxSizing = "content-box", t.display = "block", t.position = "relative", t.width = n(e.flexStyle[r[0]] - e.flexStyle[r[0] + "InnerBefore"] - e.flexStyle[r[0] + "InnerAfter"] - e.flexStyle[r[0] + "BorderBefore"] - e.flexStyle[r[0] + "BorderAfter"]), t.height = n(e.flexStyle[r[1]] - e.flexStyle[r[1] + "InnerBefore"] - e.flexStyle[r[1] + "InnerAfter"] - e.flexStyle[r[1] + "BorderBefore"] - e.flexStyle[r[1] + "BorderAfter"]); for (var l, f = -1; l = e.children[++f];) { var i = l.element.style, s = "inline" === l.mainAxis ? ["main", "cross"] : ["cross", "main"]; i.boxSizing = "content-box", i.display = "block", i.position = "absolute", "auto" !== l.flexStyle[s[0]] && (i.width = n(l.flexStyle[s[0]] - l.flexStyle[s[0] + "InnerBefore"] - l.flexStyle[s[0] + "InnerAfter"] - l.flexStyle[s[0] + "BorderBefore"] - l.flexStyle[s[0] + "BorderAfter"])), "auto" !== l.flexStyle[s[1]] && (i.height = n(l.flexStyle[s[1]] - l.flexStyle[s[1] + "InnerBefore"] - l.flexStyle[s[1] + "InnerAfter"] - l.flexStyle[s[1] + "BorderBefore"] - l.flexStyle[s[1] + "BorderAfter"])), i.top = n(l.flexStyle[s[1] + "Start"]), i.left = n(l.flexStyle[s[0] + "Start"]), i.marginTop = n(l.flexStyle[s[1] + "Before"]), i.marginRight = n(l.flexStyle[s[0] + "After"]), i.marginBottom = n(l.flexStyle[s[1] + "After"]), i.marginLeft = n(l.flexStyle[s[0] + "Before"]) } } function n(e) { return "string" == typeof e ? e : Math.max(e, 0) + "px" } t.exports = l; var o = e("../flexbox") }, { "../flexbox": 7 }], 18: [function(e, t, r) { function l(e) { for (var t, r = -1; t = e[++r];) n(t) } t.exports = l; var n = e("../write") }, { "../write": 17 }] }, {}, [13])(13) }); skip-link-focus-fix.js 0000666 00000001776 15214245400 0010720 0 ustar 00 /** * File skip-link-focus-fix.js * * Helps with accessibility for keyboard only users. * This is the source file for what is minified in the astra_skip_link_focus_fix() PHP function. * * Learn more: https://github.com/Automattic/_s/pull/136 * * @package Astra */ ( function() { var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) { window.addEventListener( 'hashchange', function() { var id = location.hash.substring( 1 ), element; if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { return; } element = document.getElementById( id ); if ( element ) { if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { element.tabIndex = -1; } element.focus(); } }, false ); } })();
| ver. 1.4 |
Github
|
.
| PHP 7.0.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings