Commit 4a2a78b6 authored by Fred Drake's avatar Fred Drake

$OFF_SITE_LINK_ICON: Don't define here; simply defining it overrides a

        definition provided by previously loaded configuration code, and
        testing whether it's defined isn't needed since the default was
        false anyway.

get_link_icon():  Add support for $OFF_SITE_LINK_ICON_HEIGHT and
        $OFF_SITE_LINK_ICON_WIDTH, giving the dimensions of the icon
        being used.  This can make for faster page display.  Both are
        optional.

make_my_titlegraphic():  Fix insertion of the off-site icon link.

do_env_funcdesc():  Remove debugging print.

handle_rfclike_reference():  Remove trailing colon from first line; it
        doesn't really make sense and looks bad if we add an icon to
        mark off-site links.
parent 8e849093
...@@ -36,15 +36,20 @@ sub make_icon_filename($){ ...@@ -36,15 +36,20 @@ sub make_icon_filename($){
return "$mydir$dd$myname$myext"; return "$mydir$dd$myname$myext";
} }
$OFF_SITE_LINK_ICON = '';
sub get_link_icon($){ sub get_link_icon($){
my $url = @_[0]; my $url = @_[0];
if ($OFF_SITE_LINK_ICON && ($url =~ /^[-a-zA-Z0-9.]+:/)) { if ($OFF_SITE_LINK_ICON && ($url =~ /^[-a-zA-Z0-9.]+:/)) {
# absolute URL; assume it points off-site # absolute URL; assume it points off-site
my $icon = make_icon_filename($OFF_SITE_LINK_ICON); my $icon = make_icon_filename($OFF_SITE_LINK_ICON);
return (" <img src='$icon'\n" return (" <img src='$icon'\n"
. " height='12' width='15' border='0' alt='[off-site link]'\n" . " border='0' class='offsitelink'"
. ($OFF_SITE_LINK_ICON_HEIGHT
? " height='$OFF_SITE_LINK_ICON_HEIGHT'"
: '')
. ($OFF_SITE_LINK_ICON_WIDTH
? " width='$OFF_SITE_LINK_ICON_WIDTH'"
: '')
. " alt='[off-site link]'\n"
. " >"); . " >");
} }
return ''; return '';
...@@ -769,7 +774,6 @@ sub do_env_funcdesc{ ...@@ -769,7 +774,6 @@ sub do_env_funcdesc{
my $arg_list = convert_args(next_argument()); my $arg_list = convert_args(next_argument());
my $idx = make_str_index_entry("<tt class='function'>$function_name()</tt>" my $idx = make_str_index_entry("<tt class='function'>$function_name()</tt>"
. get_indexsubitem()); . get_indexsubitem());
print "\n--- funcdesc arg_list:\n$arg_list\n===";
$idx =~ s/ \(.*\)//; $idx =~ s/ \(.*\)//;
$idx =~ s/\(\)<\/tt>/<\/tt>/; $idx =~ s/\(\)<\/tt>/<\/tt>/;
return "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_ . '</dl>'; return "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_ . '</dl>';
...@@ -1293,7 +1297,7 @@ sub make_my_titlegraphic() { ...@@ -1293,7 +1297,7 @@ sub make_my_titlegraphic() {
if ($TITLE_PAGE_GRAPHIC_WIDTH); if ($TITLE_PAGE_GRAPHIC_WIDTH);
$graphic .= " height=\"$TITLE_PAGE_GRAPHIC_HEIGHT\"" $graphic .= " height=\"$TITLE_PAGE_GRAPHIC_HEIGHT\""
if ($TITLE_PAGE_GRAPHIC_HEIGHT); if ($TITLE_PAGE_GRAPHIC_HEIGHT);
$graphic .= "\n src=\"$mydir/$myname$myext\"></td>\n"; $graphic .= "\n src=\"$filename\"></td>\n";
return $graphic; return $graphic;
} }
...@@ -1480,7 +1484,7 @@ sub handle_rfclike_reference{ ...@@ -1480,7 +1484,7 @@ sub handle_rfclike_reference{
return '<dl compact class="seerfc">' return '<dl compact class="seerfc">'
. "\n <dt><a href=\"$url\"" . "\n <dt><a href=\"$url\""
. "\n title=\"$title\"" . "\n title=\"$title\""
. "\n >$what $rfcnum, <em>$title</em>$icon</a>:" . "\n >$what $rfcnum, <em>$title</em>$icon</a>"
. "\n <dd>$text\n </dl>" . "\n <dd>$text\n </dl>"
. $_; . $_;
} }
...@@ -1498,8 +1502,8 @@ sub do_cmd_seetitle{ ...@@ -1498,8 +1502,8 @@ sub do_cmd_seetitle{
my $url = next_optional_argument(); my $url = next_optional_argument();
my $title = next_argument(); my $title = next_argument();
my $text = next_argument(); my $text = next_argument();
my $icon = get_link_icon($url);
if ($url) { if ($url) {
my $icon = get_link_icon($url);
return '<dl compact class="seetitle">' return '<dl compact class="seetitle">'
. "\n <dt><em class=\"citetitle\"><a href=\"$url\"" . "\n <dt><em class=\"citetitle\"><a href=\"$url\""
. "\n >$title$icon</a></em>" . "\n >$title$icon</a></em>"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment