Index: trunk/extensions/ApiSandbox/ext.apiSandbox.js |
— | — | @@ -643,7 +643,11 @@ |
644 | 644 | success: function ( data ) { |
645 | 645 | var match = data.match( /<pre>[\s\S]*<\/pre>/ ); |
646 | 646 | if ( $.isArray( match ) ) { |
| 647 | + var time = data.match( /<!-- Served .*?in (\d+(\.\d+)?) secs. -->/ ); |
647 | 648 | data = match[0]; |
| 649 | + if ( $.isArray( time ) ) { |
| 650 | + data += '\n<br/>' + mw.html.escape( mw.msg( 'apisb-request-time', time[1] ) ); |
| 651 | + } |
648 | 652 | } else { |
649 | 653 | // some actions don't honor user-specified format |
650 | 654 | data = '<pre>' + mw.html.escape( data ) + '</pre>'; |
Index: trunk/extensions/ApiSandbox/ApiSandbox.i18n.php |
— | — | @@ -40,6 +40,7 @@ |
41 | 41 | 'apisb-example' => 'Example', |
42 | 42 | 'apisb-examples' => 'Examples', |
43 | 43 | 'apisb-clear' => 'Clear', |
| 44 | + 'apisb-request-time' => 'Request time: $1', |
44 | 45 | ); |
45 | 46 | |
46 | 47 | /** Message documentation (Message documentation) |
— | — | @@ -76,6 +77,7 @@ |
77 | 78 | 'apisb-example' => 'Button text that will reveal the example list, used if the list contains only 1 entry. See also {{msg-mw|apisb-examples}}', |
78 | 79 | 'apisb-examples' => 'Button text that will reveal the example list, used if the list contains multiple entries. See also {{msg-mw|apisb-example}}', |
79 | 80 | 'apisb-clear' => 'Title of the button that clears all inputs', |
| 81 | + 'apisb-request-time' => 'TIme it took to process this request', |
80 | 82 | ); |
81 | 83 | |
82 | 84 | /** Afrikaans (Afrikaans) |
Index: trunk/extensions/ApiSandbox/ApiSandbox.php |
— | — | @@ -40,6 +40,7 @@ |
41 | 41 | 'apisb-examples', |
42 | 42 | 'apisb-clear', |
43 | 43 | 'apisb-submit', |
| 44 | + 'apisb-request-time', |
44 | 45 | 'parentheses', |
45 | 46 | ), |
46 | 47 | 'dependencies' => array( |