r86861 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86860‎ | r86861 | r86862 >
Date:14:08, 25 April 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
(bug 24298) Make dropdown menus in Vector more accessible by expanding and collapsing them when the hidden link behind the dropdown arrow receives a click event (triggered by an enter or space bar key press in the typical use case) and changing the appearance of the arrow when the hidden link behind it is focused. Patch by Jan Paul Posma
--This line, and those behind, will be ignored--

M phase3/skins/Vector.php
M phase3/skins/vector/images/arrow-down-icon.png
M phase3/skins/vector/screen.css
AM phase3/skins/vector/vector.js
M phase3/resources/Resources.php
Modified paths:
  • /trunk/phase3/resources/Resources.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)
  • /trunk/phase3/skins/vector/images/arrow-down-icon.png (modified) (history)
  • /trunk/phase3/skins/vector/screen.css (modified) (history)
  • /trunk/phase3/skins/vector/vector.js (added) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -39,6 +39,8 @@
4040 htmlspecialchars( $wgLocalStylePath ) .
4141 "/{$this->stylename}/csshover{$min}.htc\")}</style><![endif]-->"
4242 );
 43+
 44+ $out->addModuleScripts( 'skins.vector' );
4345 }
4446
4547 /**
Index: trunk/phase3/skins/vector/images/arrow-down-icon.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: trunk/phase3/skins/vector/screen.css
@@ -204,10 +204,13 @@
205205 float: left;
206206 /* @embed */
207207 background-image: url(images/arrow-down-icon.png);
208 - background-position: 100% 60%;
 208+ background-position: 0px 60%;
209209 background-repeat: no-repeat;
210210 cursor: pointer;
211211 }
 212+ div.vectorMenuFocus {
 213+ background-position: -22px 60%;
 214+ }
212215 /* @noflip */
213216 body.rtl div.vectorMenu {
214217 direction: rtl;
@@ -280,7 +283,8 @@
281284 x:-moz-any-link {
282285 margin-left: 23px;
283286 }
284 - div.vectorMenu:hover div.menu {
 287+ /* Enable forcing showing of the menu for accessibility */
 288+ div.vectorMenu:hover div.menu, div.vectorMenu div.menuForceShow {
285289 display: block;
286290 }
287291 div.vectorMenu ul {
Index: trunk/phase3/skins/vector/vector.js
@@ -0,0 +1,18 @@
 2+/*
 3+ * Vector-specific scripts
 4+ */
 5+$(document).ready( function() {
 6+ // For accessibility, show the menu when the hidden link in the menu is clicked
 7+ $( '#p-cactions h5 a' ).click( function() {
 8+ $( '#p-cactions .menu' ).toggleClass( 'menuForceShow' );
 9+ });
 10+
 11+ // When the hidden link has focus, also set a class that will change the arrow icon
 12+ $( '#p-cactions h5 a' ).focus( function () {
 13+ $( '#p-cactions' ).addClass( 'vectorMenuFocus' );
 14+ });
 15+
 16+ $( '#p-cactions h5 a' ).blur( function () {
 17+ $( '#p-cactions' ).removeClass( 'vectorMenuFocus' );
 18+ });
 19+});
Property changes on: trunk/phase3/skins/vector/vector.js
___________________________________________________________________
Added: svn:eol-style
120 + native
Index: trunk/phase3/resources/Resources.php
@@ -15,6 +15,7 @@
1616
1717 'skins.vector' => array(
1818 'styles' => array( 'vector/screen.css' => array( 'media' => 'screen' ) ),
 19+ 'scripts' => 'vector/vector.js',
1920 'remoteBasePath' => $GLOBALS['wgStylePath'],
2021 'localBasePath' => "{$GLOBALS['IP']}/skins",
2122 ),

Follow-up revisions

RevisionCommit summaryAuthorDate
r86958Selectors go from right to left. Starting with a generic 'a' is kind of slow....krinkle18:01, 26 April 2011
r86963* Fix ancient jumpy bug when clicking the hover-triangle (normally nobody doe...krinkle18:18, 26 April 2011
r99080Fix Bug:31396. The bug was cause by r86861, which used CSS sprites to change ...philip09:44, 6 October 2011
r99083Follow r86861. It's strange to apply the focus/blur behaviour only on #p-cact...philip10:37, 6 October 2011

Comments

#Comment by Krinkle (talk | contribs)   04:15, 13 April 2013
--This line, and those behind, will be ignored--

orly

Status & tagging log