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

Content deleted Content added
Ale jrb (talk | contribs)
m test
No edit summary
 
(7 intermediate revisions by one other user not shown)
Line 1:
// Blanked because no longer working
/* ============================================== *\
mw.log.warn( 'You installed the userscript [[User:Ale jrb/Scripts/csdcheck.js]]\n'
** CSD Helper JavaScript
+ 'It is no longer working and you should uninstall it.');
** for Wikipedia
**
** Created by Alexander Barley [[User:Ale_jrb]]
**
\* ============================================== */
 
// the following settings are used in this script:
 
function csdHelper() {
this.launch = function() {
// launch helper. check whether there is a deletion tag on this page.
if (document.getElementById('delete-criterion') != null) {
// this page is tagged. check sysop.
var iAmSysop = false;
for (var i = 0; i < wgUserGroups.length; i ++) {
if (wgUserGroups[i] == 'sysop') iAmSysop = true;
}
if (iAmSysop == false) { return false; // do nothing!
} else {
// sysop check OK :).
// launch controller.
this.control = new csdH_controller;
this.control.attachLinks();
return true;
}
} else { return false; /* do nothing! */ }
}
}
 
function csdH_controller() {
this.attachLinks = function() {
alert('test');
this.csdHelperLink = new wa_element('li');
this.csdHelperLink.ele_obj.id = 'ca-decline';
this.csdHelperLink.ele_obj.innerHTML = '<a href="#" title="decline speedy">decline speedy</a>';
//this.csdHelperLink.addWAEvent('click', function() { selfController.showWAWindow(); });
this.csdHelperLink.attach(document.getElementById('ca-delete'), 'after');
};
}
 
 
 
// -- run program
function launchCsdHelper() {
// lib proto
wa_window.prototype = new wa_document;
wa_element.prototype = new wa_document;
// init object
var obj_csdHelper = new csdHelper;
obj_csdHelper.launch();
return true;
}
 
importScript('User:Ale_jrb/Scripts/waLib.js');
hookEvent('load', launchCsdHelper);