User:Technical 13/SandBox/SpamUNblocker.js
Appearance
< User:Technical 13 | SandBox
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:Technical 13/SandBox/SpamUNblocker. |
/* See also: [[User:Technical 13/SandBox/G11user.js]] */
/* <nowiki> Start of script */
var SPAMblocker = mw.util.addPortletLink(
'p-cactions',
'#',
'SPAMblock',
'pt-spamblock',
'Delete page as spam, block account, notify editor on talk page.',
null,
null
);
$( SPAMblocker ).click( function ( e ) {
e.preventDefault();
/* Open Special:Delete to delete page. */
window.open(mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=' + mw.config.get('wgPageName') + '&action=delete&wpDeleteReasonList=%5B%5BWP%3ACSD%23G11%7CG11%5D%5D%20Unambiguous%20%5B%5BWP%3ANOTADVERTISING%7Cadvertising%5D%5D%20or%20promotion#firstHeading', "_blank");
/* Open User_talk: to notify user */
window.open(mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=User_talk%3A' + mw.config.get('wgTitle') + '&action=edit§ion=new&preload=User:' + mw.config.get('wgUserName').replace(" ", "_") + '/SpamUNblocker&nosummary=1&minor=0&wpWatchthis=1&preview=yes#editform', "_blank");
/* Open Special:Block to block user */
window.open(mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=Special:Block/' + mw.config.get('wgTitle') + '&wpExpiry=infinite&wpReason=%7B%7Bspamusernameblock%7D%7D#firstHeading', "_blank");
});
/* Add a function to resize wpTextbox1 to 5 rows so the preview is shown */
if(mw.config.get('wgNamespaceNumber') === 3 && mw.config.get('wgAction') === "edit" && document.location.href.contains('&action=edit§ion=new&preload=User:' + mw.config.get('wgUserName').replace(" ", "_") + '/SpamUNblocker&nosummary=1&minor=0&wpWatchthis=1&preview=yes') === true){
$('#wpTextbox1').attr('rows','5');
}
/* End of script </nowiki> */