r106735 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106734‎ | r106735 | r106736 >
Date:00:12, 20 December 2011
Author:rmoen
Status:deferred
Tags:markashelpful 
Comment:
revise loadItem ajax to get & tidy up, addition to r106730
Modified paths:
  • /trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js
@@ -44,9 +44,11 @@
4545 'format': 'json'
4646
4747 };
48 -
49 - $.post( mw.util.wikiScript('api'), request,
50 - function( data ) {
 48+ $.ajax({
 49+ type: 'get',
 50+ url: mw.util.wikiScript('api'),
 51+ data: request,
 52+ success: function( data ) {
5153 if ( data && data.query && data.query.mahitem &&
5254 data.query.mahitem.length > 0
5355 ) {
@@ -56,11 +58,13 @@
5759 // Failure, remove the item for now.
5860 $item.find( '.mw-mah-wrapper' ).remove();
5961 }
60 - }, 'json' )
61 - .error( function() {
62 - // Error, remove the item for now.
 62+ },
 63+ error: function ( data ) {
 64+ // Failure, remove the item for now.
6365 $item.find( '.mw-mah-wrapper' ).remove();
64 - } );
 66+ },
 67+ dataType: 'json'
 68+ });
6569 },
6670 /*
6771 * API call to mark or unmark an item as helpful.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106730adding core js methods and css for MarkAsHelpful, addition to r106664rmoen00:03, 20 December 2011

Status & tagging log