cookutils rev 928

lighttpd/index.cgi: files: improve quick jump links.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Jun 15 03:28:08 2017 +0300 (2017-06-15)
parents d98fc9c17c0f
children 51eafb844ec4
files lighttpd/index.cgi
line diff
     1.1 --- a/lighttpd/index.cgi	Wed Jun 14 13:26:21 2017 +0300
     1.2 +++ b/lighttpd/index.cgi	Thu Jun 15 03:28:08 2017 +0300
     1.3 @@ -1079,8 +1079,8 @@
     1.4  
     1.5  		echo "<section><h3>Quick jump:</h3><ul>"
     1.6  		echo "$split" | sed 'p' | xargs printf "<li><a href='#id-%s'>%s</a></li>\n"
     1.7 -		echo "<li><a href='#id-repeats'>repeatedly packaged files</a> (if any)</li>"
     1.8 -		echo "<li><a href='#id-orphans'>unpackaged files</a> (if any)</li>"
     1.9 +		echo "<li id='li-repeats' style='display:none'><a href='#id-repeats'>repeatedly packaged files</a></li>"
    1.10 +		echo "<li id='li-orphans' style='display:none'><a href='#id-orphans'>unpackaged files</a></li>"
    1.11  		echo "</ul></section>"
    1.12  
    1.13  		for p in $split; do
    1.14 @@ -1115,6 +1115,7 @@
    1.15  		# find repeatedly packaged files
    1.16  		repeats="$(sort $packaged | uniq -d)"
    1.17  		if [ -n "$repeats" ]; then
    1.18 +			echo '<script>document.getElementById("li-repeats").style.display = "list-item"</script>'
    1.19  			echo -n '<section><h3 id="id-repeats">Repeatedly packaged files:</h3><pre class="files">'
    1.20  			echo "$repeats" | sed 's|^|<span class="c11">!!!</span> |'
    1.21  			echo "</pre></section>"
    1.22 @@ -1125,6 +1126,7 @@
    1.23  		cd $wok/$main/install; find ! -type d | sed 's|\.||' > $all_files
    1.24  		orphans="$(sort $all_files $packaged | uniq -u)"
    1.25  		if [ -d "$wok/$main/install" -a -n "$orphans" ]; then
    1.26 +			echo '<script>document.getElementById("li-orphans").style.display = "list-item"</script>'
    1.27  			echo '<section><h3 id="id-orphans">Unpackaged files:</h3>'
    1.28  			table=$(mktemp)
    1.29  			echo "$orphans" | awk -vi="$base/$indir/browse/install" '