rebase from live enviornment

This commit is contained in:
Rachit Bhargava
2024-01-09 22:14:20 -05:00
parent ff0b49a046
commit 3a22fcaa4a
15968 changed files with 2344674 additions and 45234 deletions

View File

@@ -0,0 +1,62 @@
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item:focus,
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item:active {
outline: thin dotted;
}
.wp-block-wpsp-faq-child .wpsp-faq-questions-button {
display: flex;
align-items: center;
width: 100%;
}
.wp-block-wpsp-faq-child .wpsp-faq-questions-button .wpsp-faq-icon-wrap {
display: inline-block;
vertical-align: middle;
}
.wp-block-wpsp-faq-child .wpsp-faq-questions-button .wpsp-question {
width: 100%;
margin-top: 0;
margin-bottom: 0;
}
.wp-block-wpsp-faq-child .wpsp-icon svg,
.wp-block-wpsp-faq-child .wpsp-icon-active svg {
width: 15px;
height: 15px;
font-size: 15px;
}
.wp-block-wpsp-faq-child .wpsp-faq-content span {
display: inline-block;
}
.wp-block-wpsp-faq-child .wpsp-faq-content p {
margin: 0;
}
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item .wpsp-icon-active,
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon {
display: none;
width: 0;
padding: 0;
height: 0;
margin: 0;
}
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item .wpsp-icon,
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon-active {
display: inline-block;
width: auto;
height: auto;
}
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item .wpsp-icon,
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon-active {
display: none;
}
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item span.wpsp-icon-active.wpsp-faq-icon-wrap,
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon-active {
display: none;
}

View File

@@ -0,0 +1,9 @@
.wp-block-wpsp-faq.wpsp-faq-layout-accordion .wpsp-faq-child__outer-wrap .wpsp-faq-questions-button {
cursor: pointer;
}
.wpsp-faq-layout-grid.wpsp-faq-equal-height .wpsp-faq__wrap .wpsp-faq-child__outer-wrap,
.wpsp-faq-layout-grid.wpsp-faq-equal-height .wpsp-faq__wrap .wpsp-faq-child__wrapper,
.wpsp-faq-layout-grid.wpsp-faq-equal-height .wpsp-faq__wrap .wpsp-faq-item {
height: 100%;
}

View File

@@ -0,0 +1,454 @@
.wpsp-editor-bg-image-control .components-button {
vertical-align: middle;
margin-left: 10px;
}
.wpsp-editor-bg-image-control .components-button:last-child {
margin-left: 10px;
}
.wpsp-ifb-icon-wrap,
.wpsp-ifb-icon-wrap * {
-webkit-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
.wpsp-ifb-icon-wrap .wpsp-ifb-icon,
.wpsp-ifb-content {
display: inline-block;
}
.wpsp-ifb-icon svg {
width: inherit;
height: inherit;
vertical-align: middle;
fill: #333;
}
.wpsp-howto-child-icon-above-title .wpsp-ifb-left-right-wrap {
text-align: center;
}
a.wpsp-howto-child-cta-link span {
font-size: inherit;
}
.wpsp-ifb-cta.wpsp-howto-child-cta-link-style:empty {
display: none;
}
a.wpsp-howto-child-cta-link,
.entry .entry-content a.wpsp-howto-child-cta-link,
a.wpsp-howto-child-link-wrap,
.entry .entry-content a.wpsp-howto-child-link-wrap {
text-decoration: none;
}
a.wpsp-howto-child-cta-link:hover,
.entry .entry-content a.wpsp-howto-child-cta-link:hover,
a.wpsp-howto-child-link-wrap:hover,
.entry .entry-content a.wpsp-howto-child-link-wrap:hover .entry .entry-content a.wpsp-howto-child-cta-link:hover {
color: inherit;
}
.wpsp-howto-child-icon-left-title.wpsp-howto-child-image-valign-middle .wpsp-ifb-title-wrap,
.wpsp-howto-child-icon-right-title.wpsp-howto-child-image-valign-middle .wpsp-ifb-title-wrap,
.wpsp-howto-child-image-valign-middle .wpsp-ifb-imgicon-wrap,
.wpsp-howto-child-icon-left.wpsp-howto-child-image-valign-middle .wpsp-ifb-content,
.wpsp-howto-child-icon-right.wpsp-howto-child-image-valign-middle .wpsp-ifb-content {
-ms-flex-item-align: center;
-webkit-align-self: center;
align-self: center;
}
.wpsp-howto-child-left {
text-align: left;
-webkit-box-pack: start;
-ms-flex-pack: start;
-webkit-justify-content: flex-start;
-moz-box-pack: start;
justify-content: flex-start;
}
.wpsp-howto-child-center {
text-align: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
-moz-box-pack: center;
justify-content: center;
}
.wpsp-howto-child-right {
text-align: right;
-webkit-box-pack: end;
-ms-flex-pack: end;
-webkit-justify-content: flex-end;
-moz-box-pack: end;
justify-content: flex-end;
}
.wpsp-ifb-left-right-wrap {
width: 100%;
word-break: break-word;
z-index: 1;
}
.wpsp-howto-child-icon-above-title .wpsp-ifb-left-right-wrap,
.wpsp-howto-child-icon-below-title .wpsp-ifb-left-right-wrap {
display: block;
min-width: 100%;
width: 100%;
}
.wpsp-howto-child-icon-left-title .wpsp-ifb-icon-wrap,
.wpsp-howto-child-icon-left .wpsp-ifb-icon-wrap {
margin-right: 10px;
}
.wpsp-howto-child-icon-right-title .wpsp-ifb-icon-wrap,
.wpsp-howto-child-icon-right .wpsp-ifb-icon-wrap {
margin-left: 10px;
}
/* stylelint-disable declaration-block-no-duplicate-properties */
.wpsp-howto-child-icon-left .wpsp-ifb-left-right-wrap,
.wpsp-howto-child-icon-right .wpsp-ifb-left-right-wrap,
.wpsp-howto-child-icon-left-title .wpsp-ifb-left-title-image,
.wpsp-howto-child-icon-right-title .wpsp-ifb-right-title-image {
display: -webkit-box;
display: -ms-flexbox;
-js-display: flex;
display: -webkit-flex;
display: -moz-box;
display: flex;
}
.wpsp-howto-child-icon-right .wpsp-ifb-left-right-wrap,
.wpsp-howto-child-icon-right-title .wpsp-ifb-right-title-image {
-webkit-box-pack: end;
-ms-flex-pack: end;
-webkit-justify-content: flex-end;
-moz-box-pack: end;
justify-content: flex-end;
}
.wpsp-ifb-icon-wrap .wpsp-ifb-icon span {
font-style: initial;
height: auto;
width: auto;
}
.wpsp-ifb-imgicon-wrap .wpsp-ifb-image-content {
display: inline-block;
line-height: 0;
position: relative;
max-width: 100%;
}
.wpsp-ifb-imgicon-wrap .wpsp-ifb-image-content img {
display: inline;
height: auto !important;
max-width: 100%;
width: auto;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
-webkit-border-radius: inherit;
border-radius: inherit;
}
.wpsp-ifb-imgicon-wrap .wpsp-image-crop-circle img {
-webkit-border-radius: 100%;
border-radius: 100%;
}
.wpsp-ifb-imgicon-wrap .wpsp-image-crop-square img {
-webkit-border-radius: 0;
border-radius: 0;
}
.wpsp-howto-child-module-link {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
bottom: 0;
right: 0;
z-index: 4;
}
.wpsp-edit-mode .wpsp-howto-child-module-link {
z-index: 2;
}
.wpsp-howto-child-link-icon-after {
margin-left: 5px;
margin-right: 0;
}
.wpsp-howto-child-link-icon-before {
margin-left: 0;
margin-right: 5px;
}
.wpsp-howto-child-link-icon {
-webkit-transition: all 200ms linear;
transition: all 200ms linear;
}
.wpsp-howto-child {
position: relative;
}
.wpsp-ifb-separator {
width: 30%;
border-top-width: 2px;
border-top-color: #333;
border-top-style: solid;
display: inline-block;
margin: 0;
}
.wpsp-ifb-separator-parent {
line-height: 0;
margin-left: 0;
margin-right: 0;
margin-bottom: 10px;
}
.wpsp-ifb-cta-button {
display: inline-block;
line-height: 1;
background-color: #818a91;
color: #fff;
text-align: center;
}
.wpsp-ifb-button-wrapper .wp-block-button__link svg {
fill: currentColor;
}
.wpsp-ifb-cta a {
-webkit-box-shadow: none;
box-shadow: none;
text-decoration: none;
}
.wpsp-ifb-title-wrap {
width: 100%;
}
.wpsp-ifb-title-wrap .wpsp-ifb-title,
.wpsp-ifb-title-wrap {
padding: 0;
margin: 0;
display: block;
}
.wpsp-how-to__content-wrap.wpsp-howto-child {
position: relative;
}
.wpsp-ifb-icon span {
font-size: 40px;
height: 40px;
color: #333;
width: 40px;
}
.wpsp-ifb-content {
width: 100%;
}
.wpsp-how-to__content-wrap.wpsp-howto-child,
.wpsp-ifb-content,
.wpsp-ifb-title-wrap,
svg.dashicon.dashicons-upload {
z-index: 1;
}
.wpsp-howto-child-cta-link {
cursor: pointer;
}
a.wpsp-howto-child-link-wrap {
color: inherit;
}
.wpsp-ifb-content p:empty {
display: none;
}
.wpsp-howto-child .wpsp-ifb-icon,
.wpsp-howto-child .wpsp-ifb-image-content img {
display: inline-block;
box-sizing: content-box;
}
.wpsp-ifb-align-icon-after {
margin-left: 5px;
}
.wpsp-ifb-align-icon-before {
margin-right: 5px;
}
span.wpsp-ifb-button-icon.wpsp-ifb-align-icon-after {
float: right;
}
.wpsp-ifb-button-icon {
height: 15px;
width: 15px;
font-size: 15px;
vertical-align: middle;
}
.wpsp-ifb-text-icon {
height: 15px;
width: 15px;
font-size: 15px;
line-height: 15px;
vertical-align: middle;
display: inline-block;
}
.wpsp-ifb-button-icon svg,
.wpsp-ifb-text-icon svg {
height: inherit;
width: inherit;
display: inline-block;
}
.block-editor-page #wpwrap .wpsp-howto-child-cta-link svg,
.wpsp-howto-child-cta-link svg {
font-style: normal;
}
.wpsp-howto-child__outer-wrap {
position: relative;
margin-top: 25px;
}
a.wpsp-how-to__link-to-all {
height: 100%;
width: 100%;
top: 0;
left: 0;
position: absolute;
z-index: 3;
-webkit-box-shadow: none;
box-shadow: none;
text-decoration: none;
}
@media only screen and (max-width: 976px) {
.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
padding: 0;
margin-bottom: 20px;
}
.wpsp-howto-child-stacked-tablet.wpsp-reverse-order-tablet .wpsp-ifb-left-right-wrap {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
-js-display: inline-flex;
display: -webkit-inline-flex;
display: -moz-inline-box;
display: inline-flex;
-webkit-box-orient: vertical;
-webkit-box-direction: reverse;
-ms-flex-direction: column-reverse;
-webkit-flex-direction: column-reverse;
-moz-box-orient: vertical;
-moz-box-direction: reverse;
flex-direction: column-reverse;
}
.wpsp-howto-child.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-content,
.wpsp-howto-child.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
display: block;
width: 100%;
text-align: center;
}
.wpsp-howto-child.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
margin-left: 0;
margin-right: 0;
}
.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap {
display: inline-block;
}
.wpsp-howto-child-icon-left-title.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap,
.wpsp-howto-child-icon-left.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap {
margin-right: 0;
}
.wpsp-howto-child-icon-right-title.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap,
.wpsp-howto-child-icon-right.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap {
margin-left: 0;
}
.wpsp-howto-child-icon-left-title .wpsp-ifb-separator-parent {
margin: 10px 0;
}
}
@media screen and (max-width: 767px) {
.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
padding: 0;
margin-bottom: 20px;
}
.wpsp-howto-child-stacked-mobile.wpsp-reverse-order-mobile .wpsp-ifb-left-right-wrap {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
-js-display: inline-flex;
display: -webkit-inline-flex;
display: -moz-inline-box;
display: inline-flex;
-webkit-box-orient: vertical;
-webkit-box-direction: reverse;
-ms-flex-direction: column-reverse;
-webkit-flex-direction: column-reverse;
-moz-box-orient: vertical;
-moz-box-direction: reverse;
flex-direction: column-reverse;
}
.wpsp-howto-child.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-content,
.wpsp-howto-child.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
display: block;
width: 100%;
text-align: center;
}
.wpsp-howto-child.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
margin-left: 0;
margin-right: 0;
}
.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap {
display: inline-block;
}
.wpsp-howto-child-icon-left-title.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap,
.wpsp-howto-child-icon-left.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap {
margin-right: 0;
}
.wpsp-howto-child-icon-right-title.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap,
.wpsp-howto-child-icon-right.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap {
margin-left: 0;
}
.wpsp-howto-child-icon-left-title .wpsp-ifb-separator-parent {
margin: 10px 0;
}
}

View File

@@ -0,0 +1,28 @@
.wpsp-howto__cost-wrap {
display: block;
}
.wpsp-howto__cost-wrap .wpsp-howto-estcost-text,
.wpsp-howto__cost-wrap .wpsp-howto-estcost-value,
.wpsp-howto__cost-wrap .wpsp-howto-estcost-type {
display: inline-flex;
}
.wpsp-howto__time-wrap {
display: block;
}
.wpsp-howto__time-wrap .wpsp-howto-timeNeeded-text,
.wpsp-howto__time-wrap .wpsp-howto-timeNeeded-value,
.wpsp-howto__time-wrap .wpsp-howto-timeINmin-text {
display: inline-flex;
}
.wpsp-howto__time-wrap .wpsp-howto-timeINmin-text {
margin-left: 5px;
}
.wpsp-how-to-main-wrap .wpsp-tools__wrap,
.wpsp-how-to-main-wrap .wpsp-how-to-materials {
margin-bottom: 20px;
}

View File

@@ -0,0 +1,225 @@
function WPSPslideUp( wpsptarget, duration ) {
wpsptarget.style.transitionProperty = 'height, margin, padding';
wpsptarget.style.transitionDuration = duration + 'ms';
wpsptarget.style.boxSizing = 'border-box';
wpsptarget.style.height = wpsptarget.offsetHeight + 'px';
wpsptarget.style.overflow = 'hidden';
wpsptarget.style.height = 0;
wpsptarget.style.paddingTop = 0;
wpsptarget.style.paddingBottom = 0;
wpsptarget.style.marginTop = 0;
wpsptarget.style.marginBottom = 0;
window.setTimeout( function () {
wpsptarget.style.display = 'none';
wpsptarget.style.removeProperty( 'height' );
wpsptarget.style.removeProperty( 'padding-top' );
wpsptarget.style.removeProperty( 'padding-bottom' );
wpsptarget.style.removeProperty( 'margin-top' );
wpsptarget.style.removeProperty( 'margin-bottom' );
wpsptarget.style.removeProperty( 'overflow' );
wpsptarget.style.removeProperty( 'transition-duration' );
wpsptarget.style.removeProperty( 'transition-property' );
}, duration );
}
function WPSPslideDown( wpsptarget, duration ) {
wpsptarget.style.removeProperty( 'display' );
let display = window.getComputedStyle( wpsptarget ).display;
if ( display === 'none' ) display = 'block';
wpsptarget.style.display = display;
const height = wpsptarget.offsetHeight;
wpsptarget.style.overflow = 'hidden';
wpsptarget.style.height = 0;
wpsptarget.style.paddingTop = 0;
wpsptarget.style.paddingBottom = 0;
wpsptarget.style.marginTop = 0;
wpsptarget.style.marginBottom = 0;
wpsptarget.style.boxSizing = 'border-box';
wpsptarget.style.transitionProperty = 'height, margin, padding';
wpsptarget.style.transitionDuration = duration + 'ms';
wpsptarget.style.height = height + 'px';
wpsptarget.style.removeProperty( 'padding-top' );
wpsptarget.style.removeProperty( 'padding-bottom' );
wpsptarget.style.removeProperty( 'margin-top' );
wpsptarget.style.removeProperty( 'margin-bottom' );
window.setTimeout( function () {
wpsptarget.style.removeProperty( 'height' );
wpsptarget.style.removeProperty( 'overflow' );
wpsptarget.style.removeProperty( 'transition-duration' );
wpsptarget.style.removeProperty( 'transition-property' );
}, duration );
}
function setupFAQ() {
const pattern = new RegExp( '^[\\w\\-]+$' );
const hashval = window.location.hash.substring( 1 );
const expandFirstelements = document.getElementsByClassName(
'wpsp-faq-expand-first-true'
);
const inactiveOtherelements = document.getElementsByClassName(
'wpsp-faq-inactive-other-false'
);
if (
document.getElementById( hashval ) !== undefined &&
document.getElementById( hashval ) !== null &&
document.getElementById( hashval ) !== '' &&
pattern.test( hashval )
) {
const elementToOpen = document.getElementById( hashval );
if (
elementToOpen.getElementsByClassName( 'wpsp-faq-item' )[ 0 ] !==
undefined
) {
elementToOpen
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
.classList.add( 'wpsp-faq-item-active' );
elementToOpen
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
.setAttribute( 'aria-expanded', true );
WPSPslideDown(
elementToOpen.getElementsByClassName( 'wpsp-faq-content' )[ 0 ],
500
);
}
} else {
for ( let item = 0; item < expandFirstelements.length; item++ ) {
if (
true ===
expandFirstelements[ item ].classList.contains(
'wpsp-faq-layout-accordion'
)
) {
expandFirstelements[ item ]
.querySelectorAll( '.wpsp-faq-child__outer-wrap' )[ 0 ]
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
.classList.add( 'wpsp-faq-item-active' );
expandFirstelements[ item ]
.querySelectorAll( '.wpsp-faq-child__outer-wrap' )[ 0 ]
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
.setAttribute( 'aria-expanded', true );
expandFirstelements[ item ]
.querySelectorAll( '.wpsp-faq-child__outer-wrap' )[ 0 ]
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
.querySelectorAll(
'.wpsp-faq-content'
)[ 0 ].style.display = 'block';
}
}
}
for (
let otherItem = 0;
otherItem < inactiveOtherelements.length;
otherItem++
) {
if (
true ===
inactiveOtherelements[ otherItem ].classList.contains(
'wpsp-faq-layout-accordion'
)
) {
const otherItems = inactiveOtherelements[
otherItem
].querySelectorAll( '.wpsp-faq-child__outer-wrap' );
for (
let childItem = 0;
childItem < otherItems.length;
childItem++
) {
otherItems[ childItem ]
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
.classList.add( 'wpsp-faq-item-active' );
otherItems[ childItem ]
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
.setAttribute( 'aria-expanded', true );
otherItems[ childItem ]
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
.querySelectorAll(
'.wpsp-faq-content'
)[ 0 ].style.display = 'block';
}
}
}
}
/* eslint-disable */
window.addEventListener('load', function () {
/* eslint-enable */
setupFAQ();
const accordionElements = document.getElementsByClassName(
'wpsp-faq-layout-accordion'
);
for ( let item = 0; item < accordionElements.length; item++ ) {
const questionButtons = accordionElements[ item ].querySelectorAll(
'.wpsp-faq-questions-button'
);
for ( let button = 0; button < questionButtons.length; button++ ) {
questionButtons[ button ].parentElement.addEventListener(
'click',
function ( e ) {
WPSPfaqClick( e, this );
}
);
questionButtons[ button ].parentElement.addEventListener(
'keypress',
function ( e ) {
WPSPfaqClick( e, this );
}
);
}
}
} );
function WPSPfaqClick( e, wpspfaqItem ) {
if ( e.target.tagName === 'A' ) {
return;
}
e.preventDefault();
if ( wpspfaqItem.classList.contains( 'wpsp-faq-item-active' ) ) {
wpspfaqItem.classList.remove( 'wpsp-faq-item-active' );
wpspfaqItem.setAttribute( 'aria-expanded', false );
WPSPslideUp(
wpspfaqItem.getElementsByClassName( 'wpsp-faq-content' )[ 0 ],
500
);
} else {
const parent = e.currentTarget.closest( '.wp-block-wpsp-faq' );
let faqToggle = 'true';
if ( parent.classList.contains( 'wp-block-wpsp-faq' ) ) {
faqToggle = parent.getAttribute( 'data-faqtoggle' );
}
wpspfaqItem.classList.add( 'wpsp-faq-item-active' );
wpspfaqItem.setAttribute( 'aria-expanded', true );
WPSPslideDown(
wpspfaqItem.getElementsByClassName( 'wpsp-faq-content' )[ 0 ],
500
);
if ( 'true' === faqToggle ) {
const questionButtons = parent.querySelectorAll(
'.wpsp-faq-questions-button'
);
for (
let buttonChild = 0;
buttonChild < questionButtons.length;
buttonChild++
) {
const buttonItem = questionButtons[ buttonChild ].parentElement;
if ( buttonItem === wpspfaqItem ) {
continue;
}
buttonItem.classList.remove( 'wpsp-faq-item-active' );
buttonItem.setAttribute( 'aria-expanded', false );
WPSPslideUp(
buttonItem.getElementsByClassName(
'wpsp-faq-content'
)[ 0 ],
500
);
}
}
}
}

View File

@@ -0,0 +1 @@
function WPSPslideUp(e,t){e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=t+"ms",e.style.boxSizing="border-box",e.style.height=e.offsetHeight+"px",e.style.overflow="hidden",e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0,e.style.marginTop=0,e.style.marginBottom=0,window.setTimeout(function(){e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")},t)}function WPSPslideDown(e,t){e.style.removeProperty("display");let s=window.getComputedStyle(e).display;"none"===s&&(s="block"),e.style.display=s;var a=e.offsetHeight;e.style.overflow="hidden",e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0,e.style.marginTop=0,e.style.marginBottom=0,e.style.boxSizing="border-box",e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=t+"ms",e.style.height=a+"px",e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),window.setTimeout(function(){e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")},t)}function setupFAQ(){var e=new RegExp("^[\\w\\-]+$"),t=window.location.hash.substring(1),s=document.getElementsByClassName("wpsp-faq-expand-first-true"),a=document.getElementsByClassName("wpsp-faq-inactive-other-false");if(void 0!==document.getElementById(t)&&null!==document.getElementById(t)&&""!==document.getElementById(t)&&e.test(t)){e=document.getElementById(t);void 0!==e.getElementsByClassName("wpsp-faq-item")[0]&&(e.getElementsByClassName("wpsp-faq-item")[0].classList.add("wpsp-faq-item-active"),e.getElementsByClassName("wpsp-faq-item")[0].setAttribute("aria-expanded",!0),WPSPslideDown(e.getElementsByClassName("wpsp-faq-content")[0],500))}else for(let e=0;e<s.length;e++)!0===s[e].classList.contains("wpsp-faq-layout-accordion")&&(s[e].querySelectorAll(".wpsp-faq-child__outer-wrap")[0].getElementsByClassName("wpsp-faq-item")[0].classList.add("wpsp-faq-item-active"),s[e].querySelectorAll(".wpsp-faq-child__outer-wrap")[0].getElementsByClassName("wpsp-faq-item")[0].setAttribute("aria-expanded",!0),s[e].querySelectorAll(".wpsp-faq-child__outer-wrap")[0].getElementsByClassName("wpsp-faq-item")[0].querySelectorAll(".wpsp-faq-content")[0].style.display="block");for(let e=0;e<a.length;e++)if(!0===a[e].classList.contains("wpsp-faq-layout-accordion")){var o=a[e].querySelectorAll(".wpsp-faq-child__outer-wrap");for(let e=0;e<o.length;e++)o[e].getElementsByClassName("wpsp-faq-item")[0].classList.add("wpsp-faq-item-active"),o[e].getElementsByClassName("wpsp-faq-item")[0].setAttribute("aria-expanded",!0),o[e].getElementsByClassName("wpsp-faq-item")[0].querySelectorAll(".wpsp-faq-content")[0].style.display="block"}}function WPSPfaqClick(t,s){if("A"!==t.target.tagName)if(t.preventDefault(),s.classList.contains("wpsp-faq-item-active"))s.classList.remove("wpsp-faq-item-active"),s.setAttribute("aria-expanded",!1),WPSPslideUp(s.getElementsByClassName("wpsp-faq-content")[0],500);else{t=t.currentTarget.closest(".wp-block-wpsp-faq");let e="true";if(t.classList.contains("wp-block-wpsp-faq")&&(e=t.getAttribute("data-faqtoggle")),s.classList.add("wpsp-faq-item-active"),s.setAttribute("aria-expanded",!0),WPSPslideDown(s.getElementsByClassName("wpsp-faq-content")[0],500),"true"===e){var a=t.querySelectorAll(".wpsp-faq-questions-button");for(let e=0;e<a.length;e++){var o=a[e].parentElement;o!==s&&(o.classList.remove("wpsp-faq-item-active"),o.setAttribute("aria-expanded",!1),WPSPslideUp(o.getElementsByClassName("wpsp-faq-content")[0],500))}}}}window.addEventListener("load",function(){setupFAQ();var t=document.getElementsByClassName("wpsp-faq-layout-accordion");for(let e=0;e<t.length;e++){var s=t[e].querySelectorAll(".wpsp-faq-questions-button");for(let e=0;e<s.length;e++)s[e].parentElement.addEventListener("click",function(e){WPSPfaqClick(e,this)}),s[e].parentElement.addEventListener("keypress",function(e){WPSPfaqClick(e,this)})}});