Файловый менеджер - Редактировать - /var/www/biopower/html/wp-content/plugins/jetpack/_inc/build/likes/queuehandler.min.js
Назад
(()=>{var e=[],t=!1,i=[],n=new Promise((e=>{"loading"!==document.readyState?e():window.addEventListener("DOMContentLoaded",(()=>e()))}));function o(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((i=>{if(!(e.indexOf(i.id)>-1)&&c(i)){e.push(i.id);var n,o=/like-(post|comment)-wrapper-(\d+)-(\d+)-(\w+)/.exec(i.id);o&&5===o.length&&(n={blog_id:o[2],width:i.width},"post"===o[1]?n.post_id=o[3]:"comment"===o[1]&&(n.comment_id=o[3]),n.obj_id=o[4],t.push(n))}})),t.length>0&&o({event:"initialBatch",requests:t},window.frames["likes-master"])}function l(){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 a(){var e;if(t){!function(){for(let e=i.length-1;e>=0;e--){const t=i[e];if(!c(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"),n.querySelectorAll(".comment-likes-widget-placeholder").forEach((e=>e.style.display="block")),i.splice(e,1),t.remove()}}}();var n=[...document.querySelectorAll("div.jetpack-likes-widget-unloaded")].filter((e=>c(e)));n.length>0&&s();for(var o=0,l=n.length;o<=l-1;o++)(e=n[o].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 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=>{o({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+2e3>=0&&i<=window.innerHeight+2e3}window.addEventListener("message",(function(e){let i=e&&e.data;if("string"==typeof i)try{i=JSON.parse(i)}catch(e){return}const a=i&&i.type,r=i&&i.data;if("likesMessage"!==a||void 0===r.event)return;if("https://widgets.wp.com"===e.origin)switch(r.event){case"masterReady":n.then((()=>{t=!0;const e={event:"injectStyles"},i=document.querySelector(".sd-text-color"),n=document.querySelector(".sd-link-color"),l=i&&getComputedStyle(i)||{},a=n&&getComputedStyle(n)||{};document.body.classList.contains("single")&&o({event:"reblogsEnabled"},window.frames["likes-master"]),e.textStyles={color:l.color,fontFamily:l["font-family"],fontSize:l["font-size"],direction:l.direction,fontWeight:l["font-weight"],fontStyle:l["font-style"],textDecoration:l["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"]},o(e,window.frames["likes-master"]),s()}));break;case"showLikeWidget":{const e=document.querySelector(`#${r.id} .likes-widget-placeholder`);e&&(e.style.display="none");break}case"showCommentLikeWidget":{const e=document.querySelector(`#${r.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(r.obj_id);break;case"hideOtherGravatars":l();break;case"showOtherGravatars":{const e=document.querySelector("#likes-other-gravatars");if(!e)break;const t=e.classList.contains("wpl-new-layout"),i=e.querySelector("ul");e.style.display="none",i.innerHTML="",t?e.querySelectorAll(".likes-text span").forEach((e=>e.textContent=r.totalLikesLabel)):e.querySelectorAll(".likes-text span").forEach((e=>e.textContent=r.total)),(r.likers||[]).forEach((async(e,n)=>{if("http"!==e.profile_URL.substr(0,4))return;const s=document.createElement("li");i.append(s),s.innerHTML=t?`\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: 28px; height: 28px;" />\n\t\t\t\t\t\t<span></span>\n\t\t\t\t\t</a>\n\t\t\t\t`:`\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`,s.classList.add(e.css_class),s.querySelector("img").alt=r.avatarAltTitle.replace("%s",e.name),t&&(s.querySelector("span").innerText=e.name),n===r.likers.length-1&&s.addEventListener("keydown",(e=>{"Tab"!==e.key||e.shiftKey||(e.preventDefault(),l(),o({event:"focusLikesCount",parent:r.parent},window.frames["likes-master"]))}))}));const n=function(){const n="rtl"===getComputedStyle(e).direction,o=document.querySelector(`*[name='${r.parent}']`),s=o.getBoundingClientRect(),l=o.ownerDocument.defaultView,a=s.top+l.pageYOffset,c=s.left+l.pageXOffset;let d=0;if(t){if(e.style.top=a+r.position.top-1+"px",n){const t=r&&r.likers?Math.min(r.likers.length,5):0;d=c+r.position.left+24*t+4,e.style.transform="translateX(-100%)"}else d=c+r.position.left;e.style.left=d+"px"}else e.style.left=c+r.position.left-10+"px",e.style.top=a+r.position.top-33+"px";const f=r.width-20,p=Math.floor(f/37);let m=37*Math.ceil(r.likers.length/p)+17+22;if(m>204&&(m=204),!t){const t=37*p+13;e.style.height=m+"px",e.style.width=t+"px";const n=37*p;i.style.width=n+"px"}if(t){e.style.left="-9999px",e.style.display="block";const t=e.offsetWidth;d+t>l.innerWidth&&(d=s.right-t),e.style.left=d+"px"}else e.style.display="block";e.setAttribute("aria-hidden","false")};n(),e.focus();const s=function(e,t){var i;return function(){var n=this,o=arguments;clearTimeout(i),i=setTimeout((function(){e.apply(n,o)}),t)}},a=s(n,100);e.__resizeHandler=a,window.addEventListener("resize",a),e.focus()}}})),document.addEventListener("click",l);var d,f,p,m=(d=250,f=a,function(){clearTimeout(p),p=setTimeout(f,d)});a(),window.addEventListener("scroll",m,!0)})();
| ver. 1.4 |
Github
|
.
| PHP 7.4.3-4ubuntu2.24 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка