mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-11-13 17:52:33 +00:00
Adding some comments for the API
Adding .jshintrc file Change-Id: Ib15a3b3ce2c37933b62ccb112a38b1d61051ca16
This commit is contained in:
parent
bc369fdf85
commit
e3a4b724c1
10
.jshintrc
Normal file
10
.jshintrc
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"predef": [
|
||||
"mediaWiki",
|
||||
"jQuery",
|
||||
"QUnit"
|
||||
],
|
||||
|
||||
"browser": true,
|
||||
"supernew": true
|
||||
}
|
|
@ -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'",
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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' ) );
|
||||
|
|
Loading…
Reference in a new issue