summaryrefslogtreecommitdiffstats
path: root/Doc/perl/l2hinit.perl
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2003-05-03 02:07:22 (GMT)
committerFred Drake <fdrake@acm.org>2003-05-03 02:07:22 (GMT)
commit8b34e7cc402d1db5694525bd04d9c4b2a8b8b90f (patch)
treed7332a10b0acf0a785223a0298a1fd9a1c36afac /Doc/perl/l2hinit.perl
parentd77bee14760fb09612d4b0580c5fe797cb9c6ebd (diff)
downloadcpython-8b34e7cc402d1db5694525bd04d9c4b2a8b8b90f.zip
cpython-8b34e7cc402d1db5694525bd04d9c4b2a8b8b90f.tar.gz
cpython-8b34e7cc402d1db5694525bd04d9c4b2a8b8b90f.tar.bz2
- add title attributes to the navigation icons on the navigation bars;
this causes some browsers to offer descriptive tooltips when the mouse hovers over the linked icon - clean up the code in this area
Diffstat (limited to 'Doc/perl/l2hinit.perl')
-rw-r--r--Doc/perl/l2hinit.perl42
1 files changed, 27 insertions, 15 deletions
diff --git a/Doc/perl/l2hinit.perl b/Doc/perl/l2hinit.perl
index 6e4b0cb..0ecb693 100644
--- a/Doc/perl/l2hinit.perl
+++ b/Doc/perl/l2hinit.perl
@@ -141,27 +141,39 @@ sub get_my_icon($) {
. " height='32' alt='$text' width='32'>";
}
-sub use_my_icon($$) {
- my($s,$rel) = @_;
- if ($s =~ /\<tex2html_([a-z_]+)_visible_mark\>/) {
- my $r = get_my_icon($1);
- $s =~ s/\<tex2html_[a-z_]+_visible_mark\>/$r/;
+sub unlinkify($) {
+ my $text = "$_[0]";
+ $text =~ s|</[aA]>||;
+ $text =~ s|<a\s+[^>]*>||i;
+ return $text;
+}
+
+sub use_icon($$$) {
+ my($rel,$str,$title) = @_;
+ if ($title) {
+ my $s = "$str";
+ if ($s =~ /\<tex2html_([a-z_]+)_visible_mark\>/) {
+ my $r = get_my_icon($1);
+ $s =~ s/\<tex2html_[a-z_]+_visible_mark\>/$r/;
+ }
+ $s =~ s/<[aA] /<a rel="$rel" title="$title" \n /;
+ return $s;
+ }
+ else {
+ return get_my_icon('blank');
}
- $s =~ s/<[aA] /<a rel="$rel" /;
- return $s;
}
sub make_nav_panel() {
my $s;
- my $BLANK_ICON = get_my_icon('blank');
- $NEXT = $NEXT_TITLE ? use_my_icon("$NEXT", 'next') : $BLANK_ICON;
- $UP = $UP_TITLE ? use_my_icon("$UP", 'parent') : $BLANK_ICON;
- $PREVIOUS = ($PREVIOUS_TITLE
- ? use_my_icon("$PREVIOUS", 'prev') : $BLANK_ICON);
- $CONTENTS = use_my_icon("$CONTENTS", 'contents');
- $INDEX = $INDEX ? use_my_icon("$INDEX", 'index') : $BLANK_ICON;
+ # new iconic rel iconic page title
+ $NEXT = use_icon('next', $NEXT, unlinkify($NEXT_TITLE));
+ $UP = use_icon('parent', $UP, unlinkify($UP_TITLE));
+ $PREVIOUS = use_icon('prev', $PREVIOUS, unlinkify($PREVIOUS_TITLE));
+ $CONTENTS = use_icon('contents', $CONTENTS, 'Table of Contents');
+ $INDEX = use_icon('index', $INDEX, 'Index');
if (!$CUSTOM_BUTTONS) {
- $CUSTOM_BUTTONS = $BLANK_ICON;
+ $CUSTOM_BUTTONS = get_my_icon('blank');
}
$s = ('<table align="center" width="100%" cellpadding="0" cellspacing="2">'
. "\n<tr>"