-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.min.js
1 lines (1 loc) · 12.5 KB
/
post.min.js
1
function openNav(){document.getElementById("myTopnav").style.left="0"}function closeNav(){document.getElementById("myTopnav").style.left="-250px"}function menuoverlayOn(){document.getElementById("menuoverlay").style.display="block"}function menuoverlayOff(){document.getElementById("menuoverlay").style.display="none"}function addClassBody(){var b,c,d;b=document.body,c="flow",d=b.className.split(" "),-1==d.indexOf(c)&&(b.className+=" "+c)}function removeClassBody(){var a=document.body;a.className=a.className.replace(/\bflow\b/g,"")}function scrollFunction(){document.getElementById("backToTop").style.display=200<document.body.scrollTop||200<document.documentElement.scrollTop?"block":"none"}function topFunction(){document.body.scrollTop=0,document.documentElement.scrollTop=0}for(var btns=document.getElementsByClassName("dropbtn"),i=0;i<btns.length;i++)btns[i].addEventListener("click",function(){var a=document.getElementsByClassName("active");0<a.length&&(a[0].className=a[0].className.replace(" active","")),this.className+=" active"});window.onclick=function(b){if(!b.target.matches(".dropbtn")){var c,d=document.getElementsByClassName("dropbtn");for(c=0;c<d.length;c++){var a=d[c];a.classList.contains("active")&&a.classList.remove("active")}}};var randomRandomIndex,showRandomPost;!function(b,d,f){var j={widgetTitle:"",widgetStyle:2,homePage:"https://www.digitalpoin.com/",numPosts:5,summaryLength:370,titleLength:"auto",thumbnailSize:90,thumbnailHeight:50,noImage:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAA3NCSVQICAjb4U/gAAAADElEQVQImWOor68HAAL+AX7vOF2TAAAAAElFTkSuQmCC",containerId:"random-post",newTabLink:!1,moreText:"Baca Selengkapnya",callBack:function(){}};for(var a in RandomPostConfig)j[a]="undefined"==RandomPostConfig[a]?j[a]:RandomPostConfig[a];var g=function(a){var b=d.createElement("script");b.type="text/javascript",b.src=a,f.appendChild(b)},h=function(a,b){return Math.floor(Math.random()*(b-a+1))+a},k=function(b){var c,d,e=b.length;if(0===e)return!1;for(;--e;)c=Math.floor(Math.random()*(e+1)),d=b[e],b[e]=b[c],b[c]=d;return b},e=function(b){var e,f,l,n,q,v=document.getElementById(j.containerId),r=k(b.feed.entry),c=j.widgetStyle,d=j.widgetTitle+"<ul class=\"random-post-style-"+c+"\">",w=j.newTabLink?" target=\"_blank\"":"";if(v){for(var u=0;u<j.numPosts&&u!=r.length;u++){f=r[u].title.$t,l="auto"!==j.titleLength&&j.titleLength<f.length?f.substring(0,j.titleLength)+"…":f,n="media$thumbnail"in r[u]&&!1!==j.thumbnailSize?r[u].media$thumbnail.url.replace(/.*?:\/\//g,"https://cdn.statically.io/img/").replace(/\/s[0-9]+(\-c)?/,"/w"+j.thumbnailSize+"-h50-p-k-no-nu"):j.noImage,q="summary"in r[u]&&0<j.summaryLength?r[u].summary.$t.replace(/<br ?\/?>/g," ").replace(/<.*?>/g,"").replace(/[<>]/g,"").substring(0,j.summaryLength)+"…":"";for(var x=0,y=r[u].link.length;y>x;x++)e="alternate"==r[u].link[x].rel?r[u].link[x].href:"#";d+=2==c?"<li><div class=\"random-post-item-thumbnail\"><a href=\""+e+"\" title=\""+f+"\""+w+"><img alt=\"\" src=\""+n+"\" width=\""+j.thumbnailSize+"\" height=\""+j.thumbnailHeight+"\"></a></div><div class=\"random-post-item-title\"><a title=\""+f+"\" href=\""+e+"\""+w+">"+l+"</a></div><span class=\"random-post-item-summary\"><span class=\"random-post-item-summary-text\">"+q+"</span> <a href=\""+e+"\" class=\"random-post-item-more\""+w+">"+j.moreText+"</a></span>"+"<span style=\"display:block;clear:both;\"></span>"+"</li>":3==c||4==c?"<li class=\"random-post-item\" tabindex=\"0\"><a class=\"random-post-item-title\" href=\""+e+"\""+w+" target=\"_blank\"><img alt=\"\" class=\"random-post-item-thumbnail\" src=\""+n+"\" width=\""+j.thumbnailSize+"\" height=\""+j.thumbnailSize+"\"></a><div class=\"random-post-item-tooltip\"><a class=\"random-post-item-title\" title=\""+f+"\" href=\""+e+"\""+w+" target='_blank'>"+l+"</a></div>"+"<span style=\"display:block;clear:both;\"></span>"+"</li>":5==c?"<li class=\"random-post-item\" tabindex=\"0\"><a class=\"random-post-item-wrapper\" href=\""+e+"\" title=\""+f+"\""+w+" target=\"_blank\"><img alt=\"\" class=\"random-post-item-thumbnail\" src=\""+n+"\" width=\""+j.thumbnailSize+"\" height=\""+j.thumbnailSize+"\"><span class=\"random-post-item-tooltip\">"+l+"</span></a>"+"<span style=\"display:block;clear:both;\"></span>"+"</li>":6==c?"<li><a class=\"random-post-item-title\" title=\""+f+"\" href=\""+e+"\""+w+" target='_blank'>"+l+"</a><div class=\"random-post-item-tooltip\"><img alt=\"\" class=\"random-post-item-thumbnail\" src=\""+n+"\" width=\""+j.thumbnailSize+"\" height=\""+j.thumbnailSize+"\"><span class=\"random-post-item-summary\"><span class=\"random-post-item-summary-text\">"+q+"</span></span>"+"<span style=\"display:block;clear:both;\"></span>"+"</div></li>":"<li><a title=\""+f+"\" href=\""+e+"\""+w+" target='_blank'>"+l+"</a></li>"}v.innerHTML=d+="</ul><span style=\"display:block;clear:both;\"></span>",j.callBack()}};randomRandomIndex=function(b){var c=b.feed.openSearch$totalResults.$t-j.numPosts,d=h(1,0<c?c:1);g(j.homePage.replace(/\/$/,"")+"/feeds/posts/summary?alt=json-in-script&orderby=updated&start-index="+d+"&max-results="+j.numPosts+"&callback=showRandomPost")},showRandomPost=e,g(j.homePage.replace(/\/$/,"")+"/feeds/posts/summary?alt=json-in-script&orderby=updated&max-results=0&callback=randomRandomIndex")}(window,document,document.getElementsByTagName("head")[0]),window.onscroll=function(){scrollFunction()},!function(b,c){var d=c(b,b.document);b.lazySizes=d,"object"==typeof module&&module.exports&&(module.exports=d)}("undefined"==typeof window?{}:window,function(l,j){"use strict";var r,F;if(function(){var b,c={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(b in F=l.lazySizesConfig||l.lazysizesConfig||{},c)b in F||(F[b]=c[b])}(),!j||!j.getElementsByClassName)return{init:function(){},cfg:F,noSupport:!0};var t=j.documentElement,D=l.Date,e=l.HTMLPictureElement,i=l.addEventListener,H=l.setTimeout,c=l.requestAnimationFrame||H,d=l.requestIdleCallback,q=/^picture$/i,f=["load","error","lazyincluded","_lazyloaded"],m={},I=Array.prototype.forEach,g=function(a,b){return m[b]||(m[b]=new RegExp("(\\s|^)"+b+"(\\s|$)")),m[b].test(a.getAttribute("class")||"")&&m[b]},y=function(a,b){g(a,b)||a.setAttribute("class",(a.getAttribute("class")||"").trim()+" "+b)},v=function(b,c){var d;(d=g(b,c))&&b.setAttribute("class",(b.getAttribute("class")||"").replace(d," "))},b=function(c,d,e){var g=e?"addEventListener":"removeEventListener";e&&b(c,d),f.forEach(function(b){c[g](b,d)})},z=function(a,b,c,d,e){var f=j.createEvent("Event");return c||(c={}),c.instance=r,f.initEvent(b,!d,!e),f.detail=c,a.dispatchEvent(f),f},A=function(b,c){var a;!e&&(a=l.picturefill||F.pf)?(c&&c.src&&!b.getAttribute("srcset")&&b.setAttribute("srcset",c.src),a({reevaluate:!0,elements:[b]})):c&&c.src&&(b.src=c.src)},h=function(a,b){return(getComputedStyle(a,null)||{})[b]},p=function(b,c,d){for(d=d||b.offsetWidth;d<F.minSize&&c&&!b._lazysizesWidth;)d=c.offsetWidth,c=c.parentNode;return d},w=function(){var b,d,f=[],g=[],h=f,k=function(){var a=h;for(h=f.length?g:f,b=!0,d=!1;a.length;)a.shift()();b=!1},i=function(a,e){b&&!e?a.apply(this,arguments):(h.push(a),d||(d=!0,(j.hidden?H:c)(k)))};return i._lsFlush=k,i}(),k=function(b,a){return a?function(){w(b)}:function(){var c=this,d=arguments;w(function(){b.apply(c,d)})}},o=function(b){var c,f=0,g=F.throttleDelay,h=F.ricTimeout,e=function(){c=!1,f=D.now(),b()},i=d&&49<h?function(){d(e,{timeout:h}),h!==F.ricTimeout&&(h=F.ricTimeout)}:k(function(){H(e)},!0);return function(a){var b;(a=!0===a)&&(h=33),c||(c=!0,b=g-(D.now()-f),0>b&&(b=0),a||9>b?i():H(i,b))}},C=function(b){var c,f,g=function(){c=null,b()},h=function(){var a=D.now()-f;99>a?H(h,99-a):(d||g)(g)};return function(){f=D.now(),c||(c=H(h,99))}},s=function(){var a,n,d,x,c,B,E,N,R,T,W,aa,ba="onscroll"in l&&!/(gle|ing)bot/.test(navigator.userAgent),$=0,ca=0,da=-1,f=function(a){ca--,a&&!(0>ca)&&a.target||(ca=0)},ea=function(a){return null==aa&&(aa="hidden"==h(j.body,"visibility")),aa||"hidden"!=h(a.parentNode,"visibility")&&"hidden"!=h(a,"visibility")},Q=function(b,c){var a,d=b,e=ea(b);for(N-=c,W+=c,R-=c,T+=c;e&&(d=d.offsetParent)&&d!=j.body&&d!=t;)(e=0<(h(d,"opacity")||1))&&"visible"!=h(d,"overflow")&&(a=d.getBoundingClientRect(),e=T>a.left&&R<a.right&&W>a.top-1&&N<a.bottom+1);return e},e=function(){var i,k,m,p,q,s,w,A,C,D,G,H,I=r.elements;if((x=F.loadMode)&&8>ca&&(i=I.length)){for(k=0,da++;i>k;k++)if(I[k]&&!I[k]._lazyRace)if(!ba||r.prematureUnveil&&r.prematureUnveil(I[k]))Z(I[k]);else if(!((A=I[k].getAttribute("data-expand"))&&(s=1*A)||(s=$),D||(D=!F.expand||1>F.expand?500<t.clientHeight&&500<t.clientWidth?500:370:F.expand,r._defEx=D,G=D*F.expFactor,H=F.hFac,aa=null,G>$&&1>ca&&2<da&&2<x&&!j.hidden?($=G,da=0):$=1<x&&1<da&&6>ca?D:0),C!==s&&(B=innerWidth+s*H,E=innerHeight+s,w=-1*s,C=s),m=I[k].getBoundingClientRect(),(W=m.bottom)>=w&&(N=m.top)<=E&&(T=m.right)>=w*H&&(R=m.left)<=B&&(W||T||R||N)&&(F.loadHidden||ea(I[k]))&&(n&&3>ca&&!A&&(3>x||4>da)||Q(I[k],s))))!q&&n&&!p&&4>ca&&4>da&&2<x&&(a[0]||F.preloadAfterLoad)&&(a[0]||!A&&(W||T||R||N||"auto"!=I[k].getAttribute(F.sizesAttr)))&&(p=a[0]||I[k]);else if(Z(I[k]),q=!0,9<ca)break;p&&!q&&Z(p)}},U=o(e),V=function(a){var c=a.target;return c._lazyCache?void delete c._lazyCache:(f(a),y(c,F.loadedClass),v(c,F.loadingClass),b(c,K),z(c,"lazyloaded"),void 0)},G=k(V),K=function(a){G({target:a.target})},X=function(b,c){try{b.contentWindow.location.replace(c)}catch(d){b.src=c}},J=function(b){var c,d=b.getAttribute(F.srcsetAttr);(c=F.customMedia[b.getAttribute("data-media")||b.getAttribute("media")])&&b.setAttribute("media",c),d&&b.setAttribute("srcset",d)},Y=k(function(g,e,j,a,i){var k,n,o,r,u,x;(u=z(g,"lazybeforeunveil",e)).defaultPrevented||(a&&(j?y(g,F.autosizesClass):g.setAttribute("sizes",a)),n=g.getAttribute(F.srcsetAttr),k=g.getAttribute(F.srcAttr).replace(/.*?:\/\//g,"https://cdn.statically.io/img/"),i&&(o=g.parentNode,r=o&&q.test(o.nodeName||"")),x=e.firesLoad||"src"in g&&(n||k||r),u={target:g},y(g,F.loadingClass),x&&(clearTimeout(d),d=H(f,2500),b(g,K,!0)),r&&I.call(o.getElementsByTagName("source"),J),n?g.setAttribute("srcset",n):k&&!r&&(/^iframe$/i.test(g.nodeName)?X(g,k):g.src=k),i&&(n||r)&&A(g,{src:k})),g._lazyRace&&delete g._lazyRace,v(g,F.lazyClass),w(function(){var a=g.complete&&1<g.naturalWidth;x&&!a||(a&&y(g,"ls-is-cached"),V(u),g._lazyCache=!0,H(function(){"_lazyCache"in g&&delete g._lazyCache},9)),"lazy"==g.loading&&ca--},!0)}),Z=function(b){if(!b._lazyRace){var c,d=/^img$/i.test(b.nodeName),a=d&&(b.getAttribute(F.sizesAttr)||b.getAttribute("sizes")),e="auto"==a;(e||!n)&&d&&(b.getAttribute("src")||b.srcset)&&!b.complete&&!g(b,F.errorClass)&&g(b,F.lazyClass)||(c=z(b,"lazyunveilread").detail,e&&u.updateElem(b,!0,b.offsetWidth),b._lazyRace=!0,ca++,Y(b,c,e,a,d))}},fa=C(function(){F.loadMode=3,U()}),ga=function(){3==F.loadMode&&(F.loadMode=2),fa()},ha=function(){if(!n){if(999>D.now()-c)return void H(ha,999);n=!0,F.loadMode=3,U(),i("scroll",ga,!0)}};return{_:function(){c=D.now(),r.elements=j.getElementsByClassName(F.lazyClass),a=j.getElementsByClassName(F.lazyClass+" "+F.preloadClass),i("scroll",U,!0),i("resize",U,!0),l.MutationObserver?new MutationObserver(U).observe(t,{childList:!0,subtree:!0,attributes:!0}):(t.addEventListener("DOMNodeInserted",U,!0),t.addEventListener("DOMAttrModified",U,!0),setInterval(U,999)),i("hashchange",U,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(a){j.addEventListener(a,U,!0)}),/d$|^c/.test(j.readyState)?ha():(i("load",ha),j.addEventListener("DOMContentLoaded",U),H(ha,2e4)),r.elements.length?(e(),w._lsFlush()):U()},checkElems:U,unveil:Z,_aLSL:ga}}(),u=function(){var b,c=k(function(b,c,d,a){var e,f,g;if(b._lazysizesWidth=a,a+="px",b.setAttribute("sizes",a),q.test(c.nodeName||""))for(e=c.getElementsByTagName("source"),f=0,g=e.length;g>f;f++)e[f].setAttribute("sizes",a);d.detail.dataAttr||A(b,d.detail)}),d=function(a,b,d){var e,f=a.parentNode;f&&(d=p(a,f,d),e=z(a,"lazybeforesizes",{width:d,dataAttr:!!b}),e.defaultPrevented||(d=e.detail.width)&&d!==a._lazysizesWidth&&c(a,f,e,d))},a=function(){var c,e=b.length;if(e)for(c=0;e>c;c++)d(b[c])},f=C(a);return{_:function(){b=j.getElementsByClassName(F.autosizesClass),i("resize",f)},checkElems:f,updateElem:d}}(),x=function(){!x.i&&j.getElementsByClassName&&(x.i=!0,u._(),s._())};return H(function(){F.init&&x()}),r={cfg:F,autoSizer:u,loader:s,init:x,uP:A,aC:y,rC:v,hC:g,fire:z,gW:p,rAF:w}});var i,x=document.querySelectorAll(".lazyloadimg");for(i=0;i<x.length;i++)x[i].innerHTML=x[i].innerHTML.replace("<!--","").replace("-->","");