PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
← All changes | _inc/build/likes/queuehandler.min.js +1 -1 12.7.316.3-a.1 View file →
@@ -1 +1 @@
1 -!function(){var e=[],t=!1,o=2e3,i=[],n=new Promise((e=>{"loading"!==document.readyState?e():window.addEventListener("DOMContentLoaded",(()=>e()))}));function l(e,t){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return}if(t&&"function"==typeof t.postMessage)try{t.postMessage(JSON.stringify({type:"likesMessage",data:e}),"*")}catch(e){return}}function s(){const t=[];document.querySelectorAll("div.jetpack-likes-widget-unloaded").forEach((o=>{if(!(e.indexOf(o.id)>-1)&&c(o)){e.push(o.id);var i,n=/like-(post|comment)-wrapper-(\d+)-(\d+)-(\w+)/.exec(o.id);n&&5===n.length&&(i={blog_id:n[2],width:o.width},"post"===n[1]?i.post_id=n[3]:"comment"===n[1]&&(i.comment_id=n[3]),i.obj_id=n[4],t.push(i))}})),t.length>0&&l({event:"initialBatch",requests:t},window.frames["likes-master"])}function a(){var e;if(t){!function(){for(let e=i.length-1;e>=0;e--){const t=i[e];if(!c(t)){const o=t&&t.parentElement&&t.parentElement.parentElement;o.classList.remove("jetpack-likes-widget-loaded"),o.classList.remove("jetpack-likes-widget-loading"),o.classList.add("jetpack-likes-widget-unloaded"),o.querySelectorAll(".comment-likes-widget-placeholder").forEach((e=>e.style.display="block")),i.splice(e,1),t.remove()}}}();var o=[...document.querySelectorAll("div.jetpack-likes-widget-unloaded")].filter((e=>c(e)));o.length>0&&s();for(var n=0,l=o.length;n<=l-1;n++)(e=o[n].id)&&r(e)}else setTimeout(a,500)}function r(e){if(void 0===e)return;const t=document.querySelector("#"+e);t.querySelectorAll("iframe").forEach((e=>e.remove()));const o=t.querySelector(".likes-widget-placeholder");if(o&&o.classList.contains("post-likes-widget-placeholder")){const e=document.createElement("iframe");e.classList.add("post-likes-widget","jetpack-likes-widget"),e.name=t.dataset.name,e.src=t.dataset.src,e.height="55px",e.width="100%",e.frameBorder="0",e.scrolling="no",e.title=t.dataset.title,o.after(e)}if(o.classList.contains("comment-likes-widget-placeholder")){const e=document.createElement("iframe");e.class="comment-likes-widget-frame jetpack-likes-widget-frame",e.name=t.dataset.name,e.src=t.dataset.src,e.height="18px",e.width="100%",e.frameBorder="0",e.scrolling="no",t.querySelector(".comment-like-feedback").after(e),i.push(e)}t.classList.remove("jetpack-likes-widget-unloaded"),t.classList.add("jetpack-likes-widget-loading"),t.querySelector("iframe").addEventListener("load",(e=>{l({event:"loadLikeWidget",name:e.target.name,width:e.target.width},window.frames["likes-master"]),t.classList.remove("jetpack-likes-widget-loading"),t.classList.add("jetpack-likes-widget-loaded")}))}function c(e){const t=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;return t+o>=0&&i<=window.innerHeight+o}window.addEventListener("message",(function(e){let o=e&&e.data;if("string"==typeof o)try{o=JSON.parse(o)}catch(e){return}const i=o&&o.type,a=o&&o.data;if("likesMessage"!==i||void 0===a.event)return;if("https://widgets.wp.com"===e.origin)switch(a.event){case"masterReady":n.then((()=>{t=!0;const e={event:"injectStyles"},o=document.querySelector(".sd-text-color"),i=document.querySelector(".sd-link-color"),n=o&&getComputedStyle(o)||{},a=i&&getComputedStyle(i)||{};if(document.querySelectorAll("iframe.admin-bar-likes-widget").length>0){l({event:"adminBarEnabled"},window.frames["likes-master"]);const t=document.querySelector("#wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a"),o=document.querySelector("#wpadminbar");e.adminBarStyles={background:t&&getComputedStyle(t).background,isRtl:o&&"rtl"===getComputedStyle(o).direction}}document.body.classList.contains("single")&&l({event:"reblogsEnabled"},window.frames["likes-master"]),e.textStyles={color:n.color,fontFamily:n["font-family"],fontSize:n["font-size"],direction:n.direction,fontWeight:n["font-weight"],fontStyle:n["font-style"],textDecoration:n["text-decoration"]},e.linkStyles={color:a.color,fontFamily:a["font-family"],fontSize:a["font-size"],textDecoration:a["text-decoration"],fontWeight:a["font-weight"],fontStyle:a["font-style"]},l(e,window.frames["likes-master"]),s()}));break;case"showLikeWidget":{const e=document.querySelector(`#${a.id} .likes-widget-placeholder`);e&&(e.style.display="none");break}case"showCommentLikeWidget":{const e=document.querySelector(`#${a.id} .likes-widget-placeholder`);e&&(e.style.display="none");break}case"killCommentLikes":document.querySelectorAll(".jetpack-comment-likes-widget-wrapper").forEach((e=>e.remove()));break;case"clickReblogFlair":wpcom_reblog&&"function"==typeof wpcom_reblog.toggle_reblog_box_flair&&wpcom_reblog.toggle_reblog_box_flair(a.obj_id);break;case"showOtherGravatars":{const e=document.querySelector("#likes-other-gravatars");if(!e)break;const t=e.querySelector("ul");e.style.display="none",t.innerHTML="",e.querySelectorAll(".likes-text span").forEach((e=>e.textContent=a.total)),(a.likers||[]).forEach((e=>{if("http"!==e.profile_URL.substr(0,4))return;const o=document.createElement("li");o.innerHTML=`\n\t\t\t\t\t<a href="${encodeURI(e.profile_URL)}" rel="nofollow" target="_parent" class="wpl-liker">\n\t\t\t\t\t\t<img src="${encodeURI(e.avatar_URL)}"\n\t\t\t\t\t\t\talt=""\n\t\t\t\t\t\t\tstyle="width: 30px; height: 30px; padding-right: 3px;" />\n\t\t\t\t\t</a>\n\t\t\t\t`,t.append(o),o.classList.add(e.css_class),o.querySelector("img").alt=e.name}));const o=document.querySelector(`*[name='${a.parent}']`),i=o.getBoundingClientRect(),n=o.ownerDocument.defaultView,l={top:i.top+n.pageYOffset,left:i.left+n.pageXOffset};e.style.left=l.left+a.position.left-10+"px",e.style.top=l.top+a.position.top-33+"px";const s=Math.floor(a.width/37);let r=37*Math.ceil(a.likers.length/s)+13;r>204&&(r=204);const c=37*s-7;e.style.height=r+"px",e.style.width=c+"px";const d=37*s;t.style.width=d+"px",e.style.display="block";const m=t.offsetWidth-t.clientWidth;m>0&&(e.style.width=c+m+"px",t.style.width=d+m+"px")}}})),document.addEventListener("click",(e=>{const t=document.querySelector("#likes-other-gravatars");t&&!t.contains(e.target)&&(t.style.display="none")}));var d,m,p,f=(d=250,m=a,function(){clearTimeout(p),p=setTimeout(m,d)});a(),window.addEventListener("scroll",f,!0)}();
1 +(()=>{var e=[],t=!1,n=2e3,i=[],o=new Promise(e=>{"loading"!==document.readyState?e():window.addEventListener("DOMContentLoaded",()=>e())});function s(e,t){if("string"==typeof e)try{e=JSON.parse(e)}catch{return}if(t&&"function"==typeof t.postMessage)try{t.postMessage(JSON.stringify({type:"likesMessage",data:e}),"*")}catch{}}function r(){const t=[];document.querySelectorAll("div.jetpack-likes-widget-unloaded").forEach(n=>{if(!(e.indexOf(n.id)>-1)&&d(n)){e.push(n.id);var i,o=/like-(post|comment)-wrapper-(\d+)-(\d+)-(\w+)/.exec(n.id);o&&5===o.length&&(i={blog_id:o[2],width:n.width},"post"===o[1]?i.post_id=o[3]:"comment"===o[1]&&(i.comment_id=o[3]),i.obj_id=o[4],t.push(i))}}),t.length>0&&s({event:"initialBatch",requests:t},window.frames["likes-master"])}function a(){const e=document.querySelector("#likes-other-gravatars");if(e){e.style.display="none",e.setAttribute("aria-hidden","true");const t=e.__resizeHandler;t&&(window.removeEventListener("resize",t),delete e.__resizeHandler)}}function l(){var e;if(!t)return s({event:"queryMasterReady"},window.frames["likes-master"]),void setTimeout(l,500);!function(){for(let e=i.length-1;e>=0;e--){const t=i[e];if(!d(t)){const n=t&&t.parentElement&&t.parentElement.parentElement;n.classList.remove("jetpack-likes-widget-loaded"),n.classList.remove("jetpack-likes-widget-loading"),n.classList.add("jetpack-likes-widget-unloaded");const o=n.querySelector(".likes-widget-placeholder");o&&(o.style.display=""),i.splice(e,1),t.remove()}}}(),function(){if(!g)return;document.querySelectorAll("div.jetpack-likes-widget-unloaded").forEach(e=>g.observe(e))}();var n=[...document.querySelectorAll("div.jetpack-likes-widget-unloaded")].filter(e=>d(e));n.length>0&&r();for(var o=0,a=n.length;o<=a-1;o++)(e=n[o].id)&&c(e)}function c(e){if(void 0===e)return;const t=document.querySelector("#"+e);t.querySelectorAll("iframe").forEach(e=>e.remove());const n=t.querySelector(".likes-widget-placeholder");if(n&&n.classList.contains("post-likes-widget-placeholder")){const e=document.createElement("iframe");e.classList.add("post-likes-widget","jetpack-likes-widget"),e.name=t.dataset.name,e.src=t.dataset.src,e.height="55px",e.width="100%",e.frameBorder="0",e.scrolling="no",e.title=t.dataset.title,n.after(e)}if(n.classList.contains("comment-likes-widget-placeholder")){const e=document.createElement("iframe");e.class="comment-likes-widget-frame jetpack-likes-widget-frame",e.name=t.dataset.name,e.src=t.dataset.src,e.height="18px",e.width="100%",e.frameBorder="0",e.scrolling="no",t.querySelector(".comment-like-feedback").after(e),i.push(e)}t.classList.remove("jetpack-likes-widget-unloaded"),t.classList.add("jetpack-likes-widget-loading"),t.querySelector("iframe").addEventListener("load",e=>{t.contains(e.target)&&(s({event:"loadLikeWidget",name:e.target.name,width:e.target.width},window.frames["likes-master"]),n&&(n.style.display="none"),t.classList.remove("jetpack-likes-widget-loading"),t.classList.add("jetpack-likes-widget-loaded"))})}function d(e){const t=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;return t+n>=0&&i<=window.innerHeight+n}window.addEventListener("message",function(e){let n=e&&e.data;if("string"==typeof n)try{n=JSON.parse(n)}catch{return}const i=n&&n.type,l=n&&n.data;if("likesMessage"!==i||void 0===l.event)return;if("https://widgets.wp.com"===e.origin)switch(l.event){case"masterReady":o.then(()=>{t=!0;const e={event:"injectStyles"},n=document.querySelector(".sd-text-color"),i=document.querySelector(".sd-link-color"),o=n&&getComputedStyle(n)||{},a=i&&getComputedStyle(i)||{};document.body.classList.contains("single")&&s({event:"reblogsEnabled"},window.frames["likes-master"]),e.textStyles={color:o.color,fontFamily:o["font-family"],fontSize:o["font-size"],direction:o.direction,fontWeight:o["font-weight"],fontStyle:o["font-style"],textDecoration:o["text-decoration"]},e.linkStyles={color:a.color,fontFamily:a["font-family"],fontSize:a["font-size"],textDecoration:a["text-decoration"],fontWeight:a["font-weight"],fontStyle:a["font-style"]},s(e,window.frames["likes-master"]),r()});break;case"showLikeWidget":case"showCommentLikeWidget":break;case"killCommentLikes":document.querySelectorAll(".jetpack-comment-likes-widget-wrapper").forEach(e=>e.remove());break;case"clickReblogFlair":wpcom_reblog&&"function"==typeof wpcom_reblog.toggle_reblog_box_flair&&wpcom_reblog.toggle_reblog_box_flair(l.obj_id);break;case"hideOtherGravatars":a();break;case"showOtherGravatars":{const e=document.querySelector("#likes-other-gravatars");if(!e)break;const t=e.querySelector("ul");e.style.display="none",t.innerHTML="",e.querySelectorAll(".likes-text span").forEach(e=>e.textContent=l.totalLikesLabel),(l.likers||[]).forEach(async(e,n)=>{if("http"!==e.profile_URL.substr(0,4))return;const i=document.createElement("li");t.append(i);const o=encodeURI(e.profile_URL),r=encodeURI(e.avatar_URL);i.innerHTML=`<a href="${o}" rel="nofollow" target="_parent" class="wpl-liker">\n\t\t\t\t\t\t<img src="${r}"\n\t\t\t\t\t\t\talt=""\n\t\t\t\t\t\t\tstyle="width: 28px; height: 28px;" />\n\t\t\t\t\t\t<span></span>\n\t\t\t\t\t</a>`,i.classList.add(e.css_class),i.querySelector("img").alt=l.avatarAltTitle.replace("%s",e.name),i.querySelector("span").innerText=e.name,n===l.likers.length-1&&i.addEventListener("keydown",e=>{"Tab"!==e.key||e.shiftKey||(e.preventDefault(),a(),s({event:"focusLikesCount",parent:l.parent},window.frames["likes-master"]))})});const n=function(){const t="rtl"===getComputedStyle(e).direction,n=document.querySelector(`*[name='${l.parent}']`),i=n.getBoundingClientRect(),o=n.ownerDocument.defaultView,s=i.top+o.pageYOffset,r=i.left+o.pageXOffset;let a;if(e.style.top=s+l.position.top-1+"px",t){const t=l&&l.likers?Math.min(l.likers.length,5):0;a=r+l.position.left+24*t+4,e.style.transform="translateX(-100%)"}else a=r+l.position.left;e.style.left=a+"px",e.style.left="-9999px",e.style.display="block";const c=e.offsetWidth;a+c>o.innerWidth&&(a=i.right-c),e.style.left=a+"px",e.setAttribute("aria-hidden","false")};n(),e.focus();const i=function(e,t){var n;return function(){var i=this,o=arguments;clearTimeout(n),n=setTimeout(function(){e.apply(i,o)},t)}},o=i(n,100);e.__resizeHandler=o,window.addEventListener("resize",o),e.focus()}}}),document.addEventListener("click",a);var f,m,u,p=(f=250,m=l,function(){clearTimeout(u),u=setTimeout(m,f)}),g="function"==typeof IntersectionObserver?new IntersectionObserver(p,{rootMargin:"2000px",threshold:[0,1]}):null;l(),window.addEventListener("scroll",p,!0)})();