kollapsminoriteten/wp-content/themes/astra/assets/js/minified/customizer-preview.min.js

36 lines
84 KiB
JavaScript
Raw Normal View History

2026-03-31 11:30:59 +02:00
function astra_font_size_rem(t,e,o){var s="";return""!=t&&(o=void 0!==o?o:"desktop",s="font-size: "+t+"px;",e)&&((e=wp.customize("astra-settings[font-size-body]").get()).desktop=""!=e.desktop?e.desktop:15,e.tablet=""!=e.tablet?e.tablet:e.desktop,e.mobile=""!=e.mobile?e.mobile:e.tablet,"px"===e[o+"-unit"])&&(s+="font-size: "+t/e[o]+"rem;"),s}function astra_refresh_customizer(t){wp.customize(t,function(t){t.bind(function(t){wp.customize.preview.send("refresh")})})}function astra_color_responsive_css(a,r,n,i){wp.customize(r,function(t){t.bind(function(t){var e,o,s;t.desktop||t.mobile||t.tablet?(r=(r=r.replace("[","-")).replace("]",""),jQuery("style#"+r+"-"+a).remove(),(s=o=e="")!=t.desktop&&(e=n+": "+t.desktop),""!=t.tablet&&(o=n+": "+t.tablet),""!=t.mobile&&(s=n+": "+t.mobile),jQuery("head").append('<style id="'+r+"-"+a+'">'+i+"\t{ "+e+" }@media (max-width: 768px) {"+i+"\t{ "+o+" } }@media (max-width: 544px) {"+i+"\t{ "+s+" } }</style>")):jQuery("style#"+r+"-"+a).remove()})})}function astra_responsive_font_size(r,n,i=!1,l=""){wp.customize(r,function(t){t.bind(function(t){var e,o,s,a;t.desktop||t.mobile||t.tablet?(r=(r=r.replace("[","-")).replace("]",""),a="font-size",e="px"==t["desktop-unit"]?astra_font_size_rem(t.desktop,!0,"desktop"):"",s=o="",jQuery("style#"+r+"-"+a).remove(),""!=t.desktop&&(e=e||"font-size: "+t.desktop+(null==t["desktop-unit"]?"px":t["desktop-unit"])),""!=t.tablet&&(o="font-size: "+t.tablet+(null==t["tablet-unit"]?"px":t["tablet-unit"])),""!=t.mobile&&(s="font-size: "+t.mobile+(null==t["mobile-unit"]?"px":t["mobile-unit"])),jQuery("head").append('<style id="'+r+"-"+a+'">'+n+"\t{ "+e+" }@media (max-width: 768px) {"+n+"\t{ "+o+" } }@media (max-width: 544px) {"+n+"\t{ "+s+" } }</style>"),i&&(a=new CustomEvent("AstraStyleGuideElementUpdated",{detail:{value:{desktop:t.desktop+(null==t["desktop-unit"]?"px":t["desktop-unit"]),tablet:t.tablet+(null==t["tablet-unit"]?"px":t["tablet-unit"]),mobile:t.mobile+(null==t["mobile-unit"]?"px":t["mobile-unit"])},selector:l}}),document.dispatchEvent(a))):jQuery("style#"+r+"-font-size").remove()})})}function astra_font_extras_css(o,s){wp.customize("astra-settings["+o+"]",function(t){t.bind(function(t){var e;t?(jQuery("style#"+o).remove(),e=s+" { line-height : "+t["line-height"]+t["line-height-unit"]+";",e=(e+="letter-spacing : "+t["letter-spacing"]+t["letter-spacing-unit"]+";")+"text-decoration : "+t["text-decoration"]+";text-transform : "+t["text-transform"]+";}",jQuery("head").append('<style id="'+o+'">'+e+"</style>")):jQuery("style#"+o).remove()})})}function astra_responsive_spacing(i,l,u,c){wp.customize(i,function(t){t.bind(function(o){var s,a,r,t,e="",n="padding";o.desktop.top||o.desktop.right||o.desktop.bottom||o.desktop.left||o.tablet.top||o.tablet.right||o.tablet.bottom||o.tablet.left||o.mobile.top||o.mobile.right||o.mobile.bottom||o.mobile.left?(void 0!==c&&(e=(e=c+"").replace(/,/g,"-")),void 0!==u&&(n=u+""),i=(i=i.replace("[","-")).replace("]",""),jQuery("style#"+i+"-"+n+"-"+e).remove(),r=a=s="",t=void 0!==c?c:["top","bottom","right","left"],jQuery.each(t,function(t,e){""!=o.desktop[e]&&(s+=n+"-"+e+": "+o.desktop[e]+o["desktop-unit"]+";")}),jQuery.each(t,function(t,e){""!=o.tablet[e]&&(a+=n+"-"+e+": "+o.tablet[e]+o["tablet-unit"]+";")}),jQuery.each(t,function(t,e){""!=o.mobile[e]&&(r+=n+"-"+e+": "+o.mobile[e]+o["mobile-unit"]+";")}),jQuery("head").append('<style id="'+i+"-"+n+"-"+e+'">'+l+"\t{ "+s+" }@media (max-width: 768px) {"+l+"\t{ "+a+" } }@media (max-width: 544px) {"+l+"\t{ "+r+" } }</style>")):(wp.customize.preview.send("refresh"),jQuery("style#"+i+"-"+n+"-"+e).remove())})})}function astra_css_font_size(o,s){wp.customize(o,function(t){t.bind(function(t){var e;t?(o=(o=o.replace("[","-")).replace("]",""),jQuery("style#"+o).remove(),e="font-size: "+t,(!Number.isNaN(t)||0<=t.indexOf("px"))&&(e=astra_font_size_rem(t=t.replace("px",""),!0)),jQuery("head").append('<style id="'+o+'">'+s+"\t{ "+e+" }</style>")):jQuery("style#"+o).remove()})})}function get_hexdec(t){t=t.toString(16);return parseInt(t,16)}function astra_css(o,s,a,r,n=!1,i=""){wp.customize(o,function
2025-07-27 19:55:19 +02:00
max-width: ${t.desktop}px;
width: ${t.desktop}px;
}
@media( max-width: ${e}px ) {
#masthead .site-logo-img .custom-logo-link img, .ast-sg-logo-section .site-logo-img .custom-logo-link img {
max-width: ${t.tablet}px;
width: ${t.tablet}px;
}
#masthead .site-logo-img img {
max-width: ${t.tablet}px;
width: ${t.tablet}px;
}
}
@media( max-width: ${o}px ) {
#masthead .site-logo-img .custom-logo-link img, .ast-sg-logo-section .site-logo-img .custom-logo-link img {
max-width: ${t.mobile}px;
width: ${t.mobile}px;
}
#masthead .site-logo-img img {
max-width: ${t.mobile}px;
max-height: ${t.mobile}px;
}
}`),astra_add_dynamic_css("mobile-header-logo-width",".ast-header-break-point #masthead .site-logo-img .custom-mobile-logo-link img, .ast-header-break-point .ast-sg-logo-section .site-logo-img .custom-mobile-logo-link img { max-width: "+t.tablet+"px; } @media( max-width: "+e+"px ) { .ast-header-break-point #masthead .site-logo-img .custom-mobile-logo-link img, .ast-header-break-point .ast-sg-logo-section .site-logo-img .custom-mobile-logo-link img { max-width: "+t.tablet+"px; } @media( max-width: "+o+"px ) { .ast-header-break-point #masthead .site-logo-img .custom-mobile-logo-link img { max-width: "+t.mobile+"px; }"),astra_add_dynamic_css("ast-header-responsive-logo-svg-icon-width","#masthead .ast-logo-svg-icon svg, .ast-sg-logo-section .ast-logo-svg-icon svg { width: "+t.desktop+"px; } @media( max-width: "+e+"px ) { #masthead .ast-logo-svg-icon svg, .ast-sg-logo-section .ast-logo-svg-icon svg { width: "+t.tablet+"px; } #masthead .ast-logo-svg-icon svg, .ast-sg-logo-section .ast-logo-svg-icon svg { width: "+t.tablet+"px; } } @media( max-width: "+o+"px ) { #masthead .ast-logo-svg-icon svg, .ast-sg-logo-section .ast-logo-svg-icon svg { width: "+t.mobile+"px; }#masthead .ast-logo-svg-icon svg, .ast-sg-logo-section .ast-logo-svg-icon svg { width: "+t.mobile+"px; } }")):wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[logo-svg-site-title-gap]",function(t){t.bind(function(t){var e=astraCustomizer.tablet_breakpoint||921;""!=t.desktop||""!=t.tablet||""!=t.mobile?astra_add_dynamic_css("logo-svg-site-title-gap",`.ast-logo-title-inline .ast-site-identity {
gap: ${t.desktop}px;
}
@media( max-width: ${e}px ) {
.ast-logo-title-inline .ast-site-identity {
gap: ${t.tablet}px;
}
}
@media( max-width: ${astraCustomizer.mobile_breakpoint||544}px ) {
.ast-logo-title-inline .ast-site-identity {
gap: ${t.mobile}px;
}
2026-03-31 11:30:59 +02:00
}`):wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[display-site-title-responsive]",function(t){t.bind(function(t){astra_add_dynamic_css("display-site-title-responsive",".ast-site-title-wrap .site-title { display: "+(t.desktop?"block":"none")+";} @media( max-width: "+(astraBuilderPreview.tablet_break_point||921)+"px) { .ast-site-title-wrap .site-title { display: "+(t.tablet?"block":"none")+";} } @media( max-width: "+(astraBuilderPreview.mobile_break_point||544)+"px) { .ast-site-title-wrap .site-title { display: "+(t.mobile?"block":"none")+";} }")})}),wp.customize("astra-settings[display-site-tagline-responsive]",function(t){t.bind(function(t){astra_add_dynamic_css("display-site-tagline-responsive",".ast-site-title-wrap .site-description { display: "+(t.desktop?"block":"none")+";} @media( max-width: "+(astraBuilderPreview.tablet_break_point||768)+"px) { .ast-site-title-wrap .site-description { display: "+(t.tablet?"block":"none")+";} } @media( max-width: "+(astraBuilderPreview.mobile_break_point||544)+"px) { .ast-site-title-wrap .site-description { display: "+(t.mobile?"block":"none")+";} }")})}),wp.customize("astra-settings[site-content-width]",function(t){t.bind(function(t){var e=(e="@media (min-width: 554px) {")+(".ast-container, .fl-builder #content .entry-header { max-width: "+(40+parseInt(t))+"px } ")+"}";astra_add_dynamic_css("site-content-width",e=jQuery("body").hasClass("ast-page-builder-template")?(e+="@media (min-width: 554px) {")+".ast-page-builder-template .comments-area { max-width: "+(40+parseInt(t))+"px } }":e)})}),wp.customize("astra-settings[header-main-menu-label]",function(t){t.bind(function(t){var e;0<r("button.main-header-menu-toggle .mobile-menu-wrap .mobile-menu").length?""!=t?r("button.main-header-menu-toggle .mobile-menu-wrap .mobile-menu").text(t):r("button.main-header-menu-toggle .mobile-menu-wrap").remove():(e=r("button.main-header-menu-toggle").html(),""!=t&&(e+='<div class="mobile-menu-wrap"><span class="mobile-menu">'+t+"</span> </div>"),r("button.main-header-menu-toggle").html(e))})});var e,t=t=>{astra_apply_responsive_background_css("astra-settings[content-bg-obj-responsive]",t,"desktop"),astra_apply_responsive_background_css("astra-settings[content-bg-obj-responsive]",t,"tablet"),astra_apply_responsive_background_css("astra-settings[content-bg-obj-responsive]",t,"mobile")};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"),astraCustomizer.is_content_bg_option_to_load&&(e=astraCustomizer.content_layout,p=astraCustomizer.site_layout,o=void 0!==wp.customize._value["astra-settings[blog-grid]"]?wp.customize._value["astra-settings[blog-grid]"]._value:1,g=".ast-separate-container .ast-article-single:not(.ast-related-post), .ast-separate-container .comments-area .comment-respond,.ast-separate-container .comments-area .ast-comment-list li, .ast-separate-container .ast-woocommerce-container, .ast-separate-container .error-404, .ast-separate-container .no-results, .single.ast-separate-container .site-main .ast-author-meta, .ast-separate-container .related-posts, .ast-separate-container .comments-count-wrapper, .ast-separate-container .comments-area .comments-title, .ast-single-related-posts-container, .ast-plain-container, .site-content article .ast-article-inner","blog-layout-1"==(void 0!==wp.customize._value["astra-settings[blog-layout]"]?wp.customize._value["astra-settings[blog-layout]"]._value:"blog-layout-1")&&1!=o&&(g+=", .ast-separate-container .ast-article-inner"),"boxed-container"==e?t(g+=", .ast-separate-container.ast-two-container #secondary .widget"):"content-boxed-container"==e?t(g):!astraCustomizer.apply_content_bg_fullwidth_layouts||"ast-box-layout"!==p&&"ast-padded-layout"!==p||"plain-container"!==e?astra