source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* cvsweb: There is no point in making icons configurable, except for their
@ 2019-11-29 16:27 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-11-29 16:27 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-29 16:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-29 16:27 cvsweb: There is no point in making icons configurable, except for their schwarze

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).