r87240 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87239‎ | r87240 | r87241 >
Date:10:33, 2 May 2011
Author:maxsem
Status:ok
Tags:
Comment:
Added a spinner to loading message, proper API request error reporting
Modified paths:
  • /trunk/extensions/ApiSandbox/ApiSandbox.i18n.php (modified) (history)
  • /trunk/extensions/ApiSandbox/ApiSandbox.php (modified) (history)
  • /trunk/extensions/ApiSandbox/ext.apiSandbox.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ApiSandbox/ext.apiSandbox.js
@@ -86,7 +86,7 @@
8787 output.html( data );
8888 },
8989 error: function( jqXHR, textStatus, errorThrown ) {
90 - output.text( 'FAIL' );
 90+ showLoadError( output, 'apisb-request-error' );
9191 }
9292 };
9393 $.ajax( data );
@@ -100,7 +100,10 @@
101101 }
102102
103103 function showLoading( element ) {
104 - element.html( mw.msg( 'apisb-loading' ) ); // @todo:
 104+ element.html(
 105+ mw.html.element( 'img',
 106+ { src: mw.config.get( 'stylepath' ) + '/common/images/spinner.gif', alt: '' } )
 107+ + mw.msg( 'apisb-loading' ) );
105108 }
106109
107110 function showLoadError( element, message ) {
Index: trunk/extensions/ApiSandbox/ApiSandbox.i18n.php
@@ -17,6 +17,7 @@
1818 'apisb-select-value' => 'Select value',
1919 'apisb-loading' => 'Loading...',
2020 'apisb-load-error' => 'Error loading API description',
 21+ 'apisb-request-error' => 'Error performing API request',
2122 'apisb-namespaces-error' => 'Error loading namespaces',
2223 'apisb-ns-main' => '(Main)',
2324 'apisb-submit' => 'Make request',
Index: trunk/extensions/ApiSandbox/ApiSandbox.php
@@ -31,6 +31,7 @@
3232 'messages' => array(
3333 'apisb-loading',
3434 'apisb-load-error',
 35+ 'apisb-request-error',
3536 'apisb-select-value',
3637 'apisb-namespaces-error',
3738 'apisb-ns-main',

Status & tagging log