From 3d9a6c6b263a84d66626cdeb9bebbfb912b35803 Mon Sep 17 00:00:00 2001 From: Tom Gilder Date: Tue, 11 Oct 2005 23:46:00 +0000 Subject: [PATCH] Usability/accessibility: don't link in navigation if page is active --- includes/Skin.php | 9 ++++++++- skins/MonoBook.php | 21 ++++++++++++++------- skins/monobook/main.css | 4 ++++ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 27a8d22d6a..e059ac1099 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1312,7 +1312,10 @@ END; * @access private */ function buildSidebar() { + global $wgTitle, $action; + $fname = 'SkinTemplate::buildSidebar'; + $pageurl = $wgTitle->getLocalURL(); wfProfileIn( $fname ); $bar = array(); @@ -1333,10 +1336,14 @@ END; $text = $line[1]; if (wfEmptyMsg($line[0], $link)) $link = $line[0]; + $href = $this->makeInternalOrExternalUrl( $link ); + $active = ( $pageurl == $href ); $bar[$heading][] = array( 'text' => $text, - 'href' => $this->makeInternalOrExternalUrl( $link ), + 'href' => $href, 'id' => 'n-' . strtr($line[1], ' ', '-'), + 'active' => $active, + 'dolink' => ( !$active || ($action != 'view' && $action != 'purge' ) ) ); } else { continue; } } diff --git a/skins/MonoBook.php b/skins/MonoBook.php index bd60571cba..95e6cddae7 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -48,6 +48,7 @@ class MonoBookTemplate extends QuickTemplate { */ function execute() { // Suppress warnings to prevent notices about missing indexes in $this->data + global $action; wfSuppressWarnings(); ?> @@ -97,11 +98,11 @@ class MonoBookTemplate extends QuickTemplate {
msg('views') ?>
@@ -130,9 +131,15 @@ class MonoBookTemplate extends QuickTemplate {
diff --git a/skins/monobook/main.css b/skins/monobook/main.css index ffabcd0dbd..ee7d45444f 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -682,6 +682,10 @@ special external link styling */ z-index: 3; } +#p-navigation strong { + font-weight: normal; +} + /* ** Search portlet */ -- 2.20.1