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

1 line
78 KiB
JavaScript
Raw Normal View History

2024-02-01 17:24:18 +05:30
function astra_font_size_rem(t,e,o){var s="";return""!=t&&(o=null!=typeof 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,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(n,r,a,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+"-"+n).remove(),(s=o=e="")!=t.desktop&&(e=a+": "+t.desktop),""!=t.tablet&&(o=a+": "+t.tablet),""!=t.mobile&&(s=a+": "+t.mobile),jQuery("head").append('<style id="'+r+"-"+n+'">'+i+"\t{ "+e+" }@media (max-width: 768px) {"+i+"\t{ "+o+" } }@media (max-width: 544px) {"+i+"\t{ "+s+" } }</style>")):jQuery("style#"+r+"-"+n).remove()})})}function astra_responsive_font_size(r,a){wp.customize(r,function(t){t.bind(function(t){var e,o,s,n;t.desktop||t.mobile||t.tablet?(r=(r=r.replace("[","-")).replace("]",""),s=o=e="",n="font-size",jQuery("style#"+r+"-"+n).remove(),""!=t.desktop&&(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"])),"px"==t["desktop-unit"]&&(e=astra_font_size_rem(t.desktop,!0,"desktop")),jQuery("head").append('<style id="'+r+"-"+n+'">'+a+"\t{ "+e+" }@media (max-width: 768px) {"+a+"\t{ "+o+" } }@media (max-width: 544px) {"+a+"\t{ "+s+" } }</style>")):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=(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,u,l,c){wp.customize(i,function(t){t.bind(function(o){var s,n,r,t,e="",a="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?(null!=typeof c&&(e=(e=c+"").replace(/,/g,"-")),null!=typeof l&&(a=l+""),i=(i=i.replace("[","-")).replace("]",""),jQuery("style#"+i+"-"+a+"-"+e).remove(),r=n=s="",t=null!=typeof c?c:["top","bottom","right","left"],jQuery.each(t,function(t,e){""!=o.desktop[e]&&(s+=a+"-"+e+": "+o.desktop[e]+o["desktop-unit"]+";")}),jQuery.each(t,function(t,e){""!=o.tablet[e]&&(n+=a+"-"+e+": "+o.tablet[e]+o["tablet-unit"]+";")}),jQuery.each(t,function(t,e){""!=o.mobile[e]&&(r+=a+"-"+e+": "+o.mobile[e]+o["mobile-unit"]+";")}),jQuery("head").append('<style id="'+i+"-"+a+"-"+e+'">'+u+"\t{ "+s+" }@media (max-width: 768px) {"+u+"\t{ "+n+" } }@media (max-width: 544px) {"+u+"\t{ "+r+" } }</style>")):(wp.customize.preview.send("refresh"),jQuery("style#"+i+"-"+a+"-"+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,(!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,n,r,a=!1){wp.customize(o,function(t){t.bind(function(t){var e;o=(o=o.replace("[","-")).replace("]",""),(t||0===t)&&(void 0!==r&&("url"===r?t="url("+t+")":t+=r),e=a?" !important":"",jQuery("style#"+o+"-"+s).remove(),jQuery("head").append('<style id="'+o+"-"+s+'">'+n+"\t{ "+s+": "+t+e+" }</style>"),"unset"!==t)||jQuery("style#"+o+"-"+s).remove()})})}function as