User:Ale jrb/Scripts/csdcheck.js
Appearance
< User:Ale jrb | Scripts
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. |
![]() | Documentation for this user script can be added at User:Ale jrb/Scripts/csdcheck. |
/* ============================================== *\
** CSD Helper JavaScript
** 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-move'), 'before');
};
}
// -- 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);