Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
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.
// Forked from [[User:Amorymeltzer/crathighlighter]]//<nowiki>functioncreateEmojiElement(char,title){constemoji=document.createElement("span");emoji.textContent=char;emoji.setAttribute("title",title);emoji.style.marginLeft="1px";returnemoji;}(function($,mw){letacData={};letcrData={};letosData={};letcuData={};letsyData={};letswData={};$.when($.getJSON(mw.config.get("wgScriptPath")+"/index.php?action=raw&ctype=application/json&title=User:AmoryBot/crathighlighter.js/arbcom.json",function(data){acData=data;}),$.getJSON(mw.config.get("wgScriptPath")+"/index.php?action=raw&ctype=application/json&title=User:AmoryBot/crathighlighter.js/oversight.json",function(data){osData=data;}),$.getJSON(mw.config.get("wgScriptPath")+"/index.php?action=raw&ctype=application/json&title=User:AmoryBot/crathighlighter.js/checkuser.json",function(data){cuData=data;}),$.getJSON(mw.config.get("wgScriptPath")+"/index.php?action=raw&ctype=application/json&title=User:NovemBot/userlist.js",function(data){crData=data.bureaucrat;swData=data.steward;syData=data.sysop;})).then(function(){ADMINHIGHLIGHT_EXTLINKS=window.ADMINHIGHLIGHT_EXTLINKS||false;ADMINHIGHLIGHT_NAMESPACES=[2,3];mw.loader.using(["mediawiki.util","mediawiki.Uri","mediawiki.Title"],function(){$("#mw-content-text a").each(function(_index,link){try{consturl=link.getAttribute("href");if(!url||url.charAt(0)==="#"){return;// Skip <a> elements that aren't actually links; skip anchors}if(url.lastIndexOf("http://",0)!==0&&url.lastIndexOf("https://",0)!==0&&url.lastIndexOf("/",0)!==0){return;//require http(s) links, avoid "javascript:..." etc. which mw.Uri does not support}if(link.parentElement.className&&link.parentElement.classList[0]=="autocomment"){return;// Skip span.autocomment links aka automatic section links in edit summaries}if(link.id.indexOf("sectiontitlecopy")!==-1){return;// avoid conflict with User:SoledadKabocha/copySectionLink.js}if(link.className&&link.classList[0]=="external"){return;// Avoid errors on hard-to-parse external links}consturi=newmw.Uri(url);if(!ADMINHIGHLIGHT_EXTLINKS&&!$.isEmptyObject(uri.query))return;// Skip links with query strings if highlighting external links is disabledif(uri.host=="en.wikipedia.org"){constmwtitle=newmw.Title(mw.util.getParamValue("title",url)||decodeURIComponent(uri.path.slice(6)));// Try to get the title parameter of URL; if not available, remove '/wiki/' and use thatif($.inArray(mwtitle.getNamespaceId(),ADMINHIGHLIGHT_NAMESPACES)>=0){letuser=mwtitle.getMain().replace(/_/g," ");if(user.includes("/")){// not a top-level user or user talk pagereturn;}constrolesContainer=document.createElement("sup");if(syData[user]==1){constadmin=createEmojiElement("🧹","Admin");rolesContainer.appendChild(admin);}if(acData[user]==1){constarbcom=createEmojiElement("⚖️","ArbCom");rolesContainer.appendChild(arbcom);}if(crData[user]==1){constbureaucrat=createEmojiElement("🔧","Bureaucrat");rolesContainer.appendChild(bureaucrat);}if(cuData[user]==1){constcheckuser=createEmojiElement("❓","Checkuser");rolesContainer.appendChild(checkuser);}if(osData[user]==1){constoversighter=createEmojiElement("👁️","Oversighter");rolesContainer.appendChild(oversighter);}if(swData[user]==1){conststeward=createEmojiElement("🌐","Steward");rolesContainer.appendChild(steward);}rolesContainer.style.fontSize="0.9em";// append constructed span to user linklink.parentNode.insertBefore(rolesContainer,link.nextSibling);}}}catch(e){console.log(link);// Sometimes we will run into unparsable links, so just log these and move onwindow.console&&console.error("Admin tagger recoverable error",e.message);}});});});})(jQuery,mediaWiki);//</nowiki>