User:AA/monobook.js

// //######################################################################### // WikiProject User scripts/Scripts/Add LI menu // Used in many scripts importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');

//######################################################################### // User:Lupin/Anti-vandal_tool importScript("User:Lupin/recent2.js");

//######################################################################### // WikiProject Deletion sorting/delsort.js importScript('Wikipedia:WikiProject Deletion sorting/delsort.js');

//######################################################################### // User:Cacycle/wikEd - in-browser text editor //document.write('');

//######################################################################### // WikiProject User scripts/Scripts/Watchlist since importScript('Wikipedia:WikiProject User scripts/Scripts/Watchlist since');

//######################################################################### // Change the default history count $(function {   var N = 100;      // <<== CHANGE TO YOUR LIKING    var x = document.getElementById('ca-history');    if(!x) return;    x.getElementsByTagName('a')[0].href += "&limit=" + N; });

//######################################################################### // User:Js/ajaxPreview ajaxPreviewPos = 'bottom'; ajaxPreviewScrollTop = true; importScript('User:Js/ajaxPreview.js');

//######################################################################### // WikiProject User scripts/Scripts/Autolink // Autolink wikilinks and {templates} (especially useful for monobook.js and similar pages)

$(function {    // Get the HTML of just the main body of the page, not including textareas hopefully    if (location.href.indexOf('&action=history') != -1) {       return;  // The history page crashes when this script is used    } else if (wgAction == 'view' && wgNamespaceNumber >= 0) {        targetdiv = document.getElementById('bodyContent');  // bodyContent div for most pages        content = targetdiv.innerHTML;        content = content.replace(/([^\[])\[{2}([^\[\]\|\<\>\n]*)([^\[\]\<\>\n]*?)?\]{2}([^\]])/g, '$1$2$3$4'); // Make wikilink code into links        content = content.replace(/([^\{])\{{2}(subst\:|msg\:)?([^\{\}\|\<\>\n]*)([^\{\}\<\>\n]*?)?\}{2}([^\}])/g, '$1\{\{$2$3$4\}\}$5'); // Make template code into links

targetdiv.innerHTML = content; // Write it back } else if (document.getElementById('wikiPreview')) { targetdiv = document.getElementById('wikiPreview'); // wikiPreview if it's there content = targetdiv.innerHTML; content = content.replace(/([^\[])\[{2}([^\[\]\|\<\>\n]*)([^\[\]\<\>\n]*?)?\]{2}([^\]])/g, '$1$2$3$4'); // Make wikilink code into links content = content.replace(/([^\{])\{{2}(subst\:|msg\:)?([^\{\}\|\<\>\n]*)([^\{\}\<\>\n]*?)?\}{2}([^\}])/g, '$1$5'); // Make template code into links

targetdiv.innerHTML = content; // Write it back } else if (document.getElementById('wikiDiff')) { targetdiv = document.getElementById('wikiDiff');  // wikiDiff if it's there content = targetdiv.innerHTML; content = content.replace(/([^\[])\[{2}([^\[\]\|\<\>\n]*)([^\[\]\<\>\n]*?)?\]{2}([^\]])/g, '$1$2$3$4'); // Make wikilink code into links content = content.replace(/([^\{])\{{2}(subst\:|msg\:)?([^\{\}\|\<\>\n]*)([^\{\}\<\>\n]*?)?\}{2}([^\}])/g, '$1$5'); // Make template code into links

targetdiv.innerHTML = content; // Write it back } else { return; } });

//######################################################################### // WikiProject User scripts/Scripts/Compact Navigation importScript('Wikipedia:WikiProject User scripts/Scripts/Compact Navigation');

//######################################################################### // WikiProject User scripts/Scripts/CloseAFD.js importScript('Wikipedia:WikiProject User scripts/Scripts/CloseAFD.js');

//######################################################################### // Script to warn you if your userpage is changed by another user. By // User:ais53. Note that the message persists until you edit // your userpage yourself. function upm_checkthisisme(xmlreq) { var junk; try { var ed=xmlreq.responseText.split('"+ed.split('<').join('&lt;').split('>').join('&gt;').split('&').join('&amp;')+""+ " (<a href='/wiki/Special:Mypage'>your userpage</a>, <a href='/w/index.php?title=User:"+encodeURI(wgUserName)+"&diff=last'>"+      "last change</a>)"; } catch(junk) {}; } $(function{ var a = sajax_init_object;  a.open('GET', mw.config.get('wgServer')+wgScriptPath+'/api.php?action=query&prop=revisions&titles=User:'+ encodeURI(wgUserName)+'&rvlimit=1&rvprop=user&format=xml'); a.send('');  a.onreadystatechange = function{if(a.readystate==4) upm_checkthisisme(a)}; });

//######################################################################### // CSD Helper User:Ale_jrb/Scripts importScript('User:Ale_jrb/Scripts/csdhelper.js');

//######################################################################### // TEST //document.write('<script type="text/javascript" src="http://tssweb/aatest.js">// '); //