Monchoman45

ACAjax

Oct 12th, 2011
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function ACAjax(page, text) {
  2.     var acapi = new APIQuery();
  3.     var query = new api.Query(api, 'POST', 'action=query&prop=info&indexpageids=1&titles=' + page, function(result) {
  4.         var comment = new api.Query(api, 'POST', 'action=ajax&article=' + result.query.pages[result.query.pageids[0]].pageid + '&method=axPost&rs=ArticleCommentsAjax&title=' + page + '&wpArticleComment=' + text);
  5.         comment.baseurl = '/index.php';
  6.         delete comment.params.useskin;
  7.         comment.headers['Content-type'] = 'application/x-www-form-urlencoded';
  8.         api.send(comment);
  9.     });
  10.     return query;
  11. }
  12.  
  13. importScript('MediaWiki:APIQuery.js', 'monchbox');
Advertisement
Add Comment
Please, Sign In to add comment