r68646 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68645‎ | r68646 | r68647 >
Date:00:55, 28 June 2010
Author:laner
Status:deferred
Tags:
Comment:
* Added the separator to the localization file (for r68540)
* Added a message preceeding the breadcrumbs, to make their purpose clear to users on initial page load
Modified paths:
  • /trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.hooks.php (modified) (history)
  • /trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.i18n.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.i18n.php
@@ -13,4 +13,6 @@
1414 */
1515 $messages['en'] = array(
1616 'jsbreadcrumbs-desc' => 'Adds a trail of breadcrumbs below the tab bar.',
 17+ 'jsbreadcrumbs-separator' => '»',
 18+ 'jsbreadcrumbs-leading-description' => 'Navigation trail',
1719 );
Index: trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.php
@@ -17,8 +17,9 @@
1818 # http://www.gnu.org/copyleft/gpl.html
1919
2020 $wgJSBreadCrumbsMaxCrumbs = 5;
21 -$wgJSBreadCrumbsSeparator = "»";
22 -$wgJSBreadCrumbsCookiePath = "/";
 21+//BreadCrumbsSeparator default set via localization
 22+$wgJSBreadCrumbsSeparator = '';
 23+$wgJSBreadCrumbsCookiePath = '/';
2324
2425 // Sets Credits
2526 $wgExtensionCredits['other'][] = array(
Index: trunk/extensions/JSBreadCrumbs/js/BreadCrumbs.js
@@ -10,6 +10,9 @@
1111 if ( typeof wgJSBreadCrumbsCookiePath == "undefined" ) {
1212 wgJSBreadCrumbsCookiePath = "/";
1313 }
 14+ if ( typeof wgJSBreadCrumbsLeadingDescription == "undefined" ) {
 15+ wgJSBreadCrumbsLeadingDescription = "Navigation trail";
 16+ }
1417
1518 var titleState = ( $j.cookie( 'mwext-bc-title' ) || "" ).split( wgJSBreadCrumbsSeparator );
1619 var urlState = ( $j.cookie( 'mwext-bc-url' ) || "" ).split( wgJSBreadCrumbsSeparator );
@@ -30,6 +33,8 @@
3134 urlState.splice( matchTitleIndex, 1 );
3235 }
3336
 37+ mwextbc.append( wgJSBreadCrumbsLeadingDescription );
 38+
3439 for ( var i = 0; i < titleState.length; i++ ) {
3540 mwextbc.append( '<a href="' + urlState[i] + '">' + titleState[i] + '</a> ' + wgJSBreadCrumbsSeparator + ' ' );
3641 }
Index: trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.hooks.php
@@ -4,7 +4,7 @@
55 function addResources( $out ) {
66 global $wgExtensionAssetsPath;
77
8 - $out->addScriptFile( "$wgExtensionAssetsPath/JSBreadCrumbs/js/BreadCrumbs.js", 3 );
 8+ $out->addScriptFile( "$wgExtensionAssetsPath/JSBreadCrumbs/js/BreadCrumbs.js", 4 );
99 $out->addExtensionStyle( "$wgExtensionAssetsPath/JSBreadCrumbs/css/BreadCrumbs.css?1" );
1010
1111 return true;
@@ -16,11 +16,21 @@
1717 public static function addJSVars( $vars ) {
1818 global $wgJSBreadCrumbsMaxCrumbs, $wgJSBreadCrumbsSeparator, $wgJSBreadCrumbsCookiePath;
1919
 20+ wfLoadExtensionMessages( 'JSBreadCrumbs' );
 21+
 22+ // Allow localized separator to be overriden
 23+ if ( $wgJSBreadCrumbsSeparator !== '' ) {
 24+ $separator = $wgJSBreadCrumbsSeparator;
 25+ } else {
 26+ $separator = wfMsg( "jsbreadcrumbs-separator" );
 27+ }
 28+
2029 $variables = array();
2130
2231 $variables['wgJSBreadCrumbsMaxCrumbs'] = $wgJSBreadCrumbsMaxCrumbs;
23 - $variables['wgJSBreadCrumbsSeparator'] = $wgJSBreadCrumbsSeparator;
 32+ $variables['wgJSBreadCrumbsSeparator'] = $separator;
2433 $variables['wgJSBreadCrumbsCookiePath'] = $wgJSBreadCrumbsCookiePath;
 34+ $variables['wgJSBreadCrumbsLeadingDescription'] = wfMsg( "jsbreadcrumbs-leading-description" );
2535
2636 $vars = array_merge( $vars, $variables );
2737 return true;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68540Initial commit....laner01:45, 25 June 2010

Status & tagging log