Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d18722b9
Commit
d18722b9
authored
Jan 02, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not cache <img> tags for navigation icons as agressively; this fixes
bug #127151.
parent
7ee67a12
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
31 deletions
+36
-31
Doc/perl/l2hinit.perl
Doc/perl/l2hinit.perl
+36
-31
No files found.
Doc/perl/l2hinit.perl
View file @
d18722b9
...
@@ -107,39 +107,39 @@ sub make_nav_sectref {
...
@@ -107,39 +107,39 @@ sub make_nav_sectref {
return '';
return '';
}
}
sub make_my_icon {
@my_icon_tags = ();
my($name, $text) = @_;
$my_icon_tags{'next'} = 'Next Page';
$my_icon_tags{'next_page'} = 'Next Page';
$my_icon_tags{'previous'} = 'Previous Page';
$my_icon_tags{'previous_page'} = 'Previous Page';
$my_icon_tags{'up'} = 'Up One Level';
$my_icon_tags{'contents'} = 'Contents';
$my_icon_tags{'index'} = 'Index';
$my_icon_tags{'modules'} = 'Module Index';
sub get_my_icon {
my $name = @_[0];
my $text = $my_icon_tags{$name};
if ($text eq '') {
$name = 'blank';
}
my $iconserver = ($ICONSERVER eq '.') ? '' : "$ICONSERVER/";
my $iconserver = ($ICONSERVER eq '.') ? '' : "$ICONSERVER/";
return "
<img
src=
\"$iconserver$name.$IMAGE_TYPE\"
border=
\"0\""
return "
<img
src=
\"$iconserver$name.$IMAGE_TYPE\"
\n
border=
\"0\""
.
"
height=
\"32\"\n
alt=
\"$text\"
width=
\"32\"
>
";
.
"
height=
\"32\"\n
alt=
\"$text\"
width=
\"32\"
>
";
}
}
$BLANK_ICON = make_my_icon('blank', '');
@my_icons = ();
$my_icons{'next_page_inactive'} = $BLANK_ICON;
$my_icons{'previous_page_inactive'} = $BLANK_ICON;
$my_icons{'up_page_inactive'} = $BLANK_ICON;
$x = make_my_icon('next', 'Next Page');
$my_icons{'next_page'} = $x;
$my_icons{'next'} = $x;
$x = make_my_icon('previous', 'Previous Page');
$my_icons{'previous_page'} = $x;
$my_icons{'previous'} = $x;
$my_icons{'up'} = make_my_icon('up', 'Up One Level');
$my_icons{'contents'} = make_my_icon('contents', 'Contents');
$my_icons{'index'} = make_my_icon('index', 'Index');
$my_icons{'modules'} = make_my_icon('modules', 'Module Index');
sub use_my_icon {
sub use_my_icon {
my $s = @_[0];
my $s = @_[0];
$s =~ s/\
<tex2html
_
([
a-z_
]+)
_visible_mark
\
>
/$my_icons{$1}/;
if ($s =~ /\
<tex2html
_
([
a-z_
]+)
_visible_mark
\
>
/) {
my $r = get_my_icon($1);
$s =~ s/\
<tex2html
_
[
a-z_
]+
_visible_mark
\
>
/$r/;
}
return $s;
return $s;
}
}
sub make_nav_panel {
sub make_nav_panel {
my $s;
my $s;
my $BLANK_ICON = get_my_icon('blank');
$NEXT = $NEXT_TITLE ? use_my_icon("$NEXT") : $BLANK_ICON;
$NEXT = $NEXT_TITLE ? use_my_icon("$NEXT") : $BLANK_ICON;
$UP = $UP_TITLE ? use_my_icon("$UP") : $BLANK_ICON;
$UP = $UP_TITLE ? use_my_icon("$UP") : $BLANK_ICON;
$PREVIOUS = $PREVIOUS_TITLE ? use_my_icon("$PREVIOUS") : $BLANK_ICON;
$PREVIOUS = $PREVIOUS_TITLE ? use_my_icon("$PREVIOUS") : $BLANK_ICON;
...
@@ -208,22 +208,25 @@ sub add_link {
...
@@ -208,22 +208,25 @@ sub add_link {
my($icon, $current_file, @link) = @_;
my($icon, $current_file, @link) = @_;
my($dummy, $file, $title) = split($delim,
my($dummy, $file, $title) = split($delim,
$section_info{join(' ',@link)});
$section_info{join(' ',@link)});
$icon =~ s/\
<tex2html
_
([
_a-z
]+)
_visible_mark
\
>
/$my_icons{$1}/;
if ($icon =~ /\
<tex2html
_
([
_a-z
]+)
_visible_mark
\
>
/) {
my $r = get_my_icon($1);
$icon =~ s/\
<tex2html
_
[
_a-z
]+
_visible_mark
\
>
/$r/;
}
if ($title
&&
($file ne $current_file)) {
if ($title
&&
($file ne $current_file)) {
$title = purify($title);
$title = purify($title);
$title = get_first_words($title, $WORDS_IN_NAVIGATION_PANEL_TITLES);
$title = get_first_words($title, $WORDS_IN_NAVIGATION_PANEL_TITLES);
return (make_href($file, $icon), make_href($file, "$title"))
return (make_href($file, $icon), make_href($file, "$title"))
}
}
elsif ($icon eq
$my_icons{"up"}
&&
$EXTERNAL_UP_LINK) {
elsif ($icon eq
get_my_icon('up')
&&
$EXTERNAL_UP_LINK) {
return (make_href($EXTERNAL_UP_LINK, $icon),
return (make_href($EXTERNAL_UP_LINK, $icon),
make_href($EXTERNAL_UP_LINK, "$EXTERNAL_UP_TITLE"))
make_href($EXTERNAL_UP_LINK, "$EXTERNAL_UP_TITLE"))
}
}
elsif ($icon eq
$my_icons{"previous"}
elsif ($icon eq
get_my_icon('previous')
&&
$EXTERNAL_PREV_LINK
&&
$EXTERNAL_PREV_TITLE) {
&&
$EXTERNAL_PREV_LINK
&&
$EXTERNAL_PREV_TITLE) {
return (make_href($EXTERNAL_PREV_LINK, $icon),
return (make_href($EXTERNAL_PREV_LINK, $icon),
make_href($EXTERNAL_PREV_LINK, "$EXTERNAL_PREV_TITLE"))
make_href($EXTERNAL_PREV_LINK, "$EXTERNAL_PREV_TITLE"))
}
}
elsif ($icon eq
$my_icons{"next"}
elsif ($icon eq
get_my_icon('next')
&&
$EXTERNAL_DOWN_LINK
&&
$EXTERNAL_DOWN_TITLE) {
&&
$EXTERNAL_DOWN_LINK
&&
$EXTERNAL_DOWN_TITLE) {
return (make_href($EXTERNAL_DOWN_LINK, $icon),
return (make_href($EXTERNAL_DOWN_LINK, $icon),
make_href($EXTERNAL_DOWN_LINK, "$EXTERNAL_DOWN_TITLE"))
make_href($EXTERNAL_DOWN_LINK, "$EXTERNAL_DOWN_TITLE"))
...
@@ -233,7 +236,10 @@ sub add_link {
...
@@ -233,7 +236,10 @@ sub add_link {
sub add_special_link {
sub add_special_link {
my($icon, $file, $current_file) = @_;
my($icon, $file, $current_file) = @_;
$icon =~ s/\
<tex2html
_
([
_a-z
]+)
_visible_mark
\
>
/$my_icons{$1}/;
if ($icon =~ /\
<tex2html
_
([
_a-z
]+)
_visible_mark
\
>
/) {
my $r = get_my_icon($1);
$icon =~ s/\
<tex2html
_
[
_a-z
]+
_visible_mark
\
>
/$r/;
}
return (($file
&&
($file ne $current_file))
return (($file
&&
($file ne $current_file))
? make_href($file, $icon)
? make_href($file, $icon)
: undef)
: undef)
...
@@ -320,8 +326,7 @@ sub add_module_idx {
...
@@ -320,8 +326,7 @@ sub add_module_idx {
}
}
close(MODIDXFILE);
close(MODIDXFILE);
if (!$allthesame) {
if (!$allthesame) {
$prefix =
<
<
PLAT_DISCUSS
;
$prefix .=
<
<
PLAT_DISCUSS
;
<
p
>
Some module names are followed by an annotation indicating what
<
p
>
Some module names are followed by an annotation indicating what
platform they are available on.
</p>
platform they are available on.
</p>
...
@@ -462,11 +467,11 @@ sub add_bbl_and_idx_dummy_commands {
...
@@ -462,11 +467,11 @@ sub add_bbl_and_idx_dummy_commands {
s/$rx/\\textohtmlmoduleindex \1 \\textohtmlindex \2/o;
s/$rx/\\textohtmlmoduleindex \1 \\textohtmlindex \2/o;
# Add a button to the navigation areas:
# Add a button to the navigation areas:
$CUSTOM_BUTTONS .= ('
<a
href=
"modindex.html"
title=
"Module Index"
>
'
$CUSTOM_BUTTONS .= ('
<a
href=
"modindex.html"
title=
"Module Index"
>
'
.
$my_icons{'modules'}
.
get_my_icon('modules')
. '
</a>
');
. '
</a>
');
}
}
else {
else {
$CUSTOM_BUTTONS .=
$BLANK_ICON
;
$CUSTOM_BUTTONS .=
get_my_icon('blank')
;
$global{'max_id'} = $id; # not sure why....
$global{'max_id'} = $id; # not sure why....
s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o;
s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o;
s/[\\]printindex/\\textohtmlindex /o;
s/[\\]printindex/\\textohtmlindex /o;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment