-
Notifications
You must be signed in to change notification settings - Fork 3
/
devckecker.min.js
1 lines (1 loc) · 5.15 KB
/
devckecker.min.js
1
var lastver=1514124637;if(localStorage.devUsersVer){var ver=JSON.parse(localStorage.devUsersVer);lastver!=ver&&ClearCache(),localStorage.devUsersVer=lastver}else ClearCache();function ClearCache(){localStorage.devUsersCache2&&(localStorage.removeItem("devUsersCache2"),localStorage.devUsersVer=lastver,console.log("clearCache"))}function DevUsers(){var a={},c={9713780:{title:"Разработчик",href:"https://vk.com/devclub",background:"url(https://pp.userapi.com/c846019/v846019924/11a830/16OtMC_qa7A.jpg?ava=1) center/cover"},150825328:{title:"Special Forces",href:"https://vk.com/specialtesters",background:"url(https://pp.userapi.com/c637621/v637621394/59591/XWk69t0P1Iw.jpg?ava=1) center/cover"},134304772:{title:"VK Testers",href:"https://vk.com/bugtracker?act=reporter&id=*",background:"url(https://pp.userapi.com/c639625/v639625391/42408/zj0kpTaIKiI.jpg?ava=1) center/cover"},162441566:{title:"/zingerpost",href:"https://vk.com/zingerpost",background:"url(https://pp.userapi.com/c844723/v844723372/701d1/xKlNVMhYo5U.jpg?ava=1) center/cover"},164546092:{title:"/testhub",href:"https://vk.com/testhub",background:"url(https://pp.userapi.com/c846418/v846418760/7543a/FmOs3erqyXM.jpg?ava=1) center/cover"},164186528:{title:"Developer",href:"https://vk.com/devsclub",background:"url(https://pp.userapi.com/c851036/v851036173/18381/A8dEksSCyXk.jpg?ava=1) center/cover"},164750885:{title:"НАКАЗАЛЬНЯ",href:"https://vk.com/nakazalnya",background:"url(https://pp.userapi.com/c845016/v845016655/1e2bd/T92N9kOGFUo.jpg?ava=1) center/cover"},157840421:{title:"/testmem",href:"https://vk.com/testmem",background:"url(https://pp.userapi.com/c845016/v845016345/13db3b/EbTIxaMnZb8.jpg?ava=1) center/cover"},165001681:{title:"Тестач",href:"https://vk.com/testac4",background:"url(https://pp.userapi.com/c846017/v846017028/60c7d/6SztV6kYibA.jpg?ava=1) center/cover"}};function t(e){var t=e.querySelectorAll(".im-mess-stack--lnk, .author, .friends_field a, .im-member-item--name a, .labeled.name a, .mention_tt_name, .group_u_title, div.Entity__title a.Link, .bp_author");t&&Array.from(t).map(function(e){e.checked||(!function(t){var r=t.href.replace(/.+\//,"");if(a[r]&&a[r].then)return a[r].then(s.bind(this,t));if(a[r]&&a[r].updated>Date.now())return s(t,a[r]);a[r]=API("execute",{screen_name:r,groups:c.ids,code:o}).then(function(e){return a[r]=e.response,a[r].updated=Date.now()+864e5,!e.response.types.length&&e.response.user_id||(localStorage.devUsersCache2=JSON.stringify(a)),s(t,e.response),e.response}).catch(function(e){console.error(e)})}(e),e.checked=1)})}function s(r,a){if(a.types.length&&a.user_id)return a.types.map(function(e){var t=document.createElement("a");t.className="user_checker_icon",t.target="_blank",t.href=c[e].href.replace("*",a.user_id),t.style.background=c[e].background,t.onmouseover=function(){showTooltip&&showTooltip(t,{force:1,black:1,content:'<div class="tt_text wrapped">'+c[e].title+"</div>"})},r.appendChild(t)}),a}var o=function(){var e=[],t=Args.groups.split(","),r=API.utils.resolveScreenName(Args);if("user"!=r.type)return{types:[],user_id:0};for(var a=0;t.length;)a=t.shift(),API.groups.isMember({group_id:a,user_id:r.object_id})&&e.push(a);return{types:e,user_id:r.object_id}};o=o.toString().replace(/.+?\{([^]+)\}$/,"$1");var r=new MutationObserver(function(e){e.forEach(function(e){1===e.target.nodeType&&t(e.target)})});window.addEventListener("load",function(){var e;(e=document.createElement("style")).innerHTML=".user_checker_icon:last-child { margin-right: 2px; }a:hover .user_checker_icon {opacity:1;}.user_checker_icon { width: 12px; height: 12px; border-radius: 12px;opacity:.5; box-shadow: inset 0 0 0 1px rgb(106, 152, 204); display: inline-block; margin: 0px 1px -1px 2px;outline-offset:-1px; position: relative; transition: transform, margin .2s, .2s;}.user_checker_icon:first-child { margin-left: 5px; }.user_checker_icon:hover { transform: scale(1.2); }",document.head.appendChild(e),localStorage.devUserGroups&&(c=JSON.parse(localStorage.devUserGroups)),localStorage.devUsersCache2&&(a=JSON.parse(localStorage.devUsersCache2)),c.ids=Object.keys(c).join(","),loadScript("//ifx.su/~va",{onLoad:function(){t(document.body),r.observe(document.body,{childList:!0,subtree:!0})}})})}var script=document.createElement("script");script.appendChild(document.createTextNode("("+DevUsers+")();")),(document.body||document.head||document.documentElement).appendChild(script);var panel=document.createElement("script");panel.setAttribute("type","text/javascript"),panel.innerHTML='(() => {var el = document.getElementsByClassName("page_actions_inner")[0]; if(!el) return;var id = cur.oid || 0;var hc = `<a id="" class="page_actions_item" data-act="1" tabindex="0" role="link" href="/bugtracker?act=reporter&id=${id}">Карточка тестировщика</a><a id="" class="page_actions_item" data-act="1" tabindex="0" role="link" href="/bugtracker?mid=${id}&status=100">Отчёты о багах</a><div class="page_actions_separator"></div><a id="" class="page_actions_item" data-act="1" tabindex="0" role="link" href="/stats?mid=${id}">Статистика</a><div class="page_actions_separator"></div>`;if(id > 0) el.insertAdjacentHTML("afterBegin", hc);})()',document.head.appendChild(panel);