User:Following specific instructions whispered by a mysterious cat/monobook.js
Appearance
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. |
![]() | The accompanying .css page for this skin can be added at User:Following specific instructions whispered by a mysterious cat/monobook.css. |
//<pre><nowiki>
// See [[User:Quarl/monobook]] for a marked-up version of this page.
//
function winc(s) {
s = s.replace(/^\[\[/, '').replace(/\]\]$/, '');
document.write('<scr'+'ipt type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=' + s
+ '&action=raw&ctype=text/javascript&dontcountme=s"></scr'+'ipt>');
}
function cssinc(s) {
s = s.replace(/^\[\[/, '').replace(/\]\]$/, '');
document.write('<sty'+'le type="text/css">' +
'@import "/w/index.php?title=' + s + '&action=raw&ctype=text/css&dontcountme=s";</style>');
}
// == Utility library ==
winc('[[User:Quarl/wistk.js]]'); // Dependencies
winc('[[User:Quarl/util.js]]'); // Utility functions
winc('[[User:Quarl/md5.js]]'); // md5 functions
winc('[[User:Quarl/wikitabs.js]]'); // functions for adding tabs, etc. (by Quarl)
cssinc('[[User:Quarl/wikitabs.css]]'); // styles required by wikitabs.js
winc('[[User:That Guy, From That Show!/wikipage.js]]'); // WikiPage class (by Quarl)
winc('[[User:Quarl/datetime.js]]'); // defines ISO timestamp functions (by Quarl)
winc('[[User:Quarl/wikipageAfd.js]]'); // AFD stuff for WikiPage (by Quarl)
winc('[[User:Quarl/wikiedit.js]]'); // WikiEditor (by Quarl)
winc('[[User:Quarl/wikistate.js]]'); // Persist state throughout session (by Quarl)
winc('[[User:Quarl/autoreplace.js]]'); // allows automatically replacing strings on 'submit' (by Quarl)
winc('[[User:Quarl/automod.js]]'); // defines functions for automatically modifying page (originally by Jnothman, version by Quarl)
winc('[[User:Quarl/diff.js]]'); // diff functions (by Quarl, diff() by John Resig)
winc('[[User:Quarl/cookie.js]]'); // cookie helpers
winc('[[User:Quarl/shortcuts.js]]'); // Shortcuts class (by Quarl)
winc('[[User:Quarl/diffsince.js]]'); // utilities for doing "diff since" (by Quarl)
winc('[[User:Quarl/wikiwatch.js]]'); // utilities for watching/unwatching (by Quarl)
winc('[[User:Quarl/autoedit.js]]'); // auto-editing class (by Quarl)
// == Modules ==
// winc('[[User:That Guy, From That Show!/advanced_sig.js]]'); // advanced custom signatures (by Quarl)
winc('[[User:Quarl/popups.js]]'); // Popups (by Lupin, small modifications)
// winc('[[User:Quarl/rollback.js]]'); // rollback button (based on Sam Hocavar's Godmode-Light, version by Quarl)
winc('[[User:Quarl/autoafd.js]]'); // autoafd (version by Quarl)
winc('[[User:Quarl/afd_vote.js]]'); // AFD voting helpers (originally by Jnothman, version by Quarl)
winc('[[User:Quarl/autotag.js]]'); // tab button for auto tagging (by Quarl)
winc('[[User:Quarl/copyvio.js]]'); // mark as copyvio and list on log page (by Quarl)
winc('[[User:Quarl/edit_top_link.js]]'); // add 'edit top' (section 0) link (version by Quarl)
winc('[[User:Quarl/show_diff_last.js]]'); // show last diff; 'last' tab button (version by Quarl)
winc('[[User:Quarl/show_diff_since.js]]');// show changes since last edited (async version); 'since' tab button (by Quarl)
winc('[[User:That_Guy%2C_From_That_Show%21/auto_testn.js]]'); // tabs for test/test-n templates (version by Quarl)
winc('[[User:Quarl/hide_own.js]]'); // change Watchlist link to default to 'hide own' (by ...)
winc('[[User:Quarl/watchlist.js]]'); // add 'unwatch' and 'diff since' buttons to watchlist (by Quarl)
winc('[[User:Quarl/watchbutton.js]]'); // asynchronous watch/unwatch tabs (by Quarl)
winc('[[User:Quarl/autofocus.js]]'); // automatically focus edit boxes (by Quarl)
//winc('[[User:Quarl/autocloseafd.js]]'); // tab button for closing AFD (by Quarl)
winc('[[User:Quarl/toolbox_edit_count.js]]') // toolbox links to Interiot's edit count tool (by Quarl)
winc('[[User:Quarl/toolbox_logs.js]]'); // toolbox links to Logs (version by Quarl)
winc('[[User:Quarl/nav_afd.js]]'); // nav links to AFD log pages (by Quarl)
winc('[[User:Quarl/directredirect.js]]'); // buttons for automatically fixing double redirects (by Quarl)
winc('[[User:Quarl/location_canonicalize.js]]'); // locz button for canonicalizing locations (by Quarl)
winc('[[User:Quarl/date_canonicalize.js]]'); // datez button for canonicalizing dates (by Quarl)
winc('[[User:Quarl/coor_canonicalize.js]]'); // coorZ button for canonicalizing coordinates (by Quarl)
winc('[[User:Quarl/imdb_canonicalize.js]]'); // imdbZ button for canonicalizing IMDB links (by Quarl)
winc('[[User:Quarl/alexafy.js]]'); // toolbox button to Alexafy external links (version by Quarl)
winc('[[User:Quarl/userscript.js]]'); // user script helpers ('raw' tab, 'refresh' tab, autorefresh) by Quarl
winc('[[User:Quarl/auto_summary.js]]'); // auto summary based on diff; shortcuts (by Quarl)
winc('[[User:Quarl/smartsubmit.js]]'); // asynchronous preview/diff buttons (by Quarl)
winc('[[User:Quarl/purge.js]]'); // 'purge' tab button
winc('[[User:Quarl/newmessages.js]]'); // add history and diffsince links to new-messages box (by Quarl)
//winc('[[User:Quarl/external_editor.js]]'); // add tab for "ext edit" (by Quarl)
// == Quarl specific ==
winc('[[User:That Guy, From That Show!/nav_custom.js]]'); // navigation box customizations (by Quarl for Quarl)
winc('[[User:That Guy, From That Show!/sandbox.js]]'); // testing stuff
//wistk.depend('sandbox.js');
//qwrite_flush();
// == Settings ==
popupDelay=3.0;
popupActionsMenu=false;
// NEW SECTION
// =-=-=- HELPER FUNCTIONS -=-=-= FROM http://en.wikipedia.org/wiki/User:Voice_of_All/RC/monobook.js
// -----------------------------------------------------------------------------
// XMLHttpRequest support
// -----------------------------------------------------------------------------
if (document.implementation.createDocument)
{
var gml_xmlparser = new DOMParser();
}
function addlilink(tabs, url, name, id, title, key){
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
if(id) li.id = id;
li.appendChild(na);
tabs.appendChild(li);
if(id)
{
if(key && title)
{
ta[id] = [key, title];
}
else if(key)
{
ta[id] = [key, ''];
}
else if(title)
{
ta[id] = ['', title];
}
}
// re-render the title and accesskeys from existing code in wikibits.js
akeytt();
return li;
}
function addToolboxLink(url, name, id){
var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
addlilink(tb, url, name, id);
}
function addTab(url, name, id, title, key){
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
return addlilink(tabs, url, name, id, title, key);
}
function addLink(where, url, name, id, title, key, after){
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
if(id) li.id = id;
li.appendChild(na);
var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
if(after) {
tabs.insertBefore(li,document.getElementById(after));
} else {
tabs.appendChild(li);
}
if(id) {
if(key && title) { ta[id] = [key, title]; }
else if(key) { ta[id] = [key, '']; }
else if(title) { ta[id] = ['', title];}
}
// re-render the title and accesskeys from existing code in wikibits.js
akeytt();
return li;
}
//END HELPER
addOnloadHook(addpurgel)
//Purge tab
function addpurgel()
{
if (document.title.indexOf("Editing ") != -1)
{
return;
}
else
{
if (document.title.indexOf("Wikipedia:") != -1)
{
if (location.href.indexOf("&action=history") == -1)
{addPurge();}
}
if (document.title.indexOf("User:") != -1)
{
addPurge();
}
if (document.title.indexOf("Category:") != -1)
{
addPurge();
}
}
}
//END
// ============= Purge ==============
function addPurge()
{
ta['ca-purge'] = ['g', 'Purge the internal cache for this page'];
if(!document.getElementById) return;
var x = document.getElementById('ca-history');
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
if(!x) return;
if(x.children) x = x.children[0];
else x = x.childNodes[0];
addlilink(tabs, x.href.replace(/=history/, "=purge"), 'purge', 'ca-purge');
}
//END
//UTC clock
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/UTCclock.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END
///////////////////////////////PAGE ROLLBACK///////////////////////////////
// -----------------------------------------------------------------------------
// POV rollback
// -----------------------------------------------------------------------------
var prollbacklink = ' <strong><span style="color:black;">[</span><span style="color:darkblue;">rollback (AGF)</span><span style="color:black;">]</span> </strong></strong>';
var cantrollback = 'Cannot revert edit; last contributor is only author of this page.';
var alreadyrolled = 'Cannot rollback last edit of [[$1]] by [[User:$2|$2]] ([[User talk:$2|Talk]]); someone else has edited or rolled back the page already. Last edit was by [[User:$3|$3]] ([[User talk:$3|Talk]]). ';
//this is not used:
var preverted = "Reverted [[WP:AGF|good faith]] edits by [[Special:Contributions/$2|$2]] per policy. Please read up on [[WP:POL#Key_policies|policies and guidelines]]. Thanks!";
//
// -----------------------------------------------------------------------------
// Normal rollback
// -----------------------------------------------------------------------------
var qrollbacklink = '<span style="color:black;">[</span>rollback<span style="color:black;">]<span>';
var nrollbacklink = '<strong><span style="color:black;">[</span>rollback<span style="color:black;">]<span></strong>';
var cantrollback = 'Cannot revert edit; last contributor is only author of this page.';
var alreadyrolled = 'Cannot rollback last edit of [[$1]] by [[User:$2|$2]] ([[User talk:$2|Talk]]); someone else has edited or rolled back the page already. Last edit was by [[User:$3|$3]] ([[User talk:$3|Talk]]). ';
//this is not used:
var nreverted = 'Reverted edits by [[Special:Contributions/$2|$2]] to last version by $1';
// -----------------------------------------------------------------------------
// Vandal rollback
// -----------------------------------------------------------------------------
var rollbacklink = '<strong><span style="color:black;">[</span><span style="color:red;">rollback (vandal)</span><span style="color:black;">]</strong><br></span>';
var cantrollback = 'Cannot revert edit; last contributor is only author of this page.';
var alreadyrolled = 'Cannot rollback last edit of [[$1]] by [[User:$2|$2]] ([[User talk:$2|Talk]]); someone else has edited or rolled back the page already. Last edit was by [[User:$3|$3]] ([[User talk:$3|Talk]]). ';
//this is not used:
var revertpage = 'Reverted [[Wikipedia:Vandalism|vandalism]] by [[Special:Contributions/$2|$2]] to last version by $1. Please do not compromise the integrity of pages.';
//
//failsafe rollback method
addOnloadHook(IEhistory_revert)
function IEhistory_revert()
{
//
var cant_rollback = '<br><strong><span style="color:red;">Page rollback error:</span> Could not find a version of this page that is not by the user you attempted to rollback from.' + '<br>' + 'Most likely, the user is the only author of the page, so you may want to have the page deleted.' + '<br>' + '<span style="color:red;">Note:</span> This revert function only looks at the last 12 page edits, so you may be able look back further and use "restore".';
var not_topuser = '<strong><span style="color:red;">Page rollback error:</span> Last editor is <span style="color:blue;">' + '<<top_user>>' + '</span>, not <span style="color:blue;">' + '<<vandal>>' + '</span>. The user may have already been reverted.</strong>';
//
var body = document.getElementById('bodyContent');
if (location.href.indexOf('&action=history&limit=12&jsaction=IEnormalrevert&user=') != -1)
{
var found = 0;
var token = location.href.split('&token=')[1];
var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;
var pagename = location.href.split('title=')[1].split('&action=history')[0];
var vandal = unescape(location.href.split('&jsaction=IEnormalrevert&user=')[1].split('&token=')[0]);
//confirm token
if (token != hex_md5(pagename + vandal + user_name))
{body.innerHTML = '<strong><span style="color:red;">Page rollback error:</span> Invalid token!</strong>'; return;}
//get top user
var l = document.getElementById('pagehistory').getElementsByTagName('li');
if (l[0].innerHTML.indexOf('(cur) (last) ') ==0)
{var top_user = l[0].getElementsByTagName('a')[1].innerHTML;}
else
{var top_user = l[0].getElementsByTagName('a')[2].innerHTML;}
if (top_user != vandal)
{body.innerHTML = not_topuser; return;}
for (i = 1; i < l.length; i++)
{
if (!l[i].getElementsByTagName('a')[3])
{body.innerHTML = '<strong><span style="color:red;">Page rollback error:</span> Format cannot be parsed!</strong>'; return;}
//get user and ID names
if (l[i].innerHTML.indexOf('(cur) (last) ') !=-1)
{test_user = l[i].getElementsByTagName('a')[1].innerHTML; var pagehref = l[i].getElementsByTagName('a')[0].href;}
else if (l[i].innerHTML.indexOf(') (last) <') !=-1)
{test_user = l[i].getElementsByTagName('a')[2].innerHTML; var pagehref = l[i].getElementsByTagName('a')[1].href;}
else
{test_user = l[i].getElementsByTagName('a')[3].innerHTML; var pagehref = l[i].getElementsByTagName('a')[2].href;}
//
if (test_user != vandal)
{
var good_user = test_user;
var URL = pagehref + "&action=edit&jsaction=autorevertnorm&byuser=" + escape(user_name) + "&oldrvtouser=" + escape(good_user) + "&revertfromuser=" + escape(vandal);
body.innerHTML = '<strong>Page rollback status:<span style="color:blue;"> Getting article history ... </span>done</strong>';
location.href = URL;
found = 1;
break;
}
}
if (found == 0)
{body.innerHTML = cant_rollback.replace('<<top_user>>',top_user).replace('<<vandal>>',vandal); return;}
}
else if (location.href.indexOf('&action=history&limit=12&jsaction=IErollback&vandal=') != -1)
{
var found = 0;
var token = location.href.split('&token=')[1];
var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;
var pagename = location.href.split('title=')[1].split('&action=history')[0];
var vandal = unescape(location.href.split('&jsaction=IErollback&vandal=')[1].split('&token=')[0]);
//confirm token
if (token != hex_md5(pagename + vandal + user_name))
{body.innerHTML = '<strong><span style="color:red;">Page rollback error:</span> Invalid token!</strong>'; return;}
//get top user
var l = document.getElementById('pagehistory').getElementsByTagName('li');
if (l[0].innerHTML.indexOf('(cur) (last) ') ==0)
{var top_user = l[0].getElementsByTagName('a')[1].innerHTML;}
else
{var top_user = l[0].getElementsByTagName('a')[2].innerHTML;}
if (top_user != vandal)
{body.innerHTML = not_topuser; return;}
for (i = 1; i < l.length; i++)
{
if (!l[i].getElementsByTagName('a')[3])
{body.innerHTML = '<strong><span style="color:red;">Page rollback error:</span> Format cannot be parsed!</strong>'; return;}
//get user and ID names
if (l[i].innerHTML.indexOf('(cur) (last) ') !=-1)
{test_user = l[i].getElementsByTagName('a')[1].innerHTML; var pagehref = l[i].getElementsByTagName('a')[0].href;}
else if (l[i].innerHTML.indexOf(') (last) <') !=-1)
{test_user = l[i].getElementsByTagName('a')[2].innerHTML; var pagehref = l[i].getElementsByTagName('a')[1].href;}
else
{test_user = l[i].getElementsByTagName('a')[3].innerHTML; var pagehref = l[i].getElementsByTagName('a')[2].href;}
//
if (test_user != vandal)
{
var good_user = test_user;
var URL = pagehref + "&action=edit&jsaction=autorevertvandal&byuser=" + escape(user_name) + "&oldrvtouser=" + escape(good_user) + "&revertfromuser=" + escape(vandal);
body.innerHTML = '<strong>Page rollback status:<span style="color:blue;"> Getting article history ... </span>done</strong>';
location.href = URL;
found = 1;
break;
}
}
if (found == 0)
{body.innerHTML = cant_rollback.replace('<<top_user>>',top_user).replace('<<vandal>>',vandal); return;}
}
else if (location.href.indexOf('&action=history&limit=12&jsaction=IEnicerevert&user=') != -1)
{
var found = 0;
var token = location.href.split('&token=')[1];
var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;
var pagename = location.href.split('title=')[1].split('&action=history')[0];
var vandal = unescape(location.href.split('&jsaction=IEnicerevert&user=')[1].split('&token=')[0]);
//confirm token
if (token != hex_md5(pagename + vandal + user_name))
{body.innerHTML = '<strong><span style="color:red;">Page rollback error:</span> Invalid token!</strong>'; return;}
//get top user
var l = document.getElementById('pagehistory').getElementsByTagName('li');
if (l[0].innerHTML.indexOf('(cur) (last) ') ==0)
{var top_user = l[0].getElementsByTagName('a')[1].innerHTML;}
else
{var top_user = l[0].getElementsByTagName('a')[2].innerHTML;}
if (top_user != vandal)
{body.innerHTML = not_topuser; return;}
for (i = 1; i < l.length; i++)
{
if (!l[i].getElementsByTagName('a')[3])
{body.innerHTML = '<strong><span style="color:red;">Page rollback error:</span> Format cannot be parsed!</strong>'; return;}
//get user and ID names
if (l[i].innerHTML.indexOf('(cur) (last) ') !=-1)
{test_user = l[i].getElementsByTagName('a')[1].innerHTML; var pagehref = l[i].getElementsByTagName('a')[0].href;}
else if (l[i].innerHTML.indexOf(') (last) <') !=-1)
{test_user = l[i].getElementsByTagName('a')[2].innerHTML; var pagehref = l[i].getElementsByTagName('a')[1].href;}
else
{test_user = l[i].getElementsByTagName('a')[3].innerHTML; var pagehref = l[i].getElementsByTagName('a')[2].href;}
//
if (test_user != vandal)
{
var good_user = test_user;
var URL = pagehref + "&action=edit&jsaction=autorevertnice&byuser=" + escape(user_name) + "&oldrvtouser=" + escape(good_user) + "&revertfromuser=" + escape(vandal);
body.innerHTML = '<strong>Page rollback status:<span style="color:blue;"> Getting article history ... </span>done</strong>';
location.href = URL;
found = 1;
break;
}
}
if (found == 0)
{body.innerHTML = cant_rollback.replace('<<top_user>>',top_user).replace('<<vandal>>',vandal); return;}
}
}
///////////////////////////////
// -----------------------------------------------------------------------------
// XMLHttpRequest support
// -----------------------------------------------------------------------------
if (document.implementation.createDocument) {
var gml_xmlparser = new DOMParser();
}
function gml_XMLParse(string) {
if (document.implementation.createDocument) {
return gml_xmlparser.parseFromString(string, "text/xml");
} else if (window.ActiveXObject) {
var gml_xmldoc = new ActiveXObject("Microsoft.XMLDOM");
gml_xmldoc.async = false;
ret = gml_xmldoc.loadXML(string);
if (!ret)
return null;
return gml_xmldoc.documentElement;
}
return null;
}
var gml_xmlhttp;
function HTTPClient() {
var gml_http;
if(window.XMLHttpRequest) {
gml_http = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
gml_http = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
gml_http = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
gml_http = false;
}
}
}
return gml_http;
}
// -----------------------------------------------------------------------------
// MD5 hash calculator
// -----------------------------------------------------------------------------
// Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
// Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
// Distributed under the BSD License
// See http://pajhome.org.uk/crypt/md5 for more info.
// -----------------------------------------------------------------------------
var hexcase = 0;
var b64pad = "";
var chrsz = 8;
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function core_md5(x, len)
{
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); c = md5_ff(c, d, a, b, x[i+10], 17, -42063); b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return Array(a, b, c, d);
}
function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); }
function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); }
function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); }
function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); }
function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); }
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
function bit_rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
function str2binl(str)
{
var bin = Array();
var mask = (1 << chrsz) - 1;
for(var i = 0; i < str.length * chrsz; i += chrsz)
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
return bin;
}
function binl2hex(binarray)
{
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = "";
for(var i = 0; i < binarray.length * 4; i++)
{
str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
}
return str;
}
// -----------------------------------------------------------------------------
// Add revert buttons to the page
// -----------------------------------------------------------------------------
addOnloadHook(AddRevertButtonsnorm)
function AddRevertButtonsnorm()
{
var l, article = '', vandal;
// Add 'revert' links to a diff page [[Category:VoA scripted admins]]
var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;
l = document.getElementById('bodyContent').getElementsByTagName('td');
for (i = 0; i < l.length; i++)
{
if (l[i].className == 'diff-otitle')
{
if (!l[i].getElementsByTagName('a')[0]){return;}
article = l[i].getElementsByTagName('a')[0].href;
pagename = article.split('title=')[1];
}
else if (l[i].className == 'diff-ntitle')
{
var toplink = l[i].getElementsByTagName('a')[0].href;
vandal = l[i].getElementsByTagName('a')[2].innerHTML;
var t = l[i].innerHTML;
n = t.indexOf('</a>) <br') + t.indexOf('</A>) <BR') + 1; // XXX: WOW HACK!!!!
if (article != '' && toplink.indexOf('oldid=') == -1)
{
l[i].innerHTML = ' <strong><a href="' + article + '&action=history&limit=12&jsaction=IEnicerevert&user=' + escape(vandal) + '&token=' + hex_md5(pagename + vandal + user_name) + '">' + prollbacklink + '</strong></a> || <strong><a href="' + article + '&action=history&limit=12&jsaction=IErollback&vandal=' + escape(vandal) + '&token=' + hex_md5(pagename + vandal + user_name) + '">' + rollbacklink + '</a></strong> ' + t.substring(0,n + 5) + ' <strong><a href="' + article + '&action=history&limit=12&jsaction=IEnormalrevert&user=' + escape(vandal) + '&token=' + hex_md5(pagename + vandal + user_name) + '">' + nrollbacklink + '</strong></a>' + t.substring(n + 5,t.length);
}
}
}
// Add 'revert' links to a contributions page
if (document.title.indexOf('User contributions') == 0)
{
var c = document.getElementById('contentSub');
var a = c.getElementsByTagName('a');
vandal = a[0].innerHTML;
//bug fix
if (vandal == 'Talk')
{vandal = document.getElementById('contentSub').innerHTML.split(' (<a')[0].split(' (<A')[0].split('For ')[1];}
l = document.getElementById('bodyContent').getElementsByTagName('li');
for (i = 0; i < l.length; i++)
{
var t = l[i].innerHTML;
// If we are already a sysop on this wiki, abort
if (t.indexOf('action=rollback') != -1)
break;
if (t.indexOf(')</strong>') != -1)
{
article = l[i].getElementsByTagName('a')[0].href.split('&action=history')[0];
pagename = article.split('title=')[1];
l[i].innerHTML += ' <a href="' + article + '&action=history&limit=12&jsaction=IEnormalrevert&user=' + escape(vandal) + '&token=' + hex_md5(pagename + vandal + user_name) + '">' + qrollbacklink + '</a>';
}
}
}
}
////////////////////////
// ============= test-n.js ==============
function tnaddlilink(url, name)
{
var na = document.createElement('a');
na.setAttribute('href', url);
var txt = document.createTextNode(name);
na.appendChild(txt);
var li = document.createElement('li');
li.appendChild(na);
return li;
}
function testn(number)
{
var IPnote = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnote = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning if you did not make any [[Wikipedia:vandalism|unconstructive]] edits.'' ";}
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1]) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="====" + "Regarding edits made during [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]] ([[UTC]])" + varticle + "====" + "\n" + "{{subst:" + "test" + number + "}} " + IPnote + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " test" + number;
}
function warningn()
{
var IPnote = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnote = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning if you did not make any [[Wikipedia:vandalism|unconstructive]] edits.'' ";}
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1]) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="====" + "Regarding edits made during [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]] ([[UTC]])" + varticle + "====" + "\n" + "{{subst:" + "bv" + "}} " + IPnote + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " bv";
}
function testbl(number)
{
var IPnote = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnote = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning if you did not make any [[Wikipedia:vandalism|unconstructive]] edits.'' ";}
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1]) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="====" + "Regarding edits made during [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]] ([[UTC]])" + varticle + "====" + "\n" + "{{subst:" + "Blank" + number + "}} " + IPnote + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " Blank" + number;
}
function spam()
{
var IPnote = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnote = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning if you did not make any [[Wikipedia:vandalism|unconstructive]] edits.'' ";}
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1]) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="====" + "Regarding edits made during [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]] ([[UTC]])" + varticle + "====" + "\n" + "{{subst:" + "spam}} " + IPnote + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " spam";
}
function spamn(number)
{
var IPnote = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnote = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning if you did not make any [[Wikipedia:vandalism|unconstructive]] edits.'' ";}
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1]) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="====" + "Regarding edits made during [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]] ([[UTC]])" + varticle + "====" + "\n" + "{{subst:" + "spam" + number + "}} " + IPnote + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " spam" + number;
}
//************
//LAST DIFF TAB
function lastdiff()
{
if (document.title.indexOf("Editing ") != -1)
{return;}
z=document.getElementById("content").childNodes;
for (var n=0;n<z.length;n++) {
if (z[n].className=="firstHeading")
{
var pname=z[n].innerHTML.replace('&','%26').replace('&','%26').replace('&','%26').replace("+", "%2B").replace("+", "%2B");
}
}
var l=addTab("http://en.wikipedia.org/w/index.php?title=" + pname + "&diff=cur&oldid=prev", 'last', '');
l.lastChild.title="Show most recent diff";
}
//Quick warning tabs
addOnloadHook(add_testn_tabs);
function add_testn_tabs()
{
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];
if(document.getElementById('ca-history'))
{lastdiff();}
if (document.title.indexOf("Editing User talk:") != -1)
{
tabs.appendChild(tnaddlilink('javascript:testn(1)',"t"));
tabs.appendChild(tnaddlilink('javascript:testn(2)',"t2"));
tabs.appendChild(tnaddlilink('javascript:testn(3)',"v"));
tabs.appendChild(tnaddlilink('javascript:warningn()',"w"));
tabs.appendChild(tnaddlilink('javascript:testbl(2)',"b"));
tabs.appendChild(tnaddlilink('javascript:testbl(3)',"b2"));
tabs.appendChild(tnaddlilink('javascript:spam()',"s"));
tabs.appendChild(tnaddlilink('javascript:spamn(2)',"s2"));
if(document.getElementById('ca-delete'))
{
document.getElementById('ca-delete').firstChild.innerHTML = '[d]';
}
if(document.getElementById('ca-move'))
{
document.getElementById('ca-move').firstChild.innerHTML = '[m]';
}
if(document.getElementById('ca-watch'))
{
document.getElementById('ca-watch').firstChild.innerHTML = '[w]';
}
if(document.getElementById('ca-unwatch'))
{
document.getElementById('ca-unwatch').firstChild.innerHTML = '[uw]';
}
if(document.getElementById('ca-edit'))
{
document.getElementById('ca-edit').firstChild.innerHTML = 'Edit';
}
if(document.getElementById('ca-talk'))
{
document.getElementById('ca-talk').firstChild.innerHTML = 'Talk';
}
if(document.getElementById('ca-protect'))
{
document.getElementById('ca-protect').firstChild.innerHTML = 'P (off)';
}
if(document.getElementById('ca-unprotect'))
{
document.getElementById('ca-unprotect').firstChild.innerHTML = 'P (on)';
}
}
}
//END
////////////
// [[User:Lupin/popupsdev.js]] - please include this line
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popupsdev.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
popupStructure='shortmenus';
popupSubpopups=false;
//END
// [[User:Lupin/recent2.js]] - please include this line
mw.loader.load(
'https://en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
////////////
//more revert tools
//document.write('<script type="text/javascript" src="'
// + 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Revert/monobook.js'
// + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//INSERTING ABOVE LINKED SCRIPT INSTEAD OF LINK
//
//////AOL RANGES////////
//main ranges; rapidly changing
var AOL_RANGES = /64\.12\.|149\.174|152\.163\.|195\.93\.[0-9]\.|195\.93\.[0-9][0-9]\.|195\.93\.1[0-1][0-9]\.|195\.93\.12[0-7]\.|198\.81\.[0-9]\.|198\.81\.[1-2][0-9]\.|198\.81\.3[01]\.|202\.67\.6[4-9]\.|202\.67\.1[01]|202\.67\.12[0-7]|205\.188\.|207\.200\.6[4-9]\.|207\.200\.1[01]|207\.200\.12[0-7]/;
//all ranges
var AOL_RANGES_ALL = /64\.12\.|149\.174|152\.163\.|195\.93\.[0-9]\.|195\.93\.[0-9][0-9]\.|195\.93\.1[0-1][0-9]\.|195\.93\.12[0-7]\.|198\.81\.[0-9]\.|198\.81\.[1-2][0-9]\.|198\.81\.3[01]\.|202\.67\.6[4-9]\.|202\.67\.1[01]|202\.67\.12[0-7]|205\.188\.|207\.200\.6[4-9]\.|207\.200\.1[01]|207\.200\.12[0-7]|172\.12[0-8]|172\.1[3-9][0-9]|172\.20[0-9]|172\.21[0-6]/;
//////
//Edit and "revert to" JS
//addOnloadHook(adddifflinks)
function adddifflinks()
{
var editlink = '<strong><span style="color:black;">[</span>edit this version<span style="color:black;">]</span></strong> ';
var rvname = ' <strong><span style="color:black;">[</span><span style="color:red;">restore this revision</span><span style="color:black;">]</span></strong><br>';
var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;
if (location.href.indexOf('diff=') != -1 && location.href.indexOf('&oldid=') != -1)
{
var doctd = document.getElementById('bodyContent').getElementsByTagName('td');
if (!doctd[0]){return;}
var good_user = doctd[0].getElementsByTagName('a')[2].innerHTML;
var link = doctd[0].getElementsByTagName('a')[0].href.replace('&','&') + "&action=edit";
var rvlink = doctd[0].getElementsByTagName('a')[0].href.replace('&','&') + "&action=edit&jsaction=autorevert&byuser=" + escape(user_name) + "&oldrvtouser=" + escape(good_user);
document.getElementById('bodyContent').getElementsByTagName('td')[0].innerHTML = '<a href="' + rvlink + '">' + rvname + '</a>' + document.getElementById('bodyContent').getElementsByTagName('td')[0].innerHTML;
}
}
//END
function autosave()
{
user_name = escape(document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML);
if (location.href.indexOf("&jsaction=autorevertnorm&byuser=" + user_name) != -1 || location.href.indexOf("&jsaction=autorevertvandal&byuser=" + user_name) != -1 || location.href.indexOf("&jsaction=autorevertnice&byuser=" + user_name) != -1)
{
if (location.href.indexOf('&revertfromuser') == -1 && location.href.indexOf('&jsaction=autorevertvandal') == -1)
{
var message = "Are you sure you want to revert to this revision?";
var return_value = confirm(message);
if (return_value != true){history.go(-1); return;}
}
var good_user = unescape(location.href.split("&oldrvtouser=")[1].split('&revertfromuser=')[0]);
var ID = location.href.split("&oldid=")[1].split("&action=edit")[0];
document.getElementById('wpMinoredit').checked=true;
if (location.href.indexOf('&jsaction=autorevertvandal') != -1)
{
document.getElementById('bodyContent').setAttribute("visibility", "hidden");
var artname = document.title.split('Editing ')[1].split(' - ')[0];
var vandal = unescape(location.href.split('&revertfromuser=')[1]);
document.editform.wpSummary.value = 'Reverted [[WP:VAND|vandalism]] by [[Special:contributions/' + vandal + '|' + vandal + ']] to last version by ' + good_user + '. Please do not compromise the integrity of pages.';
var AOL = 1;
if (vandal.search(AOL_RANGES) == -1)
{
AOL = 0;
window.open('http://en.wikipedia.org/w/index.php?title=User talk:' + vandal + '&action=edit' + '&action=edit&vanarticle=' + escape(artname),'vandalwarn','location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1024,height=768');
}
document.getElementById('editform').submit();
if (AOL == 0)
{
document.getElementById('bodyContent').innerHTML = '<strong>Page rollback status:<span style="color:blue;"> Getting article history ... </span>done<br>Page rollback status:<span style="color:blue;"> Retrieving page revision ... </span>done<br>Page rollback status:<span style="color:darkred;"> Opening user talk page ... </span><br>Page rollback status: <span style="color:red;">Submitting form ...</span></strong>';
}
else
{
document.getElementById('bodyContent').innerHTML = '<strong>Page rollback status:<span style="color:blue;"> Getting article history ... </span>done<br>Page rollback status:<span style="color:blue;"> Retrieving page revision ... </span>done<br>Page rollback status:<span style="color:darkred;"> NOT opening user talk page (AOL IP)... </span><br>Page rollback status: <span style="color:red;">Submitting form ...</span></strong>';
}
}
else if (location.href.indexOf('&jsaction=autorevertnorm&byuser=') != -1)
{
document.getElementById('bodyContent').setAttribute("visibility", "hidden");
var vandal = unescape(location.href.split('&revertfromuser=')[1]);
document.editform.wpSummary.value = 'Reverted edits by [[Special:contributions/' + vandal + '|' + vandal + ']] to last version by ' + good_user + '.';
document.getElementById('editform').submit();
document.getElementById('bodyContent').innerHTML = '<strong>Page rollback status:<span style="color:blue;"> Getting article history ... </span>done<br>Page rollback status:<span style="color:blue;"> Retrieving page revision ... </span>done<br>Page rollback status: <span style="color:red;">Submitting form ...</span></strong>';
}
else if (location.href.indexOf('&jsaction=autorevertnice&byuser=') != -1)
{
document.getElementById('bodyContent').setAttribute("visibility", "hidden");
var vandal = unescape(location.href.split('&revertfromuser=')[1]);
document.editform.wpSummary.value = "Reverted [[WP:AGF|good faith]] edits by [[Special:contributions/" + vandal + "|" + vandal + "]] per policy issues. Please read up on [[WP:POL#Key_policies|policies and guidelines]]. Thanks!";
document.getElementById('editform').submit();
document.getElementById('bodyContent').innerHTML = '<strong>Page rollback status:<span style="color:blue;"> Getting article history ... </span>done<br>Page rollback status:<span style="color:blue;"> Retrieving page revision ... </span>done<br>Page rollback status: <span style="color:red;">Submitting form ...</span></strong>';
}
else if (location.href.indexOf('&action=edit&jsaction=autorevert&byuser=') != -1)
{
document.editform.wpSummary.value = 'Revert to revision ' + ID + ' by [[User:' + good_user + '|' + good_user + ']].';
var form = document.getElementById('editform');
form.submit();
}
}
}
//END
//Revert options
addOnloadHook(NArevertfunctions)
function NArevertfunctions()
{
adddifflinks();
autosave();
}
//END
//<nowiki> History tools
mw.loader.load(
'https://en.wikipedia.org/w/index.php?title=User:Voice_of_All/History/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
//
//<nowiki> AIV tools
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Lightdarkness/aiv.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//</nowiki></pre>