diff --git a/public/js/super-web-share-public.min.js b/public/js/super-web-share-public.min.js index 83ff365..49ae8c4 100644 --- a/public/js/super-web-share-public.min.js +++ b/public/js/super-web-share-public.min.js @@ -1 +1 @@ -"use strict";var DOMReady=function(e){"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener?document.addEventListener("DOMContentLoaded",e()):document.attachEvent&&document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&e()})};function hasPermission(){if((void 0===navigator.share||!navigator.share)&&"enable"!=window.superWebShareFallback.superwebshare_fallback_enable){var e,t=document.getElementsByClassName("superwebshare_prompt")||document.getElementsByClassName(".superwebshare_prompt .span");for(e=0;e0&&r.forEach(e=>e.style.display="none"),console.log("SuperWebShare: Your browser does not seems to support SuperWebShare, as the browser is incompatible")}}DOMReady(function(){setTimeout(hasPermission,200),"https:"!=window.location.protocol&&document.querySelector(".sws-copy")&&(document.querySelector(".sws-copy").style.display="none")});const fallbackForcefullyShowDesktop=()=>{if("enable"!==window.superWebShareFallback.fallback_show_in_desktop)return!1;{let e=window.navigator.userAgent.indexOf("Edg")>-1;return!/android|iphone|kindle|ipad|webos|ipod/i.test(window.navigator.userAgent)&&!e}};async function SuperWebSharefn(e,t,r){if(void 0===navigator.share||!navigator.share||fallbackForcefullyShowDesktop())modal();else if("https:"!=window.location.protocol)console.log("SuperWebShare: Seems like the website is not served fully via https://. As for supporting SuperWebShare the website should be served fully via https://");else try{await navigator.share({title:e,text:r,url:t})}catch(a){console.log("Error occurred while sharing: "+a);return}}const getPageMeta=()=>{var e={};return null!=document.querySelector('meta[property="og:description"]')?e.meta_desc=document.querySelector('meta[property="og:description"]').content:null!=document.querySelector('meta[property="description"]')?e.meta_desc=document.querySelector('meta[property="description"]').content:e.meta_desc=document.title,null!=document.querySelector('meta[property="og:title"]')?e.meta_title=document.querySelector('meta[property="og:title"]').content:null!=document.querySelector('meta[property="twitter:title"]')?e.meta_title=document.querySelector('meta[property="twitter:title"]').content:e.meta_title=document.title,null!=document.querySelector('meta[property="og:url"]')?e.meta_url=document.querySelector('meta[property="og:url"]').content:e.meta_url=window.location.href,e};document.addEventListener("click",function(e){var t=e.target;if(t.classList.contains("superwebshare_prompt")||t.parentNode.classList.contains("superwebshare_prompt")||t.parentNode.parentNode.classList.contains("superwebshare_prompt")){let{meta_desc:r,meta_title:a,meta_url:o}=getPageMeta();SuperWebSharefn(a,o,r)}else t.classList.contains("sws-modal-bg")&&modal("hide")}),DOMReady(function(){let e=document.querySelector(".sws-copy a");e&&e.addEventListener("click",function(e){e.preventDefault();let{meta_url:t}=getPageMeta();navigator.clipboard.writeText(t);let r=this.querySelector("span");return r.innerText="Link Copied ✔",setTimeout(function(){r.innerText="Copy Link"},4e3),!1});let t=document.querySelector(".sws-modal-close");t&&t.addEventListener("click",function(e){return e.preventDefault(),modal("hide"),!1}),document.querySelectorAll(".sws-open-in-tab").forEach(function(e){e.addEventListener("click",function(e){e.preventDefault();let{meta_title:t,meta_url:r}=getPageMeta(),a=this.getAttribute("data-params")||"",o=this.getAttribute("data-type")||"",s={facebook:`https://www.facebook.com/sharer/sharer.php?u=${encodeURI(r)}${encodeURI(a)}`,twitter:`http://twitter.com/share?text=${encodeURI(t)}&url=${encodeURI(r)}${encodeURI(a)}`,linkedin:`https://www.linkedin.com/sharing/share-offsite?url=${encodeURI(r)}${encodeURI(a)}`,whatsapp:`https://api.whatsapp.com/send?text=${encodeURI(r)}${encodeURI(a)}`};return"whatsapp"==o?window.open(s[o]):window.open(s[o],null,"height=500,width=500"),!1})})});const modal=(e="show")=>{let t=document.querySelector(".sws-modal-bg");t&&("hide"==e?t.style.display="none":t.style.display="flex")}; +"use strict";var DOMReady=function(e){"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener?document.addEventListener("DOMContentLoaded",e()):document.attachEvent&&document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&e()})};function hasPermission(){if((void 0===navigator.share||!navigator.share)&&"enable"!=window.superWebShareFallback.superwebshare_fallback_enable){var e,t=document.getElementsByClassName("superwebshare_prompt")||document.getElementsByClassName(".superwebshare_prompt .span");for(e=0;e0&&r.forEach(e=>e.style.display="none"),console.log("SuperWebShare: Your browser does not seems to support SuperWebShare, as the browser is incompatible")}}DOMReady(function(){setTimeout(hasPermission,200),"https:"!=window.location.protocol&&document.querySelector(".sws-copy")&&(document.querySelector(".sws-copy").style.display="none")});const fallbackForcefullyShowDesktop=()=>{if("enable"!==window.superWebShareFallback.fallback_show_in_desktop)return!1;{let e=window.navigator.userAgent.indexOf("Edg")>-1;return!/android|iphone|kindle|ipad|webos|ipod/i.test(window.navigator.userAgent)&&!e}};async function SuperWebSharefn(e,t,r){if(void 0===navigator.share||!navigator.share||fallbackForcefullyShowDesktop())modal();else if("https:"!=window.location.protocol)console.log("SuperWebShare: Seems like the website is not served fully via https://. As for supporting SuperWebShare the website should be served fully via https://");else try{await navigator.share({title:e,text:r,url:t})}catch(a){console.log("Error occurred while sharing: "+a);return}}const getPageMeta=()=>{var e={};return null!=document.querySelector('meta[property="og:description"]')?e.meta_desc=document.querySelector('meta[property="og:description"]').content:null!=document.querySelector('meta[property="description"]')?e.meta_desc=document.querySelector('meta[property="description"]').content:e.meta_desc=document.title,null!=document.querySelector('meta[property="og:title"]')?e.meta_title=document.querySelector('meta[property="og:title"]').content:null!=document.querySelector('meta[property="twitter:title"]')?e.meta_title=document.querySelector('meta[property="twitter:title"]').content:e.meta_title=document.title,null!=document.querySelector('meta[property="og:url"]')?e.meta_url=document.querySelector('meta[property="og:url"]').content:e.meta_url=window.location.href,e};document.addEventListener("click",function(e){var t=e.target;if(t.classList.contains("superwebshare_prompt")||t.parentNode.classList.contains("superwebshare_prompt")||t.parentNode.parentNode.classList.contains("superwebshare_prompt")){let{meta_desc:r,meta_title:a,meta_url:o}=getPageMeta();SuperWebSharefn(a,o,r)}else t.classList.contains("sws-modal-bg")&&modal("hide")}),DOMReady(function(){let e=document.querySelector(".sws-copy a");e&&e.addEventListener("click",function(e){e.preventDefault();let{meta_url:t}=getPageMeta();navigator.clipboard.writeText(t);let r=this.querySelector("span");return r.innerText="Link Copied \xe2œ”",setTimeout(function(){r.innerText="Copy Link"},4e3),!1});let t=document.querySelector(".sws-modal-close");t&&t.addEventListener("click",function(e){return e.preventDefault(),modal("hide"),!1}),document.querySelectorAll(".sws-open-in-tab").forEach(function(e){e.addEventListener("click",function(e){e.preventDefault();let{meta_title:t,meta_url:r}=getPageMeta(),a=this.getAttribute("data-params")||"",o=this.getAttribute("data-type")||"",s={facebook:`https://www.facebook.com/sharer/sharer.php?u=${encodeURI(r)}${encodeURI(a)}`,twitter:`http://twitter.com/share?text=${encodeURI(t)}&url=${encodeURI(r)}${encodeURI(a)}`,linkedin:`https://www.linkedin.com/sharing/share-offsite?url=${encodeURI(r)}${encodeURI(a)}`,whatsapp:`https://api.whatsapp.com/send?text=${encodeURI(t)}${encodeURI("\n\r")}${encodeURI(r)}${encodeURI(a)}`};return"whatsapp"==o?window.open(s[o]):window.open(s[o],null,"height=500,width=500"),!1})})});const modal=(e="show")=>{let t=document.querySelector(".sws-modal-bg");t&&("hide"==e?t.style.display="none":t.style.display="flex")};