From 464265fce2ffc180e2c2f95b439c2d75fecaddc2 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Wed, 8 May 2013 22:16:22 +0200 Subject: [PATCH] Add access keys for articles and comments, if enabled. If $CommentsPrefix is set, the wiki knows about article pages and comment pages. The link in GetFooterLinks now uses 'a' and 'c' as access keys. The access key is passed to GetPageLink and to ScriptLink. --- wiki.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wiki.pl b/wiki.pl index 44259731..e5854ba4 100755 --- a/wiki.pl +++ b/wiki.pl @@ -1162,11 +1162,12 @@ sub GetPageOrEditLink { # use GetPageLink and GetEditLink if you know the result } sub GetPageLink { # use if you want to force a link to local pages, whether it exists or not - my ($id, $name, $class) = @_; + my ($id, $name, $class, $accesskey) = @_; $id = FreeToNormal($id); $name = $id unless $name; $class .= ' ' if $class; - return ScriptLink(UrlEncode($id), NormalToFree($name), $class . 'local'); + return ScriptLink(UrlEncode($id), NormalToFree($name), $class . 'local', + undef, undef, $accesskey); } sub GetEditLink { # shortcut @@ -1996,8 +1997,7 @@ sub DoHistory { } @html = (GetFormStart(undef, 'get', 'history'), $q->p($q->submit({-name=>T('Compare')}), - # don't use $q->hidden here, the sticky action - # value will be used instead + # don't use $q->hidden here! $q->input({-type=>'hidden',-name=>'action',-value=>'browse'}), $q->input({-type=>'hidden', -name=>'diff', -value=>'1'}), $q->input({-type=>'hidden', -name=>'id', -value=>$id})), @@ -2399,9 +2399,9 @@ sub GetFooterLinks { if ($id and $rev ne 'history' and $rev ne 'edit') { if ($CommentsPrefix) { if ($id =~ /^$CommentsPrefix(.*)/o) { - push(@elements, GetPageLink($1, undef, 'original')); + push(@elements, GetPageLink($1, undef, 'original', T('a'))); } else { - push(@elements, GetPageLink($CommentsPrefix . $id, undef, 'comment')); + push(@elements, GetPageLink($CommentsPrefix . $id, undef, 'comment', T('c'))); } } if (UserCanEdit($id, 0)) {