File "customizer-views-v2-live-preview.js"

Full Path: /home/romayxjt/public_html/wp-content/plugins/the-events-calendar/build/js/customizer-views-v2-live-preview.js
File size: 15.18 KB
MIME-type: text/plain
Charset: utf-8

(()=>{var o,t,e=e||{};jQuery,o=wp.customize,(t=e).selectors={globalFontFamily:"tribe_customizer[global_elements][font_family]",globalFontSizeBase:"tribe_customizer[global_elements][font_size_base]",globalEventTitleColor:"tribe_customizer[global_elements][event_title_color]",globalEventDateColor:"tribe_customizer[global_elements][event_date_time_color]",globalBackgroundColor:"tribe_customizer[global_elements][background_color]",globalBackgroundColorChoice:"tribe_customizer[global_elements][background_color_choice]",globalAccentColor:"tribe_customizer[global_elements][accent_color]",globalLinkColor:"tribe_customizer[global_elements][link_color]",eventsBarTextColor:"tribe_customizer[tec_events_bar][events_bar_text_color]",eventsBarButtonTextColor:"tribe_customizer[tec_events_bar][find_events_button_text_color]",eventsBarIconColorChoice:"tribe_customizer[tec_events_bar][events_bar_icon_color_choice]",eventsBarIconColor:"tribe_customizer[tec_events_bar][events_bar_icon_color]",eventsBarButtonColorChoice:"tribe_customizer[tec_events_bar][find_events_button_color_choice]",eventsBarButtonColor:"tribe_customizer[tec_events_bar][find_events_button_color]",eventsBarBackgroundColorChoice:"tribe_customizer[tec_events_bar][events_bar_background_color_choice]",eventsBarBackgroundColor:"tribe_customizer[tec_events_bar][events_bar_background_color]",eventsBarBorderColorChoice:"tribe_customizer[tec_events_bar][events_bar_border_color_choice]",eventsBarBorderColor:"tribe_customizer[tec_events_bar][events_bar_border_color]",eventsBarViewSelectorBackgroundColorChoice:"tribe_customizer[tec_events_bar][view_selector_background_color_choice]",eventsBarViewSelectorBackgroundColor:"tribe_customizer[tec_events_bar][view_selector_background_color]",monthDaysOfWeekColor:"tribe_customizer[month_view][days_of_week_color]",monthDateMarkerColor:"tribe_customizer[month_view][date_marker_color]",monthMultidayEventBarChoice:"tribe_customizer[month_view][multiday_event_bar_color_choice]",monthMultidayEventBarColor:"tribe_customizer[month_view][multiday_event_bar_color]",monthGridLinesColor:"tribe_customizer[month_view][grid_lines_color]",monthGridHoverColor:"tribe_customizer[month_view][grid_hover_color]",monthGridBackgroundColorChoice:"tribe_customizer[month_view][grid_background_color_choice]",monthGridBackgroundColor:"tribe_customizer[month_view][grid_background_color]",monthTooltipBackgroundColor:"tribe_customizer[month_view][tooltip_background_color]",singleEventTitleColorChoice:"tribe_customizer[single_event][post_title_color_choice]",singleEventTitleColor:"tribe_customizer[single_event][post_title_color]"},t.customProps={globalFontFamily:["--tec-font-family-sans-serif","--tec-font-family-base"],globalFontSizeBase:["--tec-font-size-0","--tec-font-size-1","--tec-font-size-2","--tec-font-size-3","--tec-font-size-4","--tec-font-size-5","--tec-font-size-6","--tec-font-size-7","--tec-font-size-8","--tec-font-size-9","--tec-font-size-10"],globalFontSizeKeys:[11,12,14,16,18,20,22,24,28,32,42],globalEventTitleColor:["--tec-color-text-events-title"],globalEventDateColor:["--tec-color-text-event-date","--tec-color-text-secondary-event-date"],globalBackgroundColor:"--tec-color-background-events",globalAccentColor:["--tec-color-accent-primary","--tec-color-accent-primary-hover","--tec-color-accent-primary-multiday","--tec-color-accent-primary-multiday-hover","--tec-color-accent-primary-active","--tec-color-accent-primary-background","--tec-color-background-secondary-datepicker","--tec-color-accent-primary-background-datepicker","--tec-color-button-primary","--tec-color-button-primary-hover","--tec-color-button-primary-active","--tec-color-button-primary-background","--tec-color-day-marker-current-month","--tec-color-day-marker-current-month-hover","--tec-color-day-marker-current-month-active"],globalLinkColor:["--tec-color-link-primary","--tec-color-link-accent","--tec-color-link-accent-hover"],eventsBarTextColor:["--tec-color-text-events-bar-input","--tec-color-text-events-bar-input-placeholder","--tec-color-text-view-selector-list-item","--tec-color-text-view-selector-list-item-hover"],eventsBarButtonTextColor:["--tec-color-text-events-bar-submit-button","--tec-color-text-events-bar-submit-button-active","--tec-color-text-events-bar-submit-button-hover"],eventsBarIconColor:["--tec-color-icon-events-bar","--tec-color-icon-events-bar-hover","--tec-color-icon-events-bar-active"],eventsBarButtonColor:["--tec-color-background-events-bar-submit-button","--tec-color-background-events-bar-submit-button-hover","--tec-color-background-events-bar-submit-button-active"],eventsBarBackgroundColor:["--tec-color-background-events-bar","--tec-color-background-events-bar-tabs"],eventsBarBackgroundColorOpacity:"--tec-opacity-events-bar-input-placeholder",eventsBarBorderColor:"--tec-color-border-events-bar",eventsBarViewSelectorBackgroundColor:"--tec-color-background-view-selector",monthDaysOfWeekColor:"--tec-color-text-day-of-week-month",monthDateMarkerColor:["--tec-color-day-marker-month","--tec-color-day-marker-past-month"],monthMultidayEventBarColor:["--tec-color-background-primary-multiday","--tec-color-background-primary-multiday-hover","--tec-color-background-primary-multiday-active","--tec-color-background-secondary-multiday","--tec-color-background-secondary-multiday-hover"],monthGridLinesColor:"--tec-color-border-secondary-month-grid",monthGridHoverColor:"--tec-color-border-active-month-grid-hover",monthGridBackgroundColor:"--tec-color-background-month-grid",monthTooltipBackgroundColor:"--tec-color-background-tooltip",singleEventTitleColor:["--tec-color-text-event-title"]},t.root=document.querySelectorAll(e.selector),o(t.selectors.globalFontFamily,(function(o){o.bind((function(o){const r="theme"===o?"inherit":e.default_font;t.customProps.globalFontFamily.forEach((function(o){document.documentElement.style.setProperty(o,r)}))}))})),o(t.selectors.globalFontSizeBase,(function(o){o.bind((function(o){const e=parseInt(o)/16;t.root.forEach((function(o){t.customProps.globalFontSizeBase.forEach((function(r,c){const n=e*parseInt(t.customProps.globalFontSizeKeys[c]);o.style.setProperty(r,n.toFixed(3)+"px")}))}))}))})),o(t.selectors.globalEventTitleColor,(function(e){e.bind((function(e){t.root.forEach((function(r){t.customProps.globalEventTitleColor.forEach((function(o){r.style.setProperty(o,e)})),"default"===o(t.selectors.singleEventTitleColorChoice).get()&&t.customProps.singleEventTitleColor.forEach((function(o){r.style.setProperty(o,e)}))}))}))})),o(t.selectors.globalEventDateColor,(function(o){o.bind((function(o){t.root.forEach((function(e){t.customProps.globalEventDateColor.forEach((function(t){e.style.setProperty(t,o)}))}))}))})),o(t.selectors.globalBackgroundColorChoice,(function(e){e.bind((function(e){const r="transparent"!==e?o(t.selectors.globalBackgroundColor).get():e;t.root.forEach((function(c){if(c.style.setProperty(t.customProps.globalBackgroundColor,r),"global_background"===o(t.selectors.eventsBarBackgroundColorChoice).get()){const n="transparent"===e?"var(--tec-color-background)":r;t.customProps.eventsBarBackgroundColor.forEach((function(o){c.style.setProperty(o,n)})),"default"===o(t.selectors.eventsBarViewSelectorBackgroundColorChoice).get()&&c.style.setProperty(t.customProps.eventsBarViewSelectorBackgroundColor,n)}}))}))})),o(t.selectors.globalBackgroundColor,(function(e){e.bind((function(e){t.root.forEach((function(r){r.style.setProperty(t.customProps.globalBackgroundColor,e),"global_background"===o(t.selectors.eventsBarBackgroundColorChoice).get()&&t.customProps.eventsBarBackgroundColor.forEach((function(o){r.style.setProperty(o,e)}))}))}))})),o(t.selectors.globalAccentColor,(function(e){e.bind((function(e){const r=e,c=t.customProps.globalAccentColor;t.root.forEach((function(e){c.forEach((function(o){e.style.setProperty(o,r)})),"default"===o(t.selectors.eventsBarButtonColorChoice).get()&&t.customProps.eventsBarButtonColor.forEach((function(o){e.style.setProperty(o,r)})),"accent"===o(t.selectors.eventsBarIconColorChoice).get()&&t.customProps.eventsBarIconColor.forEach((function(o){e.style.setProperty(o,r)}));const n=o(t.selectors.monthMultidayEventBarChoice).get(),l=t.hexToRGBString(r);"default"===n&&(e.style.setProperty("--tec-color-background-primary-multiday","rgba("+l+", 0.24)"),e.style.setProperty("--tec-color-background-primary-multiday-hover","rgba("+l+", 0.34)"),e.style.setProperty("--tec-color-background-primary-multiday-active","rgba("+l+", 0.34)"),e.style.setProperty("--tec-color-background-secondary-multiday","rgba("+l+", 0.24)"),e.style.setProperty("--tec-color-background-secondary-multiday-hover","rgba("+l+", 0.34)"))}))}))})),o(t.selectors.globalLinkColor,(function(o){o.bind((function(o){t.root.forEach((function(e){t.customProps.globalLinkColor.forEach((function(t){e.style.setProperty(t,o)}))}))}))})),o(t.selectors.eventsBarTextColor,(function(o){o.bind((function(o){t.root.forEach((function(e){t.customProps.eventsBarTextColor.forEach((function(t){e.style.setProperty(t,o)})),e.style.setProperty("--tec-opacity-events-bar-input-placeholder","0.6")}))}))})),o(t.selectors.eventsBarButtonTextColor,(function(o){o.bind((function(o){t.root.forEach((function(e){t.customProps.eventsBarButtonTextColor.forEach((function(t){e.style.setProperty(t,o)}))}))}))})),o(t.selectors.eventsBarIconColorChoice,(function(e){e.bind((function(e){let r="var(--tec-color-icon-primary)";"custom"===e?r=o(t.selectors.eventsBarIconColor).get():"accent"===e&&(r=o(t.selectors.globalAccentColor).get()),t.root.forEach((function(o){t.customProps.eventsBarIconColor.forEach((function(t){o.style.setProperty(t,r)}))}))}))})),o(t.selectors.eventsBarIconColor,(function(o){o.bind((function(o){t.root.forEach((function(e){t.customProps.eventsBarIconColor.forEach((function(t){e.style.setProperty(t,o)}))}))}))})),o(t.selectors.eventsBarButtonColorChoice,(function(e){e.bind((function(e){const r="custom"===e?o(t.selectors.eventsBarButtonColor).get():o(t.selectors.globalAccentColor).get();t.root.forEach((function(o){t.customProps.eventsBarButtonColor.forEach((function(t){o.style.setProperty(t,r)}))}))}))})),o(t.selectors.eventsBarButtonColor,(function(o){o.bind((function(o){t.root.forEach((function(e){t.customProps.eventsBarButtonColor.forEach((function(t){e.style.setProperty(t,o)}))}))}))})),o(t.selectors.eventsBarBackgroundColorChoice,(function(e){e.bind((function(e){let r="#fff";"custom"===e?r=o(t.selectors.eventsBarBackgroundColor).get():"global_background"===e&&"transparent"!==o(t.selectors.globalBackgroundColorChoice).get()&&(r=o(t.selectors.globalBackgroundColor).get()),t.root.forEach((function(o){t.customProps.eventsBarBackgroundColor.forEach((function(t){o.style.setProperty(t,r)}))}))}))})),o(t.selectors.eventsBarBackgroundColor,(function(o){o.bind((function(o){t.root.forEach((function(e){t.customProps.eventsBarBackgroundColor.forEach((function(t){e.style.setProperty(t,o)}))}))}))})),o(t.selectors.eventsBarViewSelectorBackgroundColorChoice,(function(e){e.bind((function(e){let r=o(t.selectors.eventsBarBackgroundColor).get();"custom"===e&&(r=o(t.selectors.eventsBarViewSelectorBackgroundColor).get()),t.root.forEach((function(o){o.style.setProperty(t.customProps.eventsBarViewSelectorBackgroundColor,r)}))}))})),o(t.selectors.eventsBarViewSelectorBackgroundColor,(function(o){o.bind((function(o){t.root.forEach((function(e){e.style.setProperty(t.customProps.eventsBarViewSelectorBackgroundColor,o)}))}))})),o(t.selectors.eventsBarBorderColorChoice,(function(e){e.bind((function(e){const r="custom"===e?o(t.selectors.eventsBarBorderColor).get():"var(--tec-color-border-secondary)";t.root.forEach((function(o){o.style.setProperty(t.customProps.eventsBarBorderColor,r)}))}))})),o(t.selectors.eventsBarBorderColor,(function(o){o.bind((function(o){t.root.forEach((function(e){e.style.setProperty(t.customProps.eventsBarBorderColor,o)}))}))})),o(t.selectors.monthDaysOfWeekColor,(function(o){o.bind((function(o){t.root.forEach((function(e){e.style.setProperty(t.customProps.monthDaysOfWeekColor,o)}))}))})),o(t.selectors.monthDateMarkerColor,(function(o){o.bind((function(o){const e=t.customProps.monthDateMarkerColor;t.root.forEach((function(t){e.forEach((function(e){t.style.setProperty(e,o)}))}))}))})),o(t.selectors.monthMultidayEventBarChoice,(function(e){e.bind((function(e){const r="custom"!==e?o(t.selectors.globalAccentColor).get():o(t.selectors.monthMultidayEventBarColor).get(),c=t.hexToRGBString(r);t.root.forEach((function(o){o.style.setProperty("--tec-color-background-primary-multiday","rgba("+c+", 0.24)"),o.style.setProperty("--tec-color-background-primary-multiday-hover","rgba("+c+", 0.34)"),o.style.setProperty("--tec-color-background-primary-multiday-active","rgba("+c+", 0.34)"),o.style.setProperty("--tec-color-background-secondary-multiday","rgba("+c+", 0.24)"),o.style.setProperty("--tec-color-background-secondary-multiday-hover","rgba("+c+", 0.34 )")}))}))})),o(t.selectors.monthMultidayEventBarColor,(function(o){o.bind((function(o){const e=t.hexToRGBString(o);t.root.forEach((function(o){o.style.setProperty("--tec-color-background-primary-multiday","rgba("+e+", 0.24)"),o.style.setProperty("--tec-color-background-primary-multiday-hover","rgba("+e+", 0.34)"),o.style.setProperty("--tec-color-background-primary-multiday-active","rgba("+e+", 0.34)"),o.style.setProperty("--tec-color-background-secondary-multiday","rgba("+e+", 0.24)"),o.style.setProperty("--tec-color-background-secondary-multiday-hover","rgba("+e+", 0.34 )")}))}))})),o(t.selectors.monthGridLinesColor,(function(o){o.bind((function(o){t.root.forEach((function(e){e.style.setProperty(t.customProps.monthGridLinesColor,o)}))}))})),o(t.selectors.monthGridHoverColor,(function(o){o.bind((function(o){t.root.forEach((function(e){e.style.setProperty(t.customProps.monthGridHoverColor,o)}))}))})),o(t.selectors.monthGridBackgroundColorChoice,(function(e){e.bind((function(e){const r="custom"===e?o(t.selectors.monthGridBackgroundColor).get():"transparent",c="custom"===e?"#fff":o(t.selectors.globalBackgroundColor).get();t.root.forEach((function(o){o.style.setProperty(t.customProps.monthGridBackgroundColor,r)})),document.documentElement.style.setProperty(t.customProps.monthTooltipBackgroundColor,c)}))})),o(t.selectors.monthGridBackgroundColor,(function(o){o.bind((function(o){t.root.forEach((function(e){e.style.setProperty(t.customProps.monthGridBackgroundColor,o)}))}))})),o(t.selectors.monthTooltipBackgroundColor,(function(e){e.bind((function(e){let r="#fff";const c=o(t.selectors.monthGridBackgroundColorChoice).get(),n=o(t.selectors.globalBackgroundColorChoice).get();"event"===e&&"transparent"===c&&"transparent"!==n&&(r=o(t.selectors.globalBackgroundColor).get()),document.documentElement.style.setProperty(t.customProps.monthTooltipBackgroundColor,r)}))})),o(t.selectors.singleEventTitleColorChoice,(function(e){e.bind((function(e){const r="custom"===e?o(t.selectors.singleEventTitleColor).get():o(t.selectors.globalEventTitleColor).get();t.root.forEach((function(o){o.style.setProperty(t.customProps.singleEventTitleColor,r)}))}))})),o(t.selectors.singleEventTitleColor,(function(o){o.bind((function(o){t.root.forEach((function(e){e.style.setProperty(t.customProps.singleEventTitleColor,o)}))}))})),t.hexToRGB=function(o){return{r:(o=parseInt(o.indexOf("#")>-1?o.substring(1):o,16))>>16,g:(65280&o)>>8,b:255&o}},t.hexToRGBString=function(o){const e=t.hexToRGB(o);return e.r+", "+e.g+", "+e.b},window.tec=window.tec||{},window.tec.events=window.tec.events||{},window.tec.events.customizerViewsV2LivePreview={}})();