File Editor
Directories:
.. (Back)
Files:
admin.asset.php
admin.css
admin.js
customizer.asset.php
customizer.css
customizer.js
pointer.asset.php
pointer.js
preview.asset.php
preview.js
Create New File
Create
Edit File: preview.js
!function(t){var e={};function s(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,s),i.l=!0,i.exports}s.m=t,s.c=e,s.d=function(t,e,r){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(s.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)s.d(r,i,function(e){return t[e]}.bind(null,i));return r},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=47)}({47:function(t,e,s){t.exports=s(52)},52:function(t,e,s){"use strict";s.r(e);const{wp:r,egfCustomizePreview:{settings:i}}=window;var n=s(8),o=s.n(n);const u=o()("#egf-customizer-preview"),l=(t="")=>t.toLowerCase().replaceAll(" ","_"),c=o()("#egf-customizer-preview"),_=t=>{const{name:e,setting:s,subsetting:r,selector:i,force_styles:n,media_query:u,css_rule:l,with_units:_}=t;wp.customize(`${s}${r}`,t=>{const s=`egf-font-${e}-${l}`;t.bind(t=>{if(!t)return void o()("#"+s).remove();let e=_?`${t.amount}${t.unit}`:""+t;"font_family"===r&&(e=`"${t}"`);let a=`\n <style id='${s}' type='text/css'>\n ${u.open}\n ${i} {\n ${l}: ${e}${n?"!important":""};\n }\n ${u.close}\n </style>\n `;0!==o()("#"+s).length?o()("#"+s).replaceWith(a):o()(a).insertAfter(c)})})},{setting_key:a,config:d,saved:g}=egfCustomizePreview.settings;r.customize.bind("preview-ready",()=>{for(const t in i.config)if(i.config[t].selective_refresh){const{container_inclusive:e,fallback_refresh:s,render_callback:n,selector:o,type:u}=i.config[t].selective_refresh,l=new r.customize.selectiveRefresh.Partial(`${i.setting_key}[${t}]`,{containerInclusive:e,fallbackRefresh:s,renderCallback:n,primarySetting:`${i.setting_key}[${t}]`,settings:[`${i.setting_key}[${t}]`],selector:o,type:u});r.customize.selectiveRefresh.partial.add(l).preparePlacement=function(t){this._initialRenderComplete?$(t.container).addClass("customize-partial-refreshing"):this._initialRenderComplete=!0}}});const b=Object.values(d).filter(({transport:t,type:e})=>"postMessage"===t&&"font"===e);wp.customize.bind("preview-ready",(function(){b.map(t=>{const{name:e}=t,{selector:s,force_styles:r,min_screen:i,max_screen:n}=t.properties,c={setting:`${a}[${e}]`,name:e,selector:s,force_styles:r,media_query:f(i,n),with_units:!1};(t=>{const{setting:e}=t;wp.customize.preview.bind(e,({fontName:t,fontWeightStyle:e})=>{const s=void 0!==egfCustomizePreview.default_fonts[l(t)];if(!t||s)return;const r=Number.isNaN(parseInt(e,10))?400:parseInt(e,10),i=e.includes("italic"),n=400===r;let c="";n&&i&&(c=":ital@1"),i&&!n&&(c=":ital,wght@1,"+r),i||n||(c=":wght@"+r);const _=`https://fonts.googleapis.com/css2?family=${t.replaceAll(" ","+")}${c}&display=swap`,a=`egf-stylesheet-${l(t)}_${l(e)}`,d=`<link id="${a}" rel="stylesheet" href="${_}">`;0===o()("#"+a).length&&o()(d).insertBefore(u)})})(c),_({...c,subsetting:"[font_name]",css_rule:"font-family"}),_({...c,subsetting:"[font_weight]",css_rule:"font-weight"}),_({...c,subsetting:"[font_style]",css_rule:"font-style"}),_({...c,subsetting:"[text_decoration]",css_rule:"text-decoration"}),_({...c,subsetting:"[text_transform]",css_rule:"text-transform"}),_({...c,subsetting:"[font_color]",css_rule:"color"}),_({...c,subsetting:"[background_color]",css_rule:"background-color"}),_({...c,subsetting:"[font_size]",css_rule:"font-size",with_units:!0}),_({...c,subsetting:"[line_height]",css_rule:"line-height"}),_({...c,subsetting:"[letter_spacing]",css_rule:"letter-spacing",with_units:!0}),_({...c,subsetting:"[margin_top]",css_rule:"margin-top",with_units:!0}),_({...c,subsetting:"[margin_bottom]",css_rule:"margin-bottom",with_units:!0}),_({...c,subsetting:"[margin_left]",css_rule:"margin-left",with_units:!0}),_({...c,subsetting:"[margin_right]",css_rule:"margin-right",with_units:!0}),_({...c,subsetting:"[padding_top]",css_rule:"padding-top",with_units:!0}),_({...c,subsetting:"[padding_bottom]",css_rule:"padding-bottom",with_units:!0}),_({...c,subsetting:"[padding_left]",css_rule:"padding-left",with_units:!0}),_({...c,subsetting:"[padding_right]",css_rule:"padding-right",with_units:!0}),_({...c,subsetting:"[border_top_color]",css_rule:"border-top-color"}),_({...c,subsetting:"[border_top_style]",css_rule:"border-top-style"}),_({...c,subsetting:"[border_top_width]",css_rule:"border-top-width",with_units:!0}),_({...c,subsetting:"[border_bottom_color]",css_rule:"border-bottom-color"}),_({...c,subsetting:"[border_bottom_style]",css_rule:"border-bottom-style"}),_({...c,subsetting:"[border_bottom_width]",css_rule:"border-bottom-width",with_units:!0}),_({...c,subsetting:"[border_left_color]",css_rule:"border-left-color"}),_({...c,subsetting:"[border_left_style]",css_rule:"border-left-style"}),_({...c,subsetting:"[border_left_width]",css_rule:"border-left-width",with_units:!0}),_({...c,subsetting:"[border_right_color]",css_rule:"border-right-color"}),_({...c,subsetting:"[border_right_style]",css_rule:"border-right-style"}),_({...c,subsetting:"[border_right_width]",css_rule:"border-right-width",with_units:!0}),_({...c,subsetting:"[border_radius_top_left]",css_rule:"border-top-left-radius",with_units:!0}),_({...c,subsetting:"[border_radius_top_right]",css_rule:"border-top-right-radius",with_units:!0}),_({...c,subsetting:"[border_radius_bottom_left]",css_rule:"border-bottom-left-radius",with_units:!0}),_({...c,subsetting:"[border_radius_bottom_right]",css_rule:"border-bottom-right-radius",with_units:!0}),_({...c,subsetting:"[display]",css_rule:"display"})})}));const f=(t,e)=>{if(!t.amount&&!e.amount)return{open:"",close:""};let s=[];return t.amount&&s.push(`(min-width: ${t.amount}${t.unit})`),e.amount&&s.push(`(max-width: ${e.amount}${e.unit})`),{open:`@media ${s.join(" and ")} {`,close:"}"}}},8:function(t,e){t.exports=window.jQuery}});
Save Changes
Rename File
Rename