https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112678

Revision: 112678
Author:   hashar
Date:     2012-02-29 10:17:22 +0000 (Wed, 29 Feb 2012)
Log Message:
-----------
MFT to 1.19wmf1 r112114

ApiSandbox: show request time

Modified Paths:
--------------
    branches/wmf/1.19wmf1/extensions/ApiSandbox/ApiSandbox.i18n.php
    branches/wmf/1.19wmf1/extensions/ApiSandbox/ApiSandbox.php
    branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js

Property Changed:
----------------
    branches/wmf/1.19wmf1/extensions/ApiSandbox/


Property changes on: branches/wmf/1.19wmf1/extensions/ApiSandbox
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/JSTesting/extensions/ApiSandbox:100352-107913
/branches/REL1_15/phase3/extensions/ApiSandbox:51646
/branches/REL1_17/phase3/extensions/ApiSandbox:81445,81448
/branches/new-installer/phase3/extensions/ApiSandbox:43664-66004
/branches/sqlite/extensions/ApiSandbox:58211-58321
/branches/wmf/1.18wmf1/extensions/ApiSandbox:97508
/trunk/extensions/ApiSandbox:111043,111199,111218,111484,111575,111604,111659-111661,111668,111670,111688,111690,111698,111713,111715,111780,111796,111814,111947,112074,112114,112153,112160,112166,112260,112282,112360,112517,112571,112613,112628
/trunk/phase3/extensions/ApiSandbox:111002,111029,111034,111062,111067,111076,111085,111128,111144,111251

Modified: branches/wmf/1.19wmf1/extensions/ApiSandbox/ApiSandbox.i18n.php
===================================================================
--- branches/wmf/1.19wmf1/extensions/ApiSandbox/ApiSandbox.i18n.php     
2012-02-29 10:02:34 UTC (rev 112677)
+++ branches/wmf/1.19wmf1/extensions/ApiSandbox/ApiSandbox.i18n.php     
2012-02-29 10:17:22 UTC (rev 112678)
@@ -40,6 +40,7 @@
        'apisb-example'           => 'Example',
        'apisb-examples'          => 'Examples',
        'apisb-clear'             => 'Clear',
+       'apisb-request-time'      => 'Request time: $1',
 );
 
 /** Message documentation (Message documentation)
@@ -76,6 +77,7 @@
        'apisb-example' => 'Button text that will reveal the example list, used 
if the list contains only 1 entry. See also {{msg-mw|apisb-examples}}',
        'apisb-examples' => 'Button text that will reveal the example list, 
used if the list contains multiple entries. See also {{msg-mw|apisb-example}}',
        'apisb-clear' => 'Title of the button that clears all inputs',
+       'apisb-request-time'      => 'TIme it took to process this request',
 );
 
 /** Afrikaans (Afrikaans)

Modified: branches/wmf/1.19wmf1/extensions/ApiSandbox/ApiSandbox.php
===================================================================
--- branches/wmf/1.19wmf1/extensions/ApiSandbox/ApiSandbox.php  2012-02-29 
10:02:34 UTC (rev 112677)
+++ branches/wmf/1.19wmf1/extensions/ApiSandbox/ApiSandbox.php  2012-02-29 
10:17:22 UTC (rev 112678)
@@ -40,6 +40,7 @@
                'apisb-examples',
                'apisb-clear',
                'apisb-submit',
+               'apisb-request-time',
                'parentheses',
        ),
        'dependencies' => array(

Modified: branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js
===================================================================
--- branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js       
2012-02-29 10:02:34 UTC (rev 112677)
+++ branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js       
2012-02-29 10:17:22 UTC (rev 112678)
@@ -643,7 +643,11 @@
                                success: function ( data ) {
                                        var match = data.match( 
/<pre>[\s\S]*<\/pre>/ );
                                        if ( $.isArray( match ) ) {
+                                               var time = data.match( /<!-- 
Served .*?in (\d+(\.\d+)?) secs. -->/ );
                                                data = match[0];
+                                               if ( $.isArray( time ) ) {
+                                                       data += '\n<br/>' + 
mw.html.escape( mw.msg( 'apisb-request-time', time[1] ) );
+                                               }
                                        } else {
                                                // some actions don't honor 
user-specified format
                                                data = '<pre>' + 
mw.html.escape( data ) + '</pre>';


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to