User:Synoman Barris/common.js: Difference between revisions
no edit summary
No edit summary |
No edit summary Tag: Reverted |
||
Line 5:
myUserName = mw.config.get('wgUserName'),
userName = mw.config.get('wgRelevantUserName'),
templateName = "uw-
blockReason,
api;
Line 14:
mw.util.addPortletLink(
'p-cactions', 'javascript:void(0)',
'
);
} );
$('#ca-spamublock').on('click', function() {
if (confirm('This script will delete the current user page, block the relevant user or page creator as {{uw-
$('#ca-spamublock').text('Please wait...');
if(!userName) {
Line 44:
api.get({
action: 'query',
titles: 'User:'+myUserName+'/uw-
}).then(function(data) {
var query = data.query.pages;
if(Object.keys(query)[0] > 0) {
templateName = 'User:'+myUserName+'/uw-
} else {
templateName += "|sig=yes";
Line 60:
api.get({
action: 'query',
titles: 'User:'+myUserName+'/
}).then(function(data) {
var query = data.query.pages;
Line 66:
blockReason = '{{User:'+myUserName+'/spamublock-message}}';
} else {
blockReason = '
}
blockUser();
Line 75:
api.postWithToken("delete", {
action: 'delete',
reason: 'Nonsense/Bad page/Vandalism',
title: pageName
}).then(function(deleteData) {
Line 99:
}).then(function(blockData) {
$("#mw-content-text").append(
"<p><b>Blocked</b> <a href='"+mw.util.getUrl('User:'+userName)+"'>"+userName+"</a> (account creation blocked) with an expiry time of indefinite <i>(<span id='
);
$('<span/>').text(blockReason).appendTo("#spamublock-blocked-reason");
Line 118:
section: 'new',
sectiontitle: monthNames[d.getMonth()] + ' ' + d.getFullYear(),
summary: "You have been indefinitely blocked from editing because your account is being used only for
text: "\n"+templateName,
title: "User talk:"+userName
|