Adding some comments for the API

Adding .jshintrc file

Change-Id: Ib15a3b3ce2c37933b62ccb112a38b1d61051ca16
This commit is contained in:
kaldari 2013-04-05 16:47:49 -07:00
parent bc369fdf85
commit e3a4b724c1
3 changed files with 18 additions and 2 deletions

10
.jshintrc Normal file
View file

@ -0,0 +1,10 @@
{
"predef": [
"mediaWiki",
"jQuery",
"QUnit"
],
"browser": true,
"supernew": true
}

View file

@ -1,5 +1,10 @@
<?php
/**
* API module to send thanks notifications
*
* @ingroup API
* @ingroup Extensions
*/
class ApiThank extends ApiBase {
public function execute() {
@ -67,7 +72,7 @@ class ApiThank extends ApiBase {
public function getParamDescription() {
return array(
'rev' => 'A revision ID for an edit that you want to thank someone for',
'token' => 'An edit token',
'token' => 'An edit token (to prevent CSRF abuse)',
'source' => "A short string describing the source of the request, for example, 'diff' or 'history'",
);
}

View file

@ -20,6 +20,7 @@
$thankLink.remove();
} )
.fail( function( errorCode, details ) {
// TODO: use something besides alert for the error messages
switch( errorCode ) {
case 'invalidrevision':
alert( mw.msg( 'thanks-error-invalidrevision' ) );