cookutils rev 972
lighttpd/index.cgi, lighttpd/cooker.css: another way to display log.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Sep 29 02:53:23 2017 +0300 (2017-09-29) |
parents | c901a79a33b0 |
children | 16d5ef60f3d6 |
files | lighttpd/cooker.css lighttpd/index.cgi |
line diff
1.1 --- a/lighttpd/cooker.css Fri Sep 29 01:39:37 2017 +0300 1.2 +++ b/lighttpd/cooker.css Fri Sep 29 02:53:23 2017 +0300 1.3 @@ -146,6 +146,42 @@ 1.4 } 1.5 pre .underline { border-bottom: 1px solid #444; display: block; right: 0; } 1.6 1.7 +/* Log with line numbers (taken from Mercurial - thanks a lot) */ 1.8 +pre.log { 1.9 + position: relative; 1.10 + counter-reset: lineno; 1.11 +} 1.12 +pre.log > span { 1.13 + display: inline-block; 1.14 + box-sizing: border-box; 1.15 + width: 100%; 1.16 + padding: 0 0 0 4em; 1.17 + counter-increment: lineno; 1.18 + white-space: pre-wrap; 1.19 +} 1.20 +pre.log > span::before { 1.21 + -moz-user-select: -moz-none; 1.22 + -khtml-user-select: none; 1.23 + -webkit-user-select: none; 1.24 + -ms-user-select: none; 1.25 + user-select: none; 1.26 + display: inline-block; 1.27 + margin-left: -5em; 1.28 + width: 4em; 1.29 + font-size: smaller; 1.30 + color: #999; 1.31 + text-align: right; 1.32 + content: counters(lineno, "."); 1.33 + float: left; 1.34 +} 1.35 +pre.log > a { 1.36 + display: inline-block; 1.37 + position: absolute; 1.38 + left: 0; 1.39 + width: 4em; 1.40 + height: 1em; 1.41 +} 1.42 + 1.43 /* Content */ 1.44 1.45 main {
2.1 --- a/lighttpd/index.cgi Fri Sep 29 01:39:37 2017 +0300 2.2 +++ b/lighttpd/index.cgi Fri Sep 29 02:53:23 2017 +0300 2.3 @@ -1367,7 +1367,7 @@ 2.4 sed -e "/(pkg\/local$theme):/ s|: \([^<]*\)|<img src='$base/i/$blog/\1'> \1|" | \ 2.5 awk ' 2.6 BEGIN { print "<pre class=\"log\">"; } 2.7 - { printf("<a name=\"l%d\" href=\"#l%d\">%5d</a> %s\n", NR, NR, NR, $0); } 2.8 + { printf("<span id=\"l%d\">%s</span><a href=\"#l%d\"></a>\n", NR, $0, NR); } 2.9 END { print "</pre>"; } 2.10 ' 2.11 ;;