r43492 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43491‎ | r43492 | r43493 >
Date:12:47, 14 November 2008
Author:daniel
Status:ok
Tags:
Comment:
don't use <a> for clickable bullets; improve usability (tab navigation) in text browsers
Modified paths:
  • /trunk/extensions/CategoryTree/CategoryTree.css (modified) (history)
  • /trunk/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryTree/CategoryTree.css
@@ -16,6 +16,12 @@
1717 margin-left: 1.5ex;
1818 }
1919
 20+
 21+.CategoryTreeBullet {
 22+ cursor: pointer;
 23+ cursor: hand; /* hack for MSIE 5.0 and 5.5 */
 24+}
 25+
2026 .CategoryTreeBullet a,
2127 .CategoryTreeBullet a:link,
2228 .CategoryTreeBullet a:active,
Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -654,7 +654,7 @@
655655 else $count = $cat->getPageCount();
656656 }
657657
658 - $linkattr= array( 'href' => $wikiLink );
 658+ $linkattr= array( );
659659 if ( $load ) $linkattr[ 'id' ] = $load;
660660
661661 $linkattr[ 'class' ] = "CategoryTreeToggle";
@@ -665,21 +665,22 @@
666666 }
667667 else*/
668668 if ( $children == 0 || $loadchildren ) {
669 - $tag = 'a';
 669+ $tag = 'span';
670670 if ( $count === 0 ) $txt = wfMsgNoTrans( 'categorytree-empty-bullet' );
671671 else $txt = wfMsgNoTrans( 'categorytree-expand-bullet' );
672 - $linkattr[ 'onclick' ] = "this.href='javascript:void(0)'; categoryTreeExpandNode('".Xml::escapeJsString($key)."',".$this->getOptionsAsJsStructure().",this);";
 672+ $linkattr[ 'onclick' ] = "if (this.href) this.href='javascript:void(0)'; categoryTreeExpandNode('".Xml::escapeJsString($key)."',".$this->getOptionsAsJsStructure().",this);";
673673 # Don't load this message for ajax requests, so that we don't have to initialise $wgLang
674674 $linkattr[ 'title' ] = $this->mIsAjaxRequest ? '##LOAD##' : wfMsgNoTrans('categorytree-expand');
675675 }
676676 else {
677 - $tag = 'a';
 677+ $tag = 'span';
678678 $txt = wfMsgNoTrans( 'categorytree-collapse-bullet' );
679 - $linkattr[ 'onclick' ] = "this.href='javascript:void(0)'; categoryTreeCollapseNode('".Xml::escapeJsString($key)."',".$this->getOptionsAsJsStructure().",this);";
 679+ $linkattr[ 'onclick' ] = "if (this.href) this.href='javascript:void(0)'; categoryTreeCollapseNode('".Xml::escapeJsString($key)."',".$this->getOptionsAsJsStructure().",this);";
680680 $linkattr[ 'title' ] = wfMsgNoTrans('categorytree-collapse');
681681 $linkattr[ 'class' ] .= ' CategoryTreeLoaded';
682682 }
683683
 684+ if ( $tag == 'a' ) $linkattr[ 'href' ] = $wikiLink;
684685 $s .= Xml::openElement( $tag, $linkattr ) . $txt . Xml::closeElement( $tag ) . ' ';
685686 } else {
686687 $s .= wfMsgNoTrans( 'categorytree-page-bullet' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r43497Bump version number for changed CSS per r43492.raymond16:41, 14 November 2008

Status & tagging log