source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: cvsweb: There is no point in making icons configurable, except for their
Date: Fri, 29 Nov 2019 11:27:36 -0500 (EST)	[thread overview]
Message-ID: <8d079ab368b7e1ac@mandoc.bsd.lv> (raw)

Log Message:
-----------
There is no point in making icons configurable, except for their location.

Modified Files:
--------------
    cvsweb:
        cvsweb.cgi
        cvsweb.conf

Removed Files:
-------------
    cvsweb/icons:
        miniback.gif
        minidir.gif
        minitext.gif

Revision Data
-------------
Index: cvsweb.conf
===================================================================
RCS file: /home/cvs/mandoc/cvsweb/cvsweb.conf,v
retrieving revision 4.20
retrieving revision 4.21
diff -Lcvsweb.conf -Lcvsweb.conf -u -p -r4.20 -r4.21
--- cvsweb.conf
+++ cvsweb.conf
@@ -119,23 +119,8 @@ $defaulttitle = "CVS Repository";
 #
 $address = '<span style="font-size: smaller">CVSweb</span>';
 
-# Icons for the web UI.  If ICON-URL is empty, the TEXT representation is
-# used.  If you do not want to have a tool tip for an icon, set TEXT empty.
-# The width and height of the icon allow the browser to correctly display
-# the table while still loading the icons.  If these icons are too large,
-# check out the "mini" versions in the icons/ directory; they have a
-# width/height of 16/16.
-#
+# Icons for the web UI.
 my $iconsdir = '/icons';
-
-# format:          TEXT       ICON-URL                  width height
-%ICONS = (
-     back    => [('[BACK]',   "$iconsdir/back.gif",      20,   22)],
-     dir     => [('[DIR]',    "$iconsdir/dir.gif",       20,   22)],
-     file    => [('[TXT]',    "$iconsdir/text.gif",      20,   22)],
-     binfile => [('[BIN]',    "$iconsdir/binary.gif",    20,   22)],
-);
-undef $iconsdir;
 
 # An URL where to find the CSS.
 #
Index: cvsweb.cgi
===================================================================
RCS file: /home/cvs/mandoc/cvsweb/cvsweb.cgi,v
retrieving revision 4.32
retrieving revision 4.33
diff -Lcvsweb.cgi -Lcvsweb.cgi -u -p -r4.32 -r4.33
--- cvsweb.cgi
+++ cvsweb.cgi
@@ -56,8 +56,7 @@ use filetest qw(access);
 use vars qw (
   $VERSION $CheckoutMagic $MimeTypes $DEBUG
   $config $allow_version_select
-  @CVSrepositories @CVSROOT %CVSROOT %CVSROOTdescr
-  %DEFAULTVALUE %ICONS %MTYPES
+  @CVSrepositories @CVSROOT %CVSROOT %CVSROOTdescr %DEFAULTVALUE %MTYPES
   %DIFF_COMMANDS @DIFFTYPES %DIFFTYPES @LOGSORTKEYS %LOGSORTKEYS
   %alltags %fileinfo %tags @branchnames %nameprinted
   %symrev %revsym @allrevisions %date %author @revdisplayorder
@@ -68,7 +67,7 @@ use vars qw (
   %input $query $barequery $sortby $bydate $byrev $byauthor
   $bylog $byfile $defaultDiffType $logsort $cvstree $cvsroot
   $charset $output_filter %CMD $allow_compress $backicon $diricon $fileicon
-  $fullname $logo $defaulttitle $address $binfileicon
+  $fullname $logo $defaulttitle $address $binfileicon $iconsdir
   $shortLogLen $show_author
   $tablepadding $hr_breakable $showfunc $hr_ignwhite $hr_ignkeysubst
   $inputTextSize $mime_types $allow_annotate $allow_markup $allow_mailtos
@@ -199,7 +198,7 @@ $config = '/conf/cvsweb/cvsweb.conf';
 
 ######## Configuration parameters #########
 
-@CVSrepositories = @CVSROOT = %CVSROOT = %DEFAULTVALUE = %ICONS =
+@CVSrepositories = @CVSROOT = %CVSROOT = %DEFAULTVALUE =
   %MTYPES = %tags = %alltags = %fileinfo = %DIFF_COMMANDS = ();
 
 $logo = $defaulttitle =
@@ -572,17 +571,20 @@ if ($input{cvsroot} && $CVSROOT{$input{c
 
 $cvsroot = $CVSROOT{$cvstree};
 
-# create icons out of description
-foreach my $k (keys %ICONS) {
-  my ($itxt, $ipath, $iwidth, $iheight) = @{$ICONS{$k}};
-  no strict 'refs';
-  if ($ipath) {
-    ${"${k}icon"} =
-      sprintf('<img src="%s" alt="%s" border="0" width="%d" height="%d" />',
-              htmlquote($ipath), htmlquote($itxt), $iwidth, $iheight);
-  } else {
-    ${"${k}icon"} = $itxt;
-  }
+if ($iconsdir) {
+  $backicon = '<img src="' . $iconsdir . '/back.gif" alt="[BACK]"' .
+    ' border="0" width="20" height="22"/>';
+  $diricon = '<img src="' . $iconsdir . '/dir.gif" alt="[DIR]"' .
+    ' border="0" width="20" height="22"/>';
+  $fileicon = '<img src="' . $iconsdir . '/text.gif" alt="[TXT]"' .
+    ' border="0" width="20" height="22"/>';
+  $binfileicon = '<img src="' . $iconsdir . '/binary.gif" alt="[BIN]"' .
+    ' border="0" width="20" height="22"/>';
+} else {
+  $backicon = 'back';
+  $diricon = 'dir';
+  $fileicon = 'file';
+  $binfileicon = 'binfile';
 }
 
 my $config_cvstree = "$config-$cvstree";
Binary files - and /dev/null differ
Binary files - and /dev/null differ
Binary files - and /dev/null differ
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2019-11-29 16:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d079ab368b7e1ac@mandoc.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).