User:Joepayne/grantBureaucrat.js: Difference between revisions

From Test Wiki
Content deleted Content added
Joepayne (talk | contribs)
m Protected "User:Joepayne/grantBureaucrat.js": Security ([Edit=Allow only bureaucrats] (indefinite) [Move=Allow only bureaucrats] (indefinite) [Delete=Allow only bureaucrats] (indefinite) [Protect=Allow only bureaucrats] (indefinite))
m Removed protection from "User:Joepayne/grantBureaucrat.js": Unnecessary
 
(2 intermediate revisions by one other user not shown)
Line 15: Line 15:
).done( function ( data ) {
).done( function ( data ) {
try {
try {
if(data.query.users[0].groups.indexOf('!sysop') >= 0) {/* Do nothing */}
if(data.query.users[0].groups.indexOf('bureaucrat') >= 0) {/* Do nothing */}
else {
else {
var link = mw.util.addPortletLink(
var link = mw.util.addPortletLink(
Line 21: Line 21:
'#',
'#',
'Give bureaucrat',
'Give bureaucrat',
'pt-givebueaucratlink',
'pt-givebureaucratlink',
'Add bureaucrat rights to this user'
'Add bureaucrat rights to this user'
);
);
Line 52: Line 52:
).done( function ( data ) {
).done( function ( data ) {
try {
try {
if(data.query.users[0].groups.indexOf('!sysop') >= 0) {/* Do nothing */}
if(data.query.users[0].groups.indexOf('bureaucrat') >= 0) {/* Do nothing */}
else {
else {
check = confirm("Do you want to give " + username + " bureaucrat rights on this wiki?");
check = confirm("Do you want to give " + username + " bureaucrat rights on this wiki?");
Line 124: Line 124:
summary: 'Rights notification',
summary: 'Rights notification',
nocreate: 1,
nocreate: 1,
appendtext: '\n\n{{subst:' + 'Rights removed}}',
appendtext: '\n\n{{subst:' + 'Bureaucrat granted}}',
token: mw.user.tokens.get( 'csrfToken' )
token: mw.user.tokens.get( 'csrfToken' )
}
}
Line 145: Line 145:
summary: 'Rights notification',
summary: 'Rights notification',
createonly: 1,
createonly: 1,
text: '\n\n{{subst:' + 'Rights removed}}',
text: '\n\n{{subst:' + 'Bureaucrat granted}}',
token: mw.user.tokens.get( 'csrfToken' )
token: mw.user.tokens.get( 'csrfToken' )
}
}