Advertisement
Joeytje50

Untitled

Oct 8th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. wkAjaxFastDelete.ajaxProtectAPage = function ( protectReason ) {
  2.     var url =  wgServer + wgScriptPath + '/api.php?action=query&prop=info&intoken=protect&titles=' + encodeURIComponent( wgPageName ) + '&format=json';
  3.     $.getJSON( url, function( data ) {
  4.         var editToken = data.query.pages[wgArticleId].protecttoken,
  5.             url = wgServer + wgScriptPath + '/api.php?action=protect&title=' + encodeURIComponent( wgPageName ) + '&reason=' + encodeURIComponent( protectReason ) + '&format=json&token=' + encodeURIComponent( editToken );
  6.         $.post( url, function() {
  7.             document.location.reload();
  8.         } );
  9.     } );
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement