Follow-up I5b02aa914916f64492c85ce6dcc3272b6406551a (#4335), also put a link in the...
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Tue, 10 Apr 2012 08:52:11 +0000 (10:52 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Tue, 10 Apr 2012 20:44:26 +0000 (22:44 +0200)
Now that there is a link on the revision hash in Special:Version, do the same in the debug toolbar.

Change-Id: I953ac70e17e72be68251e3908e164dfa46c68bf5

includes/GitInfo.php
includes/debug/Debug.php
resources/mediawiki/mediawiki.debug.js

index c2066ae..4953965 100644 (file)
@@ -181,4 +181,10 @@ class GitInfo {
                return self::repo()->getCurrentBranch();
        }
 
+       /**
+        * @see self::getHeadViewUrl()
+        */
+       public static function headViewUrl() {
+               return self::repo()->getHeadViewUrl();
+       }
 }
index 418eede..10905f2 100644 (file)
@@ -260,6 +260,7 @@ class MWDebug {
                        'phpVersion' => PHP_VERSION,
                        'gitRevision' => GitInfo::headSHA1(),
                        'gitBranch' => GitInfo::currentBranch(),
+                       'gitViewUrl' => GitInfo::headViewUrl(),
                        'time' => microtime( true ) - $wgRequestTime,
                        'log' => self::$log,
                        'debugLog' => self::$debug,
index 2afcbc6..e631c76 100644 (file)
 
                        var gitInfo = '';
                        if ( this.data.gitRevision != false ) {
-                               gitInfo = ' (' + this.data.gitRevision.substring( 0, 7 ) + ')';
+                               gitInfo = '(' + this.data.gitRevision.substring( 0, 7 ) + ')';
+                               if ( this.data.gitViewUrl != false ) {
+                                       gitInfo = $( '<a></a>' ).attr( 'href', this.data.gitViewUrl ).text( gitInfo );
+                               }
                        }
 
                        bitDiv( 'mwversion' )
                                .append( $( '<a href="//www.mediawiki.org/"></a>' ).text( 'MediaWiki' ) )
-                               .append( ': ' + this.data.mwVersion + gitInfo );
+                               .append( ': ' + this.data.mwVersion + ' ' )
+                               .append( gitInfo );
 
                        if ( this.data.gitBranch != false ) {
                                bitDiv( 'gitbranch' ).text( 'Git branch: ' + this.data.gitBranch );