PageSourceSearch

https://www.svs.is/static/local/ext-social/js/social.min.js

js svs.is collected 2026-10-02 11:04:15 UTC 4,776 bytes, 2 lines download raw bytes

1!function(){var t=function(t){"use strict";var e=function(){function t(){}return t.getLabelText=function(){return"is"===moya.lang?"Deila":"Share"},t.getFacebookShareText=function(){return"is"===moya.lang?"Deila á Facebook":"Share on Facebook"},t.getTwitterShareText=function(){return"is"===moya.lang?"Deila á Twitter":"Share on Twitter"},t.getPrintShareText=function(){return"is"===moya.lang?"Prenta síðu":"Print page"},t}(),n=MoyaContainer.get("core.util");MoyaContainer.register("ext.social.links",(function(){return{init:r.create,getStylesheetUrl:r.getStylesheetUrl}}));var r=function(){function t(t){this.mainElm=t,this.currentUrl=this.getCurrentUrl(t),this.currentTitle=this.getCurrentTitle(t),this.hasTwitter=!!t.dataset.hasTwitter,this.hasFacebook=!!t.dataset.hasFacebook,this.hasPrint=!!t.dataset.hasPrint,this.hasEmail=!!t.dataset.hasEmail}return t.create=function(e){return new t(e).run()},t.getStylesheetUrl=function(){var t="";return Array.from(document.styleSheets).filter((function(t){return t.href&&-1!==t.href.indexOf("theme.css")})).map((function(t){return t.href})).forEach((function(e){t=e.split("?")[1],""!==e.split("?")[1]&&(t=Number(e.split("?")[1]).toString())})),"/static/local/ext-social/css/social-links.css?"+t},t.prototype.run=function(){this.mainElm.classList.add("loaded"),t.loadStyles(),this.mainElm.appendChild(this.createSocialLinks()),this.handleShareThisLinks(),this.handlePrintLink()},t.loadStyles=function(){var e=t.getStylesheetUrl();e&&MoyaLoader.css(e)},t.prototype.createSocialLinks=function(){var t=this.createWrapper();this.addLabel(t);var e=document.createElement("div");return e.classList.add("social__toolbox"),this.hasFacebook&&e.appendChild(this.createFaceBookLink()),this.hasTwitter&&e.appendChild(this.createTwitterLink()),this.hasPrint&&e.appendChild(this.createPrintLink()),this.hasEmail&&e.appendChild(this.createEmailLink()),t.appendChild(e),t},t.prototype.createWrapper=function(){var t=document.createElement("div");return t.classList.add("social__wrapper"),t},t.prototype.addLabel=function(t){var n=document.createElement("div");n.classList.add("social__label"),n.textContent=e.getLabelText(),t.appendChild(n)},t.prototype.createEmailLink=function(){var t=document.createElement("a");return t.href="mailto:?subject="+encodeURIComponent(this.currentTitle)+"&body="+this.currentUrl,t.classList.add("email"),t},t.prototype.createPrintLink=function(){var t=document.createElement("button");return t.setAttribute("aria-label",e.getPrintShareText()),t.classList.add("print"),t.type="button",t},t.prototype.createTwitterLink=function(){var t=document.createElement("a"),n={url:this.currentUrl,text:this.currentTitle},r=new URLSearchParams(n);return t.href="https://twitter.com/intent/tweet?url="+r.toString(),t.target="_blank",t.setAttribute("aria-label",e.getTwitterShareText()),t.classList.add("shareThis"),t.classList.add("twitter"),t},t.prototype.createFaceBookLink=function(){var t=document.createElement("a");return t.href="https://facebook.com/sharer/sharer.php?u="+this.currentUrl,t.target="_blank",t.setAttribute("aria-label",e.getFacebookShareText()),t.classList.add("shareThis"),t.classList.add("facebook"),t},t.prototype.handleShareThisLinks=function(){var t=this;this.mainElm.querySelectorAll(".shareThis").forEach((function(e){var r=e.classList[e.classList.length-1];n.delegate(e,"click",".social__toolbox ."+r,(function(n){n.preventDefault(),t.openNewWindow(e.href,t.currentTitle,569,569)}))}))},t.prototype.openNewWindow=function(t,e,n,r){var i=window.screenLeft,a=window.screenTop,o=(window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width)/2-n/2+i,s=(window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height)/2-r/2+a,c=window.open(t,e,"scrollbars=0, toolbar=0, width="+n+", height="+r+", top="+s+", left="+o);window.focus&&c.focus()},t.prototype.getCurrentUrl=function(t){var e=t.dataset.customUrl;return e||window.location.href.split(/[?#]/)[0]},t.prototype.getCurrentTitle=function(t){var e=t.dataset.customTitle;return e||document.querySelector("meta[property='og:title']").getAttribute("content")},t.prototype.handlePrintLink=function(){var t=this;n.delegate(this.mainElm,"click",".print",(function(e){if(e.preventDefault(),t.mainElm.dataset.customUrl){var n=document.createElement("iframe");n.onload=function(){var t=this,e=function(){document.body.removeChild(t)};this.contentWindow.onbeforeunload=e,this.contentWindow.onafterprint=e,this.contentWindow.print()},n.style.display="none",n.src=t.currentUrl,document.body.appendChild(n)}else window.print()}))},t}();return t.SocialLinks=r,t}({});"function"==typeof t&&t()}();
2//# sourceMappingURL=social.min.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.