r112114 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112113‎ | r112114 | r112115 >
Date:16:22, 22 February 2012
Author:maxsem
Status:ok
Tags:
Comment:
Show request time
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
@@ -643,7 +643,11 @@
644644 success: function ( data ) {
645645 var match = data.match( /<pre>[\s\S]*<\/pre>/ );
646646 if ( $.isArray( match ) ) {
 647+ var time = data.match( /<!-- Served .*?in (\d+(\.\d+)?) secs. -->/ );
647648 data = match[0];
 649+ if ( $.isArray( time ) ) {
 650+ data += '\n<br/>' + mw.html.escape( mw.msg( 'apisb-request-time', time[1] ) );
 651+ }
648652 } else {
649653 // some actions don't honor user-specified format
650654 data = '<pre>' + mw.html.escape( data ) + '</pre>';
Index: trunk/extensions/ApiSandbox/ApiSandbox.i18n.php
@@ -40,6 +40,7 @@
4141 'apisb-example' => 'Example',
4242 'apisb-examples' => 'Examples',
4343 'apisb-clear' => 'Clear',
 44+ 'apisb-request-time' => 'Request time: $1',
4445 );
4546
4647 /** Message documentation (Message documentation)
@@ -76,6 +77,7 @@
7778 'apisb-example' => 'Button text that will reveal the example list, used if the list contains only 1 entry. See also {{msg-mw|apisb-examples}}',
7879 'apisb-examples' => 'Button text that will reveal the example list, used if the list contains multiple entries. See also {{msg-mw|apisb-example}}',
7980 'apisb-clear' => 'Title of the button that clears all inputs',
 81+ 'apisb-request-time' => 'TIme it took to process this request',
8082 );
8183
8284 /** Afrikaans (Afrikaans)
Index: trunk/extensions/ApiSandbox/ApiSandbox.php
@@ -40,6 +40,7 @@
4141 'apisb-examples',
4242 'apisb-clear',
4343 'apisb-submit',
 44+ 'apisb-request-time',
4445 'parentheses',
4546 ),
4647 'dependencies' => array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r112678MFT to 1.19wmf1 r112114...hashar10:17, 29 February 2012

Status & tagging log