Add names to anonymous JS function

To have clearer stack traces.

Change-Id: Ia086cef5dc916c21a94af7856715754b6bfb496b
This commit is contained in:
Daimona Eaytoy 2018-11-19 15:39:43 +01:00
parent 2b5fb86f97
commit 9d02b3947a
3 changed files with 9 additions and 9 deletions

View file

@ -197,10 +197,10 @@
abfendid: filterId,
abflimit: 1
} )
.always( function () {
.always( function removeSpinner() {
$.removeSpinner( 'fetch-spinner' );
} )
.done( function ( data ) {
.done( function insertFilter( data ) {
if ( data.query.abusefilters[ 0 ] !== undefined ) {
if ( useAce ) {
filterEditor.setValue( data.query.abusefilters[ 0 ].pattern );
@ -215,7 +215,7 @@
* that don't have checked boxes
*/
function hideDeselectedActions() {
$( '.mw-abusefilter-action-checkbox input' ).each( function () {
$( '.mw-abusefilter-action-checkbox input' ).each( function showHideParams() {
// mw-abusefilter-action-checkbox-{$action}
var action = this.parentNode.id.substr( 31 ),
$params = $( '#mw-abusefilter-' + action + '-parameters' );
@ -253,14 +253,14 @@
ammessages: message,
amargs: args.join( '|' )
} )
.done( function ( data ) {
.done( function parseMessage( data ) {
api.parse( data.query.allmessages[ 0 ][ '*' ], {
disablelimitreport: '',
preview: '',
prop: 'text',
title: 'MediaWiki:' + message
} )
.done( function ( html ) {
.done( function showMessage( html ) {
$element.show().html( html );
previewButton.setFlags(
{ destructive: true, progressive: false }

View file

@ -94,7 +94,7 @@
.fail( examinerTestProcessFailure );
}
$( document ).ready( function () {
$( document ).ready( function initialize() {
$syntaxResult = $( '#mw-abusefilter-syntaxresult' );
$( '#mw-abusefilter-examine-test' ).click( examinerTestFilter );
} );

View file

@ -22,13 +22,13 @@
action: 'abusefilterevalexpression',
expression: expr
} )
.fail( function ( error, details ) {
.fail( function showError( error, details ) {
var msg = error === 'http' ? 'abusefilter-http-error' : 'unknown-error';
$.removeSpinner( 'abusefilter-expr' );
$( '#mw-abusefilter-expr-result' )
.text( mw.msg( msg, details.exception ) );
} )
.done( function ( data ) {
.done( function showResult( data ) {
$.removeSpinner( 'abusefilter-expr' );
$( '#mw-abusefilter-expr-result' )
@ -105,7 +105,7 @@
return false;
}
$( document ).ready( function () {
$( document ).ready( function initialize() {
$( '#mw-abusefilter-submitexpr' ).click( doExprSubmit );
$( '#mw-abusefilter-reautoconfirmsubmit' ).click( doReautoSubmit );
} );