v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "User:Lethosor/spamblock.js"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Created page with "function spamBlockUser(username, element){ if(!element) element=$('<span>'); element=$(element) new mw.Api().post({ user: username, action: 'block', expiry: 'never', r...")
(No difference)

Revision as of 01:24, 14 December 2013

function spamBlockUser(username, element){
if(!element) element=$('<span>');
element=$(element)
new mw.Api().post({
  user: username,
  action: 'block',
  expiry: 'never',
  reason: 'Unacceptable username: Suspected spammer. [[DF:Unblock|See this page]] if you believe this block was made in error.',
  autoblock: 1,
  nocreate: 1,
  noemail: 1,
  token: mw.user.tokens.values.editToken,
}).done(function(d){console.log('done',d);element.text('Done')}).fail(function(e){console.log('fail', e);element.text('Error: '+e)});
}