r99454 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99453‎ | r99454 | r99455 >
Date:00:46, 11 October 2011
Author:kaldari
Status:deferred (Comments)
Tags:
Comment:
adding the javascript to PageTriage
Modified paths:
  • /trunk/extensions/PageTriage/ext.PageTriage.js (added) (history)

Diff [purge]

Index: trunk/extensions/PageTriage/ext.PageTriage.js
@@ -0,0 +1,29 @@
 2+( function( $ ) {
 3+
 4+var $currentArticle = null, // the title of the current article being reviewed
 5+
 6+$.pageTriage = {
 7+ tagArticle: function() {
 8+ var sendData = {
 9+ 'action': 'edit',
 10+ 'title': $currentArticle,
 11+ 'text' : $newText,
 12+ 'token': $token,
 13+ 'summary': 'Triaging the page,
 14+ 'notminor': true,
 15+ };
 16+
 17+ $.ajax( {
 18+ url: mw.config.get( 'wgScriptPath' ) + '/api.php',
 19+ data: sendData,
 20+ dataType: 'json',
 21+ type: 'POST',
 22+ } );
 23+ },
 24+
 25+ loadArticle: function() {
 26+ // Load in an article
 27+ }
 28+
 29+ $( document ).ready( $.pageTriage.loadArticle );
 30+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r99557fixing sloppy js errors, follow-up to r99454 and r99549kaldari20:13, 11 October 2011

Comments

#Comment by Nikerabbit (talk | contribs)   14:47, 11 October 2011

You can use mw.util.wikiScript( 'api' ) to get the path to api.php.

#Comment by Kaldari (talk | contribs)   20:12, 11 October 2011

Comma should be a semicolon. End of jQuery closure is missing. $( document ).ready statement should not be within the object definition.

This is just sad! Really sad!

Status & tagging log