User:1234qwer1234qwer4/TfDstarted.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. |
This user script seems to have a documentation page at User:1234qwer1234qwer4/TfDstarted. |
// This script adds an "TfDs Today" link to the top toolbar that gives the list of TfDs opened today, adapted from [[User:Lourdes/AfDstarted.js]]
$.when( mw.loader.using( ['mediawiki.util'] ), $.ready ).done( function() {
function englishMonthName(month){
switch(month)
{
case 0: return 'January';
case 1: return 'February';
case 2: return 'March';
case 3: return 'April';
case 4: return 'May';
case 5: return 'June';
case 6: return 'July';
case 7: return 'August';
case 8: return 'September';
case 9: return 'October';
case 10: return 'November';
case 11: return 'December';
default: return;
}
}
var d = new Date();
mw.util.addPortletLink(
'p-personal',
mw.util.getUrl('Wikipedia:Templates for discussion/Log/' + d.getUTCFullYear() + ' ' + englishMonthName(d.getUTCMonth()) + ' ' + d.getUTCDate()),
'TfDs Today',
'pt-specialnew',
'View the TfD discussions that have been opened today',
null,
'#pt-preferences'
);
});