Revision: 43492
Author:   daniel
Date:     2008-11-14 12:47:54 +0000 (Fri, 14 Nov 2008)

Log Message:
-----------
don't use <a> for clickable bullets; improve usability (tab navigation) in text 
browsers

Modified Paths:
--------------
    trunk/extensions/CategoryTree/CategoryTree.css
    trunk/extensions/CategoryTree/CategoryTreeFunctions.php

Modified: trunk/extensions/CategoryTree/CategoryTree.css
===================================================================
--- trunk/extensions/CategoryTree/CategoryTree.css      2008-11-14 12:34:38 UTC 
(rev 43491)
+++ trunk/extensions/CategoryTree/CategoryTree.css      2008-11-14 12:47:54 UTC 
(rev 43492)
@@ -16,6 +16,12 @@
        margin-left: 1.5ex;
 }
 
+
+.CategoryTreeBullet {
+       cursor: pointer;
+       cursor: hand; /* hack for MSIE 5.0 and 5.5 */
+}
+
 .CategoryTreeBullet a,
 .CategoryTreeBullet a:link,
 .CategoryTreeBullet a:active,

Modified: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
===================================================================
--- trunk/extensions/CategoryTree/CategoryTreeFunctions.php     2008-11-14 
12:34:38 UTC (rev 43491)
+++ trunk/extensions/CategoryTree/CategoryTreeFunctions.php     2008-11-14 
12:47:54 UTC (rev 43492)
@@ -654,7 +654,7 @@
                                else $count = $cat->getPageCount();
                        }
        
-                       $linkattr= array( 'href' => $wikiLink );
+                       $linkattr= array( );
                        if ( $load ) $linkattr[ 'id' ] = $load;
 
                        $linkattr[ 'class' ] = "CategoryTreeToggle";
@@ -665,21 +665,22 @@
                        }
                        else*/ 
                        if ( $children == 0 || $loadchildren ) {
-                               $tag = 'a';
+                               $tag = 'span';
                                if ( $count === 0 ) $txt = wfMsgNoTrans( 
'categorytree-empty-bullet' );
                                else $txt = wfMsgNoTrans( 
'categorytree-expand-bullet' );
-                               $linkattr[ 'onclick' ] = 
"this.href='javascript:void(0)'; 
categoryTreeExpandNode('".Xml::escapeJsString($key)."',".$this->getOptionsAsJsStructure().",this);";
+                               $linkattr[ 'onclick' ] = "if (this.href) 
this.href='javascript:void(0)'; 
categoryTreeExpandNode('".Xml::escapeJsString($key)."',".$this->getOptionsAsJsStructure().",this);";
                                # Don't load this message for ajax requests, so 
that we don't have to initialise $wgLang
                                $linkattr[ 'title' ] = $this->mIsAjaxRequest ? 
'##LOAD##' : wfMsgNoTrans('categorytree-expand');
                        }
                        else {
-                               $tag = 'a';
+                               $tag = 'span';
                                $txt = wfMsgNoTrans( 
'categorytree-collapse-bullet' );
-                               $linkattr[ 'onclick' ] = 
"this.href='javascript:void(0)'; 
categoryTreeCollapseNode('".Xml::escapeJsString($key)."',".$this->getOptionsAsJsStructure().",this);";
+                               $linkattr[ 'onclick' ] = "if (this.href) 
this.href='javascript:void(0)'; 
categoryTreeCollapseNode('".Xml::escapeJsString($key)."',".$this->getOptionsAsJsStructure().",this);";
                                $linkattr[ 'title' ] = 
wfMsgNoTrans('categorytree-collapse');
                                $linkattr[ 'class' ] .= ' CategoryTreeLoaded';
                        }
 
+                       if ( $tag == 'a' ) $linkattr[ 'href' ] = $wikiLink;
                        $s .= Xml::openElement( $tag, $linkattr ) . $txt . 
Xml::closeElement( $tag ) . ' ';
                } else {
                        $s .= wfMsgNoTrans( 'categorytree-page-bullet' );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to