User:AA/monobook.js
Appearance
< User:AA
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 is at User:AA/monobook.css. |
// <nowiki>
//#########################################################################
// [[Wikipedia: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");
//#########################################################################
// [[Wikipedia:WikiProject Deletion sorting/delsort.js]]<br>
importScript('Wikipedia:WikiProject Deletion sorting/delsort.js');
//#########################################################################
// [[User:Cacycle/wikEd]] - in-browser text editor<br>
//document.write('<script type="text/javascript" src="'
//+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
//+ '&action=raw&ctype=text/javascript"></' + 'script>');
//#########################################################################
// [[Wikipedia: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');
//#########################################################################
// [[Wikipedia: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<a class="autolink" href="/wiki/$2">[[$2$3]]</a>$4'); // Make wikilink code into links
content = content.replace(/([^\{])\{{2}(subst\:|msg\:)?([^\{\}\|\<\>\n]*)([^\{\}\<\>\n]*?)?\}{2}([^\}])/g, '$1<a class="autolink" href="/wiki/$3">\{\{$2$3$4\}\}</a>$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<a class="autolink" href="/wiki/$2">[[$2$3]]</a>$4'); // Make wikilink code into links
content = content.replace(/([^\{])\{{2}(subst\:|msg\:)?([^\{\}\|\<\>\n]*)([^\{\}\<\>\n]*?)?\}{2}([^\}])/g, '$1<a class="autolink" href="/wiki/$3">{{$2$3$4}}</a>$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<a class="autolink" href="/wiki/$2">[[$2$3]]</a>$4'); // Make wikilink code into links
content = content.replace(/([^\{])\{{2}(subst\:|msg\:)?([^\{\}\|\<\>\n]*)([^\{\}\<\>\n]*?)?\}{2}([^\}])/g, '$1<a class="autolink" href="/wiki/$3">{{$2$3$4}}</a>$5'); // Make template code into links
targetdiv.innerHTML = content; // Write it back
} else {
return;
}
});
//#########################################################################
// [[Wikipedia:WikiProject User scripts/Scripts/Compact Navigation]]
importScript('Wikipedia:WikiProject User scripts/Scripts/Compact Navigation');
//#########################################################################
// [[Wikipedia: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('<rev user="')[1].split('"')[0];
if(ed!=wgUserName) document.getElementById('siteSub').innerHTML+="<div class='usermessage'>Your userpage was changed by "+
"<a href='/wiki/User:"+encodeURI(ed)+"'>"+ed.split('<').join('<').split('>').join('>').split('&').join('&')+"</a>"+
" (<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">//</script>');
// </nowiki>