User:Nx/Scripts/Botwarn.js
Jump to navigation
Jump to search
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
if (typeof nx_bw_strict == 'undefined') nx_bw_strict = false;
function Botwarn()
{
var textbox = document.getElementById('wpTextbox1');
if (!textbox) { return false; }
if (wgUserGroups != null && wgUserGroups.indexOf("bot") != -1 )
{
if (wgPageName.indexOf("talk:") != -1 || (nx_bw_strict && wgPageName.substring(0,5+wgUserName.length) != "User:" + wgUserName))
{
var warn = document.createElement("span");
var prev = document.getElementById("wikiPreview");
warn.innerHTML = "<font style='font-size:200%;'>You are a bot!</font>";
if (prev)
{
prev.parentNode.insertBefore(warn,prev);
}
}
}
}
addOnloadHook(Botwarn);