User:Ale jrb/Scripts/csdcheck.js: Difference between revisions

Content deleted Content added
Ale jrb (talk | contribs)
m fixing naming issue :)
No edit summary
 
Line 1:
// Blanked because no longer working
function csdCheck() {
mw.log.warn( 'You installed the userscript [[User:Ale jrb/Scripts/csdcheck.js]]\n'
// Clean up the visible text in the deletion dropdown
+ 'It is no longer working and you should uninstall it.');
if (document.getElementById('wpDeleteReasonList') == null) return false;
var deleteList = document.getElementById('wpDeleteReasonList').options;
var re = /\[\[([^\]\|]*\|)?([^\]]*)\]\]/g; // convert pipe links to their display text.
for (var i = 0; i < deleteList.length; i++) {
var option = deleteList[i];
option.text = option.text.replace(re,'$2');
}
// Blank the reason box and replace with the relevant list item, if applicable
if (___location.href.indexOf('wpReason') > -1) {
// This deletion can be autofilled
var loc = ___location.href;
var reg = /23([a-z0-9]+)/ig;
var result = reg.exec(loc);
var options = document.getElementById('wpDeleteReasonList').options;
for (var i = 0; i < options.length; i ++) {
if (options[i].value.indexOf(result[1]) > -1) {
document.getElementById('wpDeleteReasonList').selectedIndex = options[i].index;
document.getElementById('wpReason').value = '';
break;
}
}
}
}
if (wgAction == 'delete') hookEvent('load', csdCheck);