Revision: 45988
Author:   simetrical
Date:     2009-01-22 00:11:23 +0000 (Thu, 22 Jan 2009)

Log Message:
-----------
Use HTML5 rel attributes for some links

http://dev.w3.org/html5/spec/#linkTypes

Probably doesn't do much, but looks cool.  :)

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/Pager.php
    trunk/phase3/includes/Skin.php
    trunk/phase3/includes/SkinTemplate.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2009-01-21 23:58:15 UTC (rev 45987)
+++ trunk/phase3/RELEASE-NOTES  2009-01-22 00:11:23 UTC (rev 45988)
@@ -51,6 +51,7 @@
 * (bug 11644) Add $wgMaxRedirects variable to control how many redirects are 
recursed
   through until the "destination" page is reached.
 * Add $wgInvalidRedirectTargets variable to prevent redirects to certain 
special pages.
+* Use HTML5 rel attributes for some links, where appropriate
   
 === Bug fixes in 1.15 ===
 * (bug 16968) Special:Upload no longer throws useless warnings.

Modified: trunk/phase3/includes/Pager.php
===================================================================
--- trunk/phase3/includes/Pager.php     2009-01-21 23:58:15 UTC (rev 45987)
+++ trunk/phase3/includes/Pager.php     2009-01-22 00:11:23 UTC (rev 45988)
@@ -304,20 +304,18 @@
                if ( $query === null ) {
                        return $text;
                }
-               if( $type == 'prev' || $type == 'next' ) {
-                       $attrs = "rel=\"$type\"";
-               } elseif( $type == 'first' ) {
-                       $attrs = "rel=\"start\"";
-               } else {
-                       # HTML 4 has no rel="end" . . .
-                       $attrs = '';
+
+               $attrs = array();
+               if( in_array( $type, array( 'first', 'prev', 'next', 'last' ) ) 
) {
+                       # HTML5 rel attributes
+                       $attrs['rel'] = $type;
                }
 
                if( $type ) {
-                       $attrs .= " class=\"mw-{$type}link\"" ;
+                       $attrs['class'] = "mw-{$type}link";
                }
-               return $this->getSkin()->makeKnownLinkObj( $this->getTitle(), 
$text,
-                       wfArrayToCGI( $query, $this->getDefaultQuery() ), '', 
'', $attrs );
+               return $this->getSkin()->link( $this->getTitle(), $text,
+                       $attrs, $query + $this->getDefaultQuery(), 'known' );
        }
 
        /**

Modified: trunk/phase3/includes/Skin.php
===================================================================
--- trunk/phase3/includes/Skin.php      2009-01-21 23:58:15 UTC (rev 45987)
+++ trunk/phase3/includes/Skin.php      2009-01-22 00:11:23 UTC (rev 45988)
@@ -1566,8 +1566,8 @@
        function historyLink() {
                global $wgTitle;
 
-               return $this->makeKnownLinkObj( $wgTitle,
-                 wfMsg( 'history' ), 'action=history' );
+               return $this->link( $wgTitle, wfMsg( 'history' ),
+                       array( 'rel' => 'archives' ), array( 'action' => 
'history' ) );
        }
 
        function whatLinksHere() {

Modified: trunk/phase3/includes/SkinTemplate.php
===================================================================
--- trunk/phase3/includes/SkinTemplate.php      2009-01-21 23:58:15 UTC (rev 
45987)
+++ trunk/phase3/includes/SkinTemplate.php      2009-01-22 00:11:23 UTC (rev 
45988)
@@ -710,7 +710,8 @@
                                $content_actions['history'] = array(
                                        'class' => ($action == 'history') ? 
'selected' : false,
                                        'text' => wfMsg('history_short'),
-                                       'href' => $this->mTitle->getLocalUrl( 
'action=history')
+                                       'href' => $this->mTitle->getLocalUrl( 
'action=history' ),
+                                       'rel' => 'archives',
                                );
 
                                if( $wgUser->isAllowed('delete') ) {



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

Reply via email to