r69183 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69182‎ | r69183 | r69184 >
Date:12:56, 8 July 2010
Author:laner
Status:deferred
Tags:
Comment:
* Changed the display of site names to (sitename) from sitename: to make a visual difference between project namespace, and site name
* Upped the version to 0.5
Modified paths:
  • /trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.hooks.php (modified) (history)
  • /trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.php (modified) (history)
  • /trunk/extensions/JSBreadCrumbs/js/BreadCrumbs.js (modified) (history)

Diff [purge]

Index: trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.php
@@ -28,7 +28,7 @@
2929 'path' => __FILE__,
3030 'name' => 'JSBreadCrumbs',
3131 'author' => 'Ryan Lane',
32 - 'version' => '0.4',
 32+ 'version' => '0.5',
3333 'url' => 'http://www.mediawiki.org/wiki/Extension:JSBreadCrumbs',
3434 'descriptionmsg' => 'jsbreadcrumbs-desc',
3535 );
Index: trunk/extensions/JSBreadCrumbs/js/BreadCrumbs.js
@@ -37,14 +37,7 @@
3838 // Get the full title
3939 var title = wgTitle;
4040 if ( wgNamespaceNumber != 0 ) {
41 - // If this is the project namespace, or we aren't showing the site name
42 - // then add the namespace to the title. This avoids showing the sitename
43 - // twice when adding pages in the project namespace.
44 - // TODO: This is an awkward way to do this, and bug prone when the user
45 - // logs in with a project page in the history. Find a better way.
46 - if ( wgNamespaceNumber != 4 || !wgJSBreadCrumbsShowSiteName ) {
47 - title = wgFormattedNamespaces[wgNamespaceNumber] + ":" + wgTitle;
48 - }
 41+ title = wgFormattedNamespaces[wgNamespaceNumber] + ":" + wgTitle;
4942 }
5043
5144 // Remove duplicates
@@ -79,14 +72,14 @@
8073 // Add the bread crumbs
8174 for ( var i = 0; i < titleState.length; i++ ) {
8275 if ( wgJSBreadCrumbsShowSiteName == true ) {
83 - urltoappend = '<a href="' + urlState[i] + '">' + siteState[i] + ':' + titleState[i] + '</a> ';
 76+ urltoappend = '<a href="' + urlState[i] + '">' + '(' + siteState[i] + ') ' + titleState[i] + '</a> ';
8477 } else {
8578 urltoappend = '<a href="' + urlState[i] + '">' + titleState[i] + '</a> ';
86 - }
 79+ }
 80+ // Only add the separator if this isn't the last title
8781 if ( i < titleState.length - 1 ) {
88 - // Only add the separator if this isn't the last title
8982 urltoappend = urltoappend + wgJSBreadCrumbsSeparator + ' ';
90 - }
 83+ }
9184 mwextbc.append( urltoappend );
9285 }
9386
Index: trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.hooks.php
@@ -10,7 +10,7 @@
1111 global $wgExtensionAssetsPath;
1212
1313 if ( self::enableBreadCrumbs() ) {
14 - $out->addScriptFile( "$wgExtensionAssetsPath/JSBreadCrumbs/js/BreadCrumbs.js", 6 );
 14+ $out->addScriptFile( "$wgExtensionAssetsPath/JSBreadCrumbs/js/BreadCrumbs.js", 7 );
1515 $out->addExtensionStyle( "$wgExtensionAssetsPath/JSBreadCrumbs/css/BreadCrumbs.css?1" );
1616 }
1717

Status & tagging log