This commit is contained in:
2024-12-31 11:07:09 +01:00
parent df7915205d
commit e089172b15
1916 changed files with 165422 additions and 271 deletions

View File

@ -0,0 +1,2 @@
var TF_Accordion=function(){function t(){this.initEvents()}var e=t.prototype;return e.initEvents=function(){document.addEventListener("click",function(t){this.onItemToggle(t)}.bind(this))},e.onItemToggle=function(t){t=t.target.closest(".tf-accordion-widget--item--title");t&&this.toggleItem(t.closest(".tf-accordion-widget--item"))},e.toggleItem=function(t){var e=this,n=t.closest(".tf-accordion-widget"),i="true"===t.dataset.expanded||!1;n.classList.contains("only-one-panel-expanded")&&(n=n.querySelectorAll('.tf-accordion-widget--item[data-expanded="true"]'))&&n.forEach(function(t){e.collapseItem(t)}),i?this.collapseItem(t):this.expandItem(t)},e.collapseItem=function(t){var e=t.querySelector(".tf-accordion-widget--item--content"),n=e.scrollHeight,i=e.style.transition;e.style.transition="",requestAnimationFrame(function(){e.style.height=n+"px",e.style.transition=i,requestAnimationFrame(function(){e.style.height="0px"})}),t.setAttribute("data-expanded","false")},e.expandItem=function(t){var e=t.querySelector(".tf-accordion-widget--item--content"),n=e.scrollHeight;e.style.height=n+"px",e.addEventListener("transitionend",function(t){e.removeEventListener("transitionend",arguments.callee),e.style.height=null}),t.setAttribute("data-expanded","true")},t}();document.addEventListener("DOMContentLoaded",function(){new TF_Accordion});

View File

@ -0,0 +1,2 @@
var TF_Bing_Map=function(){function t(t){if(t){if(this.ref=t,this.wrapper=null,this.map_element=null,this.map=null,this.options={},this.defaults={lat:0,long:0,zoom:5,view:"Road",scale:!1,enable_info_window:!1,markers:[],markerImage:""},this.ref instanceof HTMLElement)this.initWithDataAttributes();else{if(!(this.ref instanceof Object))return;this.initWithOptions(this.ref)}this.pinInfobox=null,this.pushpinLocations=[],this.defaultZoom=parseInt(this.options.zoom)||15}}var i=t.prototype;return i.initWithDataAttributes=function(){this.wrapper=this.ref,this.map_element=this.wrapper.querySelector(".map-item"),this.initWithOptions(JSON.parse(this.wrapper.dataset.options))},i.initWithOptions=function(t){void 0===t&&(t={}),this.options=Object.assign({},this.defaults,t);t=this.options.value.split(",");this.options.lat=parseFloat(t[0])||this.options.lat,this.options.long=parseFloat(t[1])||this.options.long,this.wrapper||(this.wrapper=document.querySelector(".nrf-widget.bingmap#"+this.options.id)),this.map_element||(this.map_element=this.wrapper.querySelector(".map-item"))},i.render=function(){this.map=new Microsoft.Maps.Map(this.map_element,{center:new Microsoft.Maps.Location(this.options.lat,this.options.long),zoom:this.defaultZoom,showScalebar:this.options.scale,showMapTypeSelector:this.options.pro,showLocateMeButton:this.options.pro,mapTypeId:this.getMapTypeID()}),this.wrapper.BingMap=this;var t=new CustomEvent("onTFMapWidgetRender",{detail:{map:this.wrapper,service:"bingmap"}});document.dispatchEvent(t)},i.getMapTypeID=function(){var t=Microsoft.Maps.MapTypeId.road;switch(this.options.view){case"road":t=Microsoft.Maps.MapTypeId.road;break;case"aerial":t=Microsoft.Maps.MapTypeId.aerial;break;case"birdseye":t=Microsoft.Maps.MapTypeId.birdseye;break;case"grayscale":t=Microsoft.Maps.MapTypeId.grayscale;break;case"ordnanceSurvey":t=Microsoft.Maps.MapTypeId.ordnanceSurvey;break;case"canvasDark":t=Microsoft.Maps.MapTypeId.canvasDark;break;case"canvasLight":t=Microsoft.Maps.MapTypeId.canvasLight}return t},i.renderMarkers=function(){var o,s,t,n=this;0!==this.options.markers.length&&(t=new Microsoft.Maps.EntityCollection,o=new Microsoft.Maps.EntityCollection,this.pinInfobox=new Microsoft.Maps.Infobox(new Microsoft.Maps.Location(0,0),{visible:!1}),t.push(this.pinInfobox),s=[],this.options.markers.map(function(t,i){var e={lat:t.latitude,lng:t.longitude},e=(s[i]=new Microsoft.Maps.Location(e.lat,e.lng),new Microsoft.Maps.Pushpin(s[i],{icon:n.options.markerImage}));n.options.enable_info_window&&(t.label&&""!==t.label||t.description&&""!==t.description||t.address&&""!==t.address)&&(e.Title=t.label&&""!==t.label?t.label:t.address&&""!==t.address?t.address:"",""!==(t=t.description&&""!==t.description?t.description:"")&&(e.Description=t),Microsoft.Maps.Events.addHandler(e,"click",n.displayInfobox.bind(n))),n.pushpinLocations.push(s[i]),o.push(e)}),this.map.entities.push(o),this.map.entities.push(t),t=Microsoft.Maps.LocationRect.fromLocations(s),this.map.setView({center:t.center,zoom:this.defaultZoom}))},i.displayInfobox=function(t){""===t.target.Title&&""===t.target.Description||(this.pinInfobox.setOptions({title:t.target.Title,description:t.target.Description,visible:!0,offset:new Microsoft.Maps.Point(0,25)}),this.pinInfobox.setLocation(t.target.getLocation()))},i.centerMap=function(){var t,i,e;0!==this.options.markers.length&&("fitbounds"===this.options.zoom_level?(t=Microsoft.Maps.LocationRect.fromLocations(this.pushpinLocations),this.map.setView({bounds:t,padding:20})):(t=this.options.markers[0].latitude,i=this.options.markers[0].longitude,null!==this.options.map_center&&2===(e=this.options.map_center.split(",")).length&&(t=e[0],i=e[1]),e=new Microsoft.Maps.Location(t,i),this.map.setView({center:e,zoom:this.defaultZoom})))},i.getMap=function(){return this.map},t}(),TF_Bing_Maps=function(){function t(){this.init()}return t.prototype.init=function(){var t,o,i;window.IntersectionObserver&&0!==(t=document.querySelectorAll(".nrf-widget.bingmap:not(.no-map):not(.done)")).length&&(o=1,i=new IntersectionObserver(function(t,e){t.forEach(function(t){var i;t.isIntersecting&&(t.target.id=t.target.id+"-"+o,t.target.classList.add("done"),(i=t.target.hasAttribute("data-options")?JSON.parse(t.target.dataset.options):t.target).id=t.target.id,(i=new TF_Bing_Map(i)).render(),i.renderMarkers(),i.centerMap(),e.unobserve(t.target),o++)})},{rootMargin:"0px 0px 0px 0px"}),t.forEach(function(t){i.observe(t)}))},t}();window.TFBingMapsCallback=function(){new TF_Bing_Maps};

View File

@ -0,0 +1,2 @@
document.addEventListener("input",function(t){var e,r=t.target.closest(".nrf-colorpicker-wrapper");r&&((e=t.target.closest('input[type="color"]'))&&(r.querySelector('input[type="text"]').value=e.value),e=t.target.closest('input[type="text"]'))&&((t=e.value).startsWith("#")||(t="#"+t),r.querySelector('input[type="color"]').value=t)});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
var TF_FAQ=function(){function t(){this.initEvents()}var e=t.prototype;return e.initEvents=function(){document.addEventListener("click",function(t){this.onQuestionToggle(t)}.bind(this))},e.onQuestionToggle=function(t){t=t.target.closest(".tf-faq-widget--item--question");t&&this.toggleItem(t.closest(".tf-faq-widget--item"))},e.toggleItem=function(t){var e=this,n=t.closest(".tf-faq-widget"),i="true"===t.dataset.open||!1;n.classList.contains("keep-one-question-open")&&(n=n.querySelectorAll('.tf-faq-widget--item[data-open="true"]'))&&n.forEach(function(t){e.collapseItem(t)}),i?this.collapseItem(t):this.expandItem(t)},e.collapseItem=function(t){var e=t.querySelector(".tf-faq-widget--item--answer"),n=e.scrollHeight,i=e.style.transition;e.style.transition="",requestAnimationFrame(function(){e.style.height=n+"px",e.style.transition=i,requestAnimationFrame(function(){e.style.height="0px"})}),t.setAttribute("data-open","false")},e.expandItem=function(t){console.log("expand");var e=t.querySelector(".tf-faq-widget--item--answer"),n=e.scrollHeight;e.style.height=n+"px",e.addEventListener("transitionend",function(t){e.removeEventListener("transitionend",arguments.callee),e.style.height=null}),t.setAttribute("data-open","true")},t}();document.addEventListener("DOMContentLoaded",function(){new TF_FAQ});

View File

@ -0,0 +1,2 @@
function _createForOfIteratorHelperLoose(t,e){var r,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(a)return(a=a.call(t)).next.bind(a);if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length)return a&&(t=a),r=0,function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){var r;if(t)return"string"==typeof t?_arrayLikeToArray(t,e):"Map"===(r="Object"===(r=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}var TF_Gallery=function(){function t(t){this.cls=t=void 0===t?".tf-gallery-wrapper":t,this.initEvents(),this.initLightbox()}var e=t.prototype;return e.initEvents=function(){document.addEventListener("click",function(t){this.onTagClick(t)}.bind(this)),document.addEventListener("change",function(t){this.onTagDropdownSelect(t)}.bind(this))},e.initLightbox=function(){var t=document.querySelectorAll(this.cls+".lightbox");if(t.length)for(var e=_createForOfIteratorHelperLoose(t);!(r=e()).done;){var r=r.value,a=(r.lightbox&&r.lightbox.destroy(),{selector:".tf-gallery-lightbox-item."+r.dataset.id+":not(.tf-gallery-is-hidden)",touchNavigation:!0});r.lightbox=GLightbox(a)}},e.onTagClick=function(t){var e,r,a,i=t.target.closest(".tf-gallery-tags--item");i&&(t.preventDefault(),t=i.closest(this.cls))&&(e=i.classList.contains("active"),"*"===(r=i.dataset.tag)&&t.querySelector('.tf-gallery-tags--item.active[data-tag="*"]')||((a=t.querySelector(".tf-gallery-tags--item.active"))&&a.classList.remove("active"),e?r="*":i.classList.add("active"),this.updateDropdownTagFilterValue(t,r),this.filterGalleryTags(t,r),this.initLightbox()))},e.updateDropdownTagFilterValue=function(t,e){t=t.querySelector(".tf-gallery-tags-dropdown");t&&(t.value=e)},e.onTagDropdownSelect=function(t){var e=t.target.closest(".tf-gallery-tags-dropdown");e&&(e=e.closest(this.cls))&&(t=t.target.value,this.updateDefaultTagFilterValue(e,t),this.filterGalleryTags(e,t))},e.updateDefaultTagFilterValue=function(t,e){e=t.querySelector('.tf-gallery-tags--item[data-tag="'+e+'"]');e&&((t=t.querySelector(".tf-gallery-tags--item.active"))&&t.classList.remove("active"),e.classList.add("active"))},e.filterGalleryTags=function(t,e){t.querySelector(".gallery-items").querySelectorAll(":scope > .item").forEach(function(t){"*"===e||t.dataset.tags&&(JSON.parse(t.dataset.tags)||[]).includes(e)?(t.classList.remove("tf-gallery-is-hidden"),t.querySelector("a")&&t.querySelector("a").classList.remove("tf-gallery-is-hidden")):(t.classList.add("tf-gallery-is-hidden"),t.querySelector("a")&&t.querySelector("a").classList.add("tf-gallery-is-hidden"))})},t}();document.addEventListener("DOMContentLoaded",function(t){new TF_Gallery});

View File

@ -0,0 +1,2 @@
var TF_Justified_Gallery=function(){function t(){this.init(),this.initEvents()}var e=t.prototype;return e.init=function(){var e=this;this.getGalleries().forEach(function(t){e.initGallery(t)})},e.initGallery=function(t){var e={itemSelector:".item:not(.tf-gallery-is-hidden)",transitionDuration:0,gutter:parseInt(window.getComputedStyle(t).gap)};t.parentElement.dataset.itemHeight&&(e.rowHeight=t.parentElement.dataset.itemHeight),fjGallery(t,e)},e.initEvents=function(){var e=this;document.addEventListener("click",function(t){e.onJustifiedFilteringTagsSelection(t)}),window.addEventListener("resize",function(t){e.updateGalleriesGap()},!0)},e.onJustifiedFilteringTagsSelection=function(t){var t=t.target.closest(".tf-gallery-tags--item");t&&(t=t.closest(".nrf-widget.tf-gallery-wrapper"))&&(t=t.querySelector(".gallery-items.justified"))&&(t.fjGallery.destroy(),this.initGallery(t))},e.updateGalleriesGap=function(){this.getGalleries().forEach(function(t){t.fjGallery&&t.fjGallery.updateOptions({gutter:parseInt(window.getComputedStyle(t).gap)})})},e.getGalleries=function(){return document.querySelectorAll(".gallery-items.justified")},t}();document.addEventListener("DOMContentLoaded",function(){new TF_Justified_Gallery});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
var TF_Gallery_Manager_Init=function(){function n(){this.isDropzoneAvailable()&&this.initWidgets()}var e=n.prototype;return e.isDropzoneAvailable=function(){return"undefined"!=typeof Dropzone},e.initWidgets=function(){document.querySelectorAll(".tf-gallery-manager").forEach(function(n){new TF_Gallery_Manager(n).init()})},n}();document.addEventListener("DOMContentLoaded",function(n){new TF_Gallery_Manager_Init});

View File

@ -0,0 +1,2 @@
var TF_Google_Map=function(){function t(t){if(t){if(this.ref=t,this.wrapper=null,this.map_element=null,this.map=null,this.options={},this.defaults={lat:0,long:0,zoom:5,view:"roadmap",scale:!1,enable_info_window:!1,markers:[],markerImage:""},this.ref instanceof HTMLElement)this.initWithDataAttributes();else{if(!(this.ref instanceof Object))return;this.initWithOptions(this.ref)}this.markersBounds=new google.maps.LatLngBounds,this.defaultZoom=parseInt(this.options.zoom)||15}}var e=t.prototype;return e.initWithDataAttributes=function(){this.wrapper=this.ref,this.map_element=this.wrapper.querySelector(".map-item"),this.initWithOptions(JSON.parse(this.wrapper.dataset.options))},e.initWithOptions=function(t){void 0===t&&(t={}),this.options=Object.assign({},this.defaults,t);t=this.options.value.split(",");this.options.lat=parseFloat(t[0])||this.options.lat,this.options.long=parseFloat(t[1])||this.options.long,this.wrapper||(this.wrapper=document.querySelector(".nrf-widget.googlemap#"+this.options.id)),this.map_element||(this.map_element=this.wrapper.querySelector(".map-item"))},e.render=function(){this.map=new google.maps.Map(this.map_element,{zoom:this.defaultZoom,center:{lat:this.options.lat,lng:this.options.long},mapTypeId:this.options.view,mapTypeControl:this.options.pro,streetViewControl:this.options.pro,scaleControl:!!this.options.scale}),this.wrapper.GoogleMap=this;var t=new CustomEvent("onTFMapWidgetRender",{detail:{map:this.wrapper,service:"googlemap"}});document.dispatchEvent(t)},e.renderMarkers=function(){var n,s,a=this;0!==this.options.markers.length&&(n=this,s=new google.maps.InfoWindow,this.options.markers.map(function(o,t){var i,e={position:new google.maps.LatLng(o.latitude,o.longitude),map:a.map},e=(""!==a.options.markerImage&&(e.icon=a.options.markerImage),new google.maps.Marker(e));a.markersBounds.extend(e.position),a.options.enable_info_window&&(o.label&&""!==o.label||o.description&&""!==o.description||o.address&&""!==o.address)&&google.maps.event.addListener(e,"click",(i=e,function(){var t=(t=o.label&&""!==o.label?o.label:o.address&&""!==o.address?o.address:"")&&'<strong class="tf-map-marker-container--title">'+t+"</strong>",e=o.description&&""!==o.description?'<div class="tf-map-marker-container--content">'+o.description+"</div>":"";s.setContent('<div class="tf-map-marker-container">'+t+e+"</div>"),s.open(n.map,i)}))}))},e.centerMap=function(){var t,e,o;0!==this.options.markers.length&&("fitbounds"===this.options.zoom_level?this.map.fitBounds(this.markersBounds):(t=this.options.markers[0].latitude,e=this.options.markers[0].longitude,null!==this.options.map_center&&2===(o=this.options.map_center.split(",")).length&&(t=o[0],e=o[1]),o=new google.maps.LatLng(t,e),this.map.panTo(o),this.map.setZoom(this.defaultZoom)))},e.getMap=function(){return this.map},t}(),TF_Google_Maps=function(){function t(){this.init()}return t.prototype.init=function(){var t,i,e;window.IntersectionObserver&&0!==(t=document.querySelectorAll(".nrf-widget.googlemap:not(.no-map):not(.done)")).length&&(i=1,e=new IntersectionObserver(function(t,o){t.forEach(function(t){var e;t.isIntersecting&&(t.target.id=t.target.id+"-"+i,t.target.classList.add("done"),(e=t.target.hasAttribute("data-options")?JSON.parse(t.target.dataset.options):t.target).id=t.target.id,(e=new TF_Google_Map(e)).render(),e.renderMarkers(),e.centerMap(),o.unobserve(t.target),i++)})},{rootMargin:"0px 0px 0px 0px"}),t.forEach(function(t){e.observe(t)}))},t}();document.addEventListener("DOMContentLoaded",function(){new TF_Google_Maps});

View File

@ -0,0 +1,2 @@
var NRF_Mapaddress_Widget=function(){function e(){this.init()}var t=e.prototype;return t.init=function(){var t=this;this.getInstances().forEach(function(e){t.determineFieldValidityAndToggleValidatorField(e)}),document.addEventListener("onTFMapEditorMarkerMoveEnd",function(e){this.onCoordinatesChange(e)}.bind(this)),document.addEventListener("onTFAddressLookupSelectedItem",function(e){this.onSelectAutocompleteItem(e)}.bind(this)),document.addEventListener("onTFMapEditorClearMap",function(e){this.onClearMap(e)}.bind(this)),document.addEventListener("keyup",this.debounce(function(e){t.onTypeData(e)},500)),document.querySelectorAll("joomla-field-subform").forEach(function(e){e.addEventListener("subform-row-add",function(e){t.render(e)})})},t.getInstances=function(){return document.querySelectorAll(".nrf-widget.tf-mapaddress-editor")},t.getAddressDetails=function(t,d,r,i){fetch("https://nominatim.openstreetmap.org/reverse?lat="+t+"&lon="+d+"&format=json").then(function(e){return e.json()}).then(function(e){i(e,t,d,r)})},t.debounce=function(d,r){var i;return function(){var e=this,t=arguments;clearTimeout(i),i=setTimeout(function(){return d.apply(e,t)},r)}},t.onTypeData=function(e){e=e.target.closest(".nrf-widget.tf-mapaddress-editor");e&&this.determineFieldValidityAndToggleValidatorField(e)},t.onClearMap=function(e){e=e.detail.map.closest(".nrf-widget.tf-mapaddress-editor");e&&(e.querySelector(".map-markers").value="",this.clearAddressDetails(e),this.determineFieldValidityAndToggleValidatorField(e))},t.onSelectAutocompleteItem=function(e){var t=e.detail.item.closest(".nrf-widget.tf-mapaddress-editor");t&&(t.querySelector(".nrf-widget.openstreetmap.no-map")&&this.getAddressDetails(e.detail.lat,e.detail.lng,t,this.afterCoordinatesChange.bind(this)),this.determineFieldValidityAndToggleValidatorField(t))},t.render=function(e){e=e.target.querySelectorAll(".nrf-widget.tf-mapaddress-editor .nrf-widget.openstreetmap:not(.no-map):not(.done)");e&&e.forEach(function(e){var t=new NR_OSM_Map(e);t.render(),t.renderMarkers(),t.centerMap(),e.classList.add("done")})},t.onCoordinatesChange=function(e){var t=e.detail.map.closest(".nrf-widget.tf-mapaddress-editor");t&&(e.detail.map.classList.remove("clear-is-hidden"),this.afterCoordinatesChange(e.detail.address,t),this.determineFieldValidityAndToggleValidatorField(t))},t.afterCoordinatesChange=function(e,t){this.clearAddressDetails(t),this.updateAddressDetails(t,e)},t.getAddressDetails=function(e,t,d,r){fetch("https://nominatim.openstreetmap.org/reverse?lat="+e+"&lon="+t+"&format=json").then(function(e){return e.json()}).then(function(e){r(e,d)})},t.clearAddressDetails=function(t){t.querySelector(".tf-address-lookup-field-coordinates-value").value="",t.querySelector(".tf-address-lookup-field-address").value="",this.getFields().forEach(function(e){t.querySelector(".tf-mapaddress-field-"+e).value=""})},t.updateAddressDetails=function(e,t){t.error||t.address&&(e.querySelector(".tf-mapaddress-field-latitude").value=t.lat,e.querySelector(".tf-mapaddress-field-longitude").value=t.lon,e.querySelector(".tf-address-lookup-field-address").value=t.display_name,t.address.country&&(e.querySelector(".tf-mapaddress-field-country").value=t.address.country),t.address.country_code&&(e.querySelector(".tf-mapaddress-field-country_code").value=t.address.country_code),t.address.city&&(e.querySelector(".tf-mapaddress-field-city").value=t.address.city),t.address.postcode&&(e.querySelector(".tf-mapaddress-field-postal_code").value=t.address.postcode),t.address.county&&(e.querySelector(".tf-mapaddress-field-county").value=t.address.county),t.address.state&&(e.querySelector(".tf-mapaddress-field-state").value=t.address.state),t.address.municipality&&(e.querySelector(".tf-mapaddress-field-municipality").value=t.address.municipality),t.address.town&&(e.querySelector(".tf-mapaddress-field-town").value=t.address.town),t.address.road)&&(e.querySelector(".tf-mapaddress-field-road").value=t.address.road)},t.determineFieldValidityAndToggleValidatorField=function(e){var t;this.isRequired(e)&&(t=this.isValid(e)?"hide":"show",e=e.querySelector(':scope > input[type="hidden"].required'),"hide"==t?(e.removeAttribute("required"),e.classList.remove("required")):(e.setAttribute("required","required"),e.classList.add("required")))},t.isValid=function(t){var d=!0,e=t.querySelector(".tf-address-lookup-field-address");return e&&""===e.value.trim()&&(d=!1),this.getFields().forEach(function(e){e=t.querySelector(".control-group."+e+".is-visible .tf-mapaddress-field-"+e);e&&""===e.value.trim()&&(d=!1)}),d},t.isRequired=function(e){return!!e.querySelector(':scope > input[type="hidden"].required')},t.getFields=function(){return["latitude","longitude","country","country_code","city","county","postal_code","state","municipality","town","road"]},e}();document.addEventListener("DOMContentLoaded",function(){new NRF_Mapaddress_Widget});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
var NRF_Rating=function(){function t(){this.wrapperClass="nrf-rating-wrapper",this.emptyState="iconEmpty",this.filledState="iconFilled",this.activeState="iconActive",this.ratingElementWrapper,this.maybeMakeIDsUnique(),this.init()}var e=t.prototype;return e.generateUniqueId=function(t){return Date.now().toString(36)+Math.random().toString(36).substring(2,10)+t},e.maybeMakeIDsUnique=function(){var a,i=this;document.querySelectorAll("."+this.wrapperClass).forEach(function(t,e){a=i.generateUniqueId(e),t.querySelectorAll("input").forEach(function(t){t.id=a+"_"+t.id}),t.querySelectorAll("label").forEach(function(t){t.htmlFor=a+"_"+t.htmlFor})})},e.init=function(){document.addEventListener("click",function(t){!t.target.closest("."+this.wrapperClass)||this.isReadOnlyOrDisabled(t)||this.updateValue(t)}.bind(this)),document.addEventListener("mouseover",function(t){this.ratingElementWrapper=t.target.closest("."+this.wrapperClass),this.ratingElementWrapper&&(t.preventDefault(),this.isReadOnlyOrDisabled(t)||(this.isHalfRating()?this.addHalfRatingState(t):this.addState(t)))}.bind(this)),document.addEventListener("mouseout",function(t){this.ratingElementWrapper=t.target.closest("."+this.wrapperClass),this.ratingElementWrapper&&!this.isReadOnlyOrDisabled(t)&&(this.isHalfRating()?this.resetHalfRatingState(t):this.resetState(t))}.bind(this))},e.updateValue=function(t){this.removeActiveState(t);var e,a=t.target.closest("label").previousElementSibling;a&&(e=this.ratingElementWrapper.querySelector("input:checked"))&&!a.disabled&&e.value==a.value&&(t.preventDefault(),this.resetAllRatingValues(t))},e.resetAllRatingValues=function(t){var e=this,a=t.target.closest("."+this.wrapperClass).querySelectorAll("."+this.filledState);a&&(a.forEach(function(t){t.classList.remove(e.filledState,e.emptyState,e.activeState),t.previousElementSibling.checked=!1}),t.target.closest("label").previousElementSibling.dispatchEvent(new Event("change",{bubbles:!0})))},e.removeActiveState=function(t){t.target.closest("."+this.activeState)&&t.target.closest("."+this.activeState).classList.remove(this.activeState)},e.addState=function(t){var e,a=this,i=t.target.closest("label");i&&(e=i.previousElementSibling.value,t.target.closest("."+this.wrapperClass).querySelectorAll("label").forEach(function(t){a.addRatingItemState(t,e)}),i.classList.add(this.activeState))},e.addRatingItemState=function(t,e){var a=t.previousElementSibling.value;parseFloat(a)>parseFloat(e)?t.classList.add(this.emptyState):t.classList.add(this.filledState)},e.resetState=function(t){var e,a=this;this.ratingElementWrapper=t.target.closest("."+this.wrapperClass),this.ratingElementWrapper&&(e=this.ratingElementWrapper.querySelector("input:checked")||0,this.ratingElementWrapper.querySelectorAll("label").forEach(function(t){a.resetRatingItemState(t,e)}))},e.resetRatingItemState=function(t,e){var a;t.classList.remove(this.emptyState,this.filledState,this.activeState),e&&(a=t.previousElementSibling.value,parseFloat(a)>parseFloat(e.value)||t.classList.add(this.filledState))},e.addHalfRatingState=function(t){var e,a,i=this,s=t.target.closest(".rating_item_group");s&&(e=t.target.closest("label"),s.classList.add(this.activeState),a=e.previousElementSibling.value,t.target.closest("."+this.wrapperClass).querySelectorAll(".rating_item_group").forEach(function(t){t.querySelectorAll("label").forEach(function(t){i.addRatingItemState(t,a)})}))},e.resetHalfRatingState=function(t){var e,a=this;this.ratingElementWrapper=t.target.closest("."+this.wrapperClass),this.ratingElementWrapper&&(e=this.ratingElementWrapper.querySelector("input:checked")||0,this.ratingElementWrapper.querySelectorAll(".rating_item_group").forEach(function(t){t.classList.contains(a.activeState)&&t.classList.remove(a.activeState),t.querySelectorAll("label").forEach(function(t){a.resetRatingItemState(t,e)})}))},e.updateHalfRatingValue=function(t){this.removeActiveState(t);var e=t.target.closest("."+this.wrapperClass).querySelector("input:checked"),e=!!e&&e.value;t.target.closest("label").previousElementSibling.value==e&&(t.preventDefault(),this.resetAllRatingValues(t))},e.removeHalfRatingActiveState=function(t){t.target.closest(".rating_item_group")||t.target.closest(".rating_item_group").classList.remove(this.activeState)},e.isHalfRating=function(){return this.ratingElementWrapper.classList.contains("half")},e.getNextSiblings=function(t){for(var e=[];t=t.nextSibling;)3!==t.nodeType&&e.push(t);return e},e.isReadOnlyOrDisabled=function(t){t=t.target.closest("label");return!t||t.previousElementSibling.disabled},t}();document.addEventListener("DOMContentLoaded",function(t){new NRF_Rating});

View File

@ -0,0 +1,2 @@
var NRF_Signature_Item=function(){function t(t){this.wrapper=t,this.canvas=this.wrapper.querySelector("canvas"),this.signaturePad=new SignaturePad(this.canvas,{backgroundColor:"transparent",penColor:this.canvas.dataset.penColor}),this.input=this.wrapper.querySelector('input[type="hidden"]'),this.clearButton=this.wrapper.querySelector(".nrf-signature-clear"),this.resetButton=this.wrapper.querySelector(".nrf-signature-reset"),this.wrapper.signature=this}var e=t.prototype;return e.init=function(){this.onCanvasUpdateRatio(),this.setValue(),this.initEvents()},e.initEvents=function(){var n=this,i=this.canvas,a=this.wrapper,e=(this.signaturePad.addEventListener("afterUpdateStroke",function(){a.classList.add("painted")}),this.signaturePad.addEventListener("endStroke",function(t){var e=n.removeBlanks(i),e=n.updateCanvasColor(e,"#000");i.nextElementSibling.value=e.toDataURL(),a.classList.add("painted")}),this.resetButton.addEventListener("click",function(t){this.resetSignature(t)}.bind(this)),this.clearButton.addEventListener("click",function(t){this.clearSignature(t)}.bind(this)),window.innerWidth);window.addEventListener("resize",this.debounce(function(){var t;window.innerWidth!=e&&((t=this.wrapper.querySelector('input[type="hidden"]').value)&&this.signaturePad.fromDataURL(t),this.onCanvasUpdateRatio(),e=window.innerWidth)}.bind(this)))},e.updateCanvasColor=function(t,e){var n=t.getContext("2d");return n.save(),n.globalCompositeOperation="source-atop",n.fillStyle=e,n.fillRect(0,0,t.width,t.height),n.restore(),t},e.removeBlanks=function(t){for(var e=t.getContext("2d"),n=t.width,i=t.height,a=e.getImageData(0,0,n,i),r=n+1,s=-1,o=i+1,u=-1,c=0,d=0,d=0;d<i;d++)for(c=0;c<n;c++)0<a.data[3+4*(d*n+c)]&&(c<r&&(r=c),s<c&&(s=c),d<o&&(o=d),u<d)&&(u=d);var h,l,t=s-r,p=u-o;return t<=0||p<=0?null:(e=e.getImageData(r,o,t,p),l=(h=document.createElement("canvas")).getContext("2d"),h.width=t,h.height=p,l.putImageData(e,0,0),h)},e.clearSignature=function(t){t.target.closest(".nrf-signature-clear")&&this.clear()},e.resetSignature=function(t){t.target.closest(".nrf-signature-reset")&&(this.clear(),this.reset())},e.debounce=function(e){var n;return function(t){n&&clearTimeout(n),n=setTimeout(e,100,t)}},e.onCanvasUpdateRatio=function(){var t=Math.max(window.devicePixelRatio||1,1);this.canvas.width=this.canvas.offsetWidth*t,this.canvas.height=this.canvas.offsetHeight*t,this.canvas.getContext("2d").scale(t,t),this.signaturePad.clear()},e.setValue=function(t){""!=(t=""!=(t=void 0===t?"":t)?t:this.input.value)&&(this.signaturePad.fromDataURL(t),this.wrapper.classList.add("painted"))},e.clear=function(){this.wrapper.classList.remove("painted"),this.signaturePad.clear(),this.input.value=""},e.reset=function(){var t=this.wrapper.querySelector(".initial-value").value;this.setValue(t)},t}(),NRF_Signature_Loader=function(){function t(){this.init()}return t.prototype.init=function(){var e;window.IntersectionObserver&&(e=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&(new NRF_Signature_Item(t.target).init(),e.unobserve(t.target))})},{rootMargin:"0px 0px 0px 0px"}),document.querySelectorAll(".nrf-widget.signature").forEach(function(t){e.observe(t)}))},t}();"loading"!=document.readyState?new NRF_Signature_Loader:document.addEventListener("DOMContentLoaded",function(){new NRF_Signature_Loader});

View File

@ -0,0 +1,2 @@
var handleSliderChange=function(e){var r,a,n=e.target.closest(".nrf-slider-wrapper");n&&((a=e.target.closest(".nrf-slider-range"))&&(n.querySelector(".nrf-slider-value").value=a.value,n.querySelector(".nrf-slider-value").dispatchEvent(new Event("change",{bubbles:!0}))),(a=e.target.closest(".nrf-slider-value"))&&(n.querySelector(".nrf-slider-range").value=a.value),e=n.querySelector(".nrf-slider-range"),a=e.dataset.baseColor,n=e.dataset.progressColor,a)&&n&&(r=e.max?~~(100*(e.value-e.min)/(e.max-e.min)):e.value,e.style.background="linear-gradient(to right, "+n+" 0%, "+n+" "+r+"%, "+a+" "+r+"%, "+a+" 100%)")};document.addEventListener("change",handleSliderChange),document.addEventListener("input",handleSliderChange);

View File

@ -0,0 +1,2 @@
var TF_Slideshow=function(){function t(t){this.id=t,this.selector="#"+this.id,this.thumbs_selector="#thumbs_"+this.id,this.wrapper=document.querySelector(this.selector),this.options=JSON.parse(this.wrapper.dataset.options),this.maybeLoadLightbox(),this.swiper=null,this.thumbsSwiper=null}var e=t.prototype;return e.init=function(){var i=this,o=this.wrapper.querySelector(".autoplay-progress-circle svg")||!1,n=this.wrapper.querySelector(".autoplay-progress-circle span")||!1,t=parseFloat(getComputedStyle(this.wrapper).getPropertyValue("--slideshow-slides-per-view")||1),e=(parseFloat(getComputedStyle(this.wrapper).getPropertyValue("--slideshow-space-between-slides")||0),this.options.transition_effect),t=(1<t&&"slide"!==e&&(e="slide",this.wrapper.querySelector(".swiper-cube-shadow"))&&this.wrapper.querySelector(".swiper-cube-shadow").remove(),{}),e=(this.options.breakpoints.mobile&&(t[this.options.breakpoints.mobile]={},this.options.slides_per_view.tablet&&(t[this.options.breakpoints.mobile].slidesPerView=this.options.slides_per_view.tablet),this.options.space_between_slides.tablet)&&(t[this.options.breakpoints.mobile].spaceBetween=this.options.space_between_slides.tablet),this.options.breakpoints.tablet&&(t[this.options.breakpoints.tablet]={},this.options.slides_per_view.desktop&&(t[this.options.breakpoints.tablet].slidesPerView=this.options.slides_per_view.desktop),this.options.space_between_slides.desktop)&&(t[this.options.breakpoints.tablet].spaceBetween=this.options.space_between_slides.desktop),{loop:this.options.infinite_loop,effect:e,slidesPerView:this.options.slides_per_view.mobile||1,spaceBetween:this.options.space_between_slides.mobile||0,breakpoints:t,on:{autoplayTimeLeft:function(t,e,s){i.options.autoplay_progress&&(o.style.setProperty("--progress",1-s),n.textContent=Math.ceil(e/1e3)+"s")}}});this.options.autoplay&&(e.autoplay={delay:parseInt(this.options.autoplay_delay),disableOnInteraction:!1}),"arrows"===this.options.nav_controls||"arrows_dots"===this.options.nav_controls?e.navigation={nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}:e.navigation={enabled:!1},"dots"===this.options.nav_controls||"arrows_dots"===this.options.nav_controls?e.pagination={el:".swiper-pagination",clickable:!0}:e.pagination={enabled:!1},this.options.keyboard_control&&(e.keyboard={enabled:!0}),this.options.show_thumbnails&&(t={spaceBetween:10,slidesPerView:"auto",loop:!1},this.options.show_thumbnails_arrows&&(t.navigation={nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}),this.thumbsSwiper=new Swiper(this.thumbs_selector,t),e.thumbs={swiper:this.thumbsSwiper}),this.swiper=new Swiper(this.selector,e)},e.maybeLoadLightbox=function(){var t;this.options.lightbox&&(t={selector:".tf-gallery-lightbox-item."+this.id,touchNavigation:!0},GLightbox(t))},t}(),TF_Slideshows=function(){function t(){this.init()}var e=t.prototype;return e.init=function(){this.getSlideshows().forEach(function(t){new TF_Slideshow(t.id).init()})},e.getSlideshows=function(){return document.querySelectorAll(".nrf-widget.tf-slideshow-wrapper")},t}();document.addEventListener("DOMContentLoaded",function(t){new TF_Slideshows});

View File

@ -0,0 +1,2 @@
var TF_Video=function(){function e(e){this.video=e,this.videoElement=this.video.querySelector(".tf-video-embed"),this.dataset=this.videoElement.dataset,this.overlay=this.video.querySelector(".tf-video-embed-overlay"),this.player=null}return e.prototype.setAttributeBool=function(e,t){return e[t]&&"true"===e[t]?1:0},e}();

View File

@ -0,0 +1,2 @@
function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),_setPrototypeOf(t.prototype.constructor=t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var TF_Dailymotion_Video=function(e){function t(t){t=e.call(this,t)||this;return t.player=null,t}_inheritsLoose(t,e);var o=t.prototype;return o.init=function(){this.maybeLoadAPI()},o.pause=function(){this.player&&this.player.pause()},o.dailymotionApiLoaded=function(){return window.dailymotion&&void 0!==window.dailymotion},o.maybeLoadAPI=function(){var t,e,o,i=this;if(!document.querySelector('script[data-video="'+this.dataset.videoId+'"]')||this.dailymotionApiLoaded())return(t=document.createElement("script")).src="https://geo.dailymotion.com/player.js",t.setAttribute("data-video",this.dataset.videoId),(e=document.getElementsByTagName("script")[0]).parentNode.insertBefore(t,e),o=function t(e){i.dailymotionApiLoaded()?i.initDailymotionVideo():setTimeout(function(){return t(e)},350)},new Promise(function(t,e){o(t)})},o.initDailymotionVideo=function(){function e(t){0<parseInt(o.dataset.videoEnd)&&parseInt(t.videoTime)>=parseInt(o.dataset.videoEnd)&&(o.pause(),o.dataset.videoEnd=0)}var o=this,i=this;dailymotion.createPlayer(this.videoElement.querySelector(":scope div").id,{video:this.dataset.videoId,params:{mute:"true"===this.dataset.videoMute,startTime:this.dataset.videoStart,loop:"true"===this.dataset.videoLoop,autoplay:!1}}).then(function(t){i.player=t,0<parseInt(i.dataset.videoEnd)&&(i.player.on("timeupdate",e),i.player.on("seeking",function(t){t.videoTime<1||i.player.off("timeupdate",e)}))}).catch(function(t){return console.error(t)})},t}(TF_Video);

View File

@ -0,0 +1,2 @@
function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),_setPrototypeOf(t.prototype.constructor=t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var TF_FacebookVideo_Video=function(e){function t(t){t=e.call(this,t)||this;return t.player=null,t}_inheritsLoose(t,e);var o=t.prototype;return o.init=function(){var t=this.initFacebookVideo.bind(this);this.maybeLoadFbRoot(),this.maybeLoadAPIScript(t)},o.initFacebookVideo=function(){var o;this.addFacebookVideo(),"object"==typeof FB&&(FB.XFBML.parse((o=this).video),FB.Event.subscribe("xfbml.ready",function(t){var e=o.video.id+"_"+o.video.querySelector(".tf-video-embed").dataset.videoId;"video"===t.type&&e===t.id&&(o.player=t.instance)}))},o.pause=function(){this.player&&this.player.pause()},o.maybeLoadFbRoot=function(){var t;document.getElementById("fb-root")||((t=document.createElement("div")).id="fb-root",document.body.appendChild(t))},o.maybeLoadAPIScript=function(t){var e;document.querySelector(".tf-fb-sdk-api-script")?t&&t():((e=document.createElement("script")).className="tf-fb-sdk-api-script",e.id="tf-fb-sdk-api-script",e.async=!0,e.src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2",t&&(e.onload=t),(t=document.getElementsByTagName("script")[0]).parentNode.insertBefore(e,t))},o.addFacebookVideo=function(){var t='\n\t\t\t<div\n\t\t\t\tclass="fb-video"\n\t\t\t\tid="'+this.video.id+"_"+this.dataset.videoId+'"\n\t\t\t\tdata-href="'+this.dataset.videoId+'"\n\t\t\t\tdata-allowfullscreen="'+this.dataset.videoFs+'"\n\t\t\t\tdata-autoplay="'+this.dataset.videoAutoplay+'"\n\t\t\t\tdata-width="'+this.dataset.videoWidth+'"\n\t\t\t\tdata-show-text="'+this.dataset.videoShowText+'"\n\t\t\t\tdata-show-captions="'+this.dataset.videoShowCaptions+'"\n\t\t\t\tdata-lazy="false"\n\t\t\t\t>\n\t\t\t</div>\n\t\t';this.videoElement.innerHTML=t},t}(TF_Video);

View File

@ -0,0 +1,2 @@
function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),_setPrototypeOf(t.prototype.constructor=t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var TF_SelfHostedVideo_Video=function(e){function t(t){t=e.call(this,t)||this;return t.player=null,t}_inheritsLoose(t,e);var o=t.prototype;return o.init=function(){this.maybeLoadVideo()},o.pause=function(){this.player&&this.player.pause()},o.maybeLoadVideo=function(){this.player=this.videoElement.querySelector("video");var t=this.player.querySelector("source");t.src=t.dataset.src,this.player.load()},t}(TF_Video);

View File

@ -0,0 +1,2 @@
function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),_setPrototypeOf(t.prototype.constructor=t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var TF_Vimeo_Video=function(e){function t(t){t=e.call(this,t)||this;return t.player=null,t}_inheritsLoose(t,e);var i=t.prototype;return i.init=function(){this.maybeLoadVimeoAPI()},i.pause=function(){this.player&&this.player.pause()},i.vimeoApiLoaded=function(){return window.Vimeo&&window.Vimeo.Player&&void 0!==window.Vimeo.Player},i.maybeLoadVimeoAPI=function(){function i(t){o.vimeoApiLoaded()?o.initVimeoVideo():setTimeout(function(){return i(t)},350)}var t,e,o=this;document.querySelector(".tf-vimeo-api-script")||this.vimeoApiLoaded()||((t=document.createElement("script")).className="tf-vimeo-api-script",t.src="https://player.vimeo.com/api/player.js",(e=document.getElementsByTagName("script")[0]).parentNode.insertBefore(t,e));return new Promise(function(t,e){i(t)})},i.initVimeoVideo=function(){var e=this,i=this,o=(this.player=new window.Vimeo.Player(this.videoElement,{id:this.dataset.videoId,loop:this.setAttributeBool(this.dataset,"videoLoop"),autoplay:this.setAttributeBool(this.dataset,"videoAutoplay"),controls:this.setAttributeBool(this.dataset,"videoControls"),title:this.setAttributeBool(this.dataset,"videoTitle"),byline:this.setAttributeBool(this.dataset,"videoByline"),portrait:this.setAttributeBool(this.dataset,"videoPortrait"),color:this.dataset.videoColor.substring(1),autopause:!1,muted:this.setAttributeBool(this.dataset,"videoMute"),dnt:this.setAttributeBool(this.dataset,"videoPrivacy"),keyboard:this.setAttributeBool(this.dataset,"videoKeyboard"),pip:this.setAttributeBool(this.dataset,"videoPip")}),this.dataset.videoStart&&this.player.setCurrentTime(this.dataset.videoStart),parseInt(this.dataset.videoStart)),s=(0<o&&this.player.on("play",function(t){0===parseInt(t.seconds)&&this.player.setCurrentTime(o)}),function(t){0<parseInt(e.dataset.videoEnd)&&parseInt(t.seconds)>=parseInt(e.dataset.videoEnd)&&(e.pause(),e.dataset.videoEnd=0)});0<parseInt(this.dataset.videoEnd)&&(this.player.on("timeupdate",s),this.player.on("seeked",function(t){parseInt(t.seconds)<1||i.player.off("timeupdate",s)})),this.player.on("loaded",function(){"true"!==i.video.dataset.readonly&&"true"!==i.video.dataset.disabled&&("true"===i.dataset.videoAutoplay&&i.overlay?i.video.classList.add("hiddenOverlay"):"false"===i.dataset.videoAutoplay&&i.overlay&&(i.player.play(),i.player.on("play",function(){i.video.classList.add("hiddenOverlay")})))})},t}(TF_Video);

View File

@ -0,0 +1,2 @@
function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),_setPrototypeOf(t.prototype.constructor=t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var TF_YouTube_Video=function(e){function t(t){t=e.call(this,t)||this;return t.player=null,t}_inheritsLoose(t,e);var o=t.prototype;return o.init=function(){this.maybeLoadYouTubeAPI()},o.pause=function(){this.player&&this.player.pauseVideo()},o.youTubeApiLoaded=function(){return window.YT&&window.YT.Player&&void 0!==window.YT.Player},o.maybeLoadYouTubeAPI=function(){function o(t){i.youTubeApiLoaded()?i.initYouTubeVideo():setTimeout(function(){return o(t)},350)}var t,e,i=this;document.querySelector(".tf-youtube-api-script")||this.youTubeApiLoaded()||((t=document.createElement("script")).className="tf-youtube-api-script",t.src="https://www.youtube.com/player_api",(e=document.getElementsByTagName("script")[0]).parentNode.insertBefore(t,e));return new Promise(function(t,e){o(t)})},o.initYouTubeVideo=function(){var e=this,t="https://www.youtube"+("true"===this.dataset.videoPrivacy?"-nocookie":"")+".com";this.player=new window.YT.Player(this.videoElement,{videoId:this.dataset.videoId,playerVars:{autoplay:this.setAttributeBool(this.dataset,"videoAutoplay"),controls:this.setAttributeBool(this.dataset,"videoControls"),showinfo:0,loop:this.setAttributeBool(this.dataset,"videoLoop"),playlist:this.dataset.videoId,fs:this.setAttributeBool(this.dataset,"videoFs"),cc_load_policy:this.setAttributeBool(this.dataset,"videoCc"),disablekb:this.setAttributeBool(this.dataset,"videoDisablekb"),rel:"1"==this.dataset.videoRel?1:0,iv_load_policy:3,autohide:0,color:this.dataset.videoColor,mute:this.setAttributeBool(this.dataset,"videoMute"),start:parseInt(this.dataset.videoStart,10)||void 0,end:parseInt(this.dataset.videoEnd,10)||void 0},host:t,events:{onReady:function(t){"true"!==e.video.dataset.readonly&&"true"!==e.video.dataset.disabled&&("true"===e.dataset.videoAutoplay&&e.overlay?e.video.classList.add("hiddenOverlay"):"false"===e.dataset.videoAutoplay&&e.overlay&&(e.video.classList.add("hiddenOverlay"),e.player.playVideo()))},onStateChange:function(t){t.data===window.YT.PlayerState.PLAYING&&e.video.classList.add("hiddenOverlay")}}})},t}(TF_Video);

View File

@ -0,0 +1,2 @@
var TF_Video_Init=function(){function e(){this.players=[],this.init()}var i=e.prototype;return i.init=function(){var e,t,i;this.initEvents(),window.IntersectionObserver&&(e=document.querySelectorAll(".nrf-widget.tf-video:not(.done)"))&&(t=this,i=new IntersectionObserver(function(e,i){e.forEach(function(e){var i;e.isIntersecting?(i=e.target).classList.contains("done")||i.querySelector(".tf-video-embed-overlay")&&!i.classList.contains("hiddenOverlay")&&"true"!==i.querySelector(".tf-video-embed").dataset.videoAutoplay||t.startVideo(i):(i=e.target).classList.contains("done")&&"videoAutopause"in i.querySelector(".tf-video-embed").dataset&&"false"!==i.querySelector(".tf-video-embed").dataset.videoAutopause&&t.pauseVideo(i)})},{rootMargin:"0px 0px 0px 0px"}),e.forEach(function(e){i.observe(e)}))},i.startVideo=function(e){switch(e.classList.add("done"),e.querySelector(".tf-video-embed").dataset.videoType){case"youtube":this.players[e.id]=new TF_YouTube_Video(e),this.players[e.id].init();break;case"vimeo":this.players[e.id]=new TF_Vimeo_Video(e),this.players[e.id].init();break;case"facebookvideo":this.players[e.id]=new TF_FacebookVideo_Video(e),this.players[e.id].init();break;case"dailymotion":this.players[e.id]=new TF_Dailymotion_Video(e),this.players[e.id].init();break;case"selfhostedvideo":this.players[e.id]=new TF_SelfHostedVideo_Video(e),this.players[e.id].init()}},i.pauseVideo=function(e){this.players[e.id].pause()},i.initEvents=function(){document.addEventListener("click",function(e){this.onCoverClose(e)}.bind(this))},i.onCoverClose=function(e){var e=e.target.closest(".tf-video-embed-overlay");e&&((e=e.closest(".nrf-widget.tf-video")).classList.add("hiddenOverlay"),this.startVideo(e))},e}();document.addEventListener("DOMContentLoaded",function(){new TF_Video_Init});