User:Dbeef/cplus.js

This is an old revision of this page, as edited by DeadbeefBot II (talk | contribs) at 06:43, 11 June 2025 ([BOT] fee1-dead: use orig message when deploying (https://github.com/fee1-dead/cplus/compare/fb9816fe1c95...d447f3583ba5)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// {{Wikipedia:USync |repo=https://github.com/fee1-dead/cplus |ref=refs/heads/production |path=main.js}}
// A helper for Special:CheckUser.
$.when($.ready).then(function(){if(mw.config.get("wgPageName")!=="Special:CheckUser")return;$(".mw-checkuser-helper-table").children("tbody").children("tr").children("td").children("a.mw-userlink").each((i,t)=>{let e=document.createElement("input");e.type="checkbox",e.value=t.firstElementChild?.innerHTML??"",e.classList+="cplus-users",t.before(e)}),$(".mw-checkuser-helper-copy-text-layout").children("div").children("div").children("span").children("span").children("a.oo-ui-buttonElement-button").each((i,t)=>{let e=document.createElement("button");e.innerText="Copy socklist",e.addEventListener("click",()=>{let n=[];$(".cplus-users").each((u,r)=>{let c=r;if(c.checked)n.push(c.value)});let l="{{sock list|"+n.join("|")+"}}";window.navigator.clipboard.writeText(l)}),t.after(e)})});