commit 888e72b9705792259d0551a4b626c31ab3011539 parent 47278249fc4ec2c8f0cdf2389fae2953ecd000a0 Author: Yohanes Bandung <bandungpenting@gmail.com> Date: Thu, 14 May 2020 22:56:22 +0700 style: commit file independent scroll and colorings style: more mobile friendly commit file more independent scroll Diffstat:
| M | stagit.c | | | 11 | ++++++----- |
| M | style.css | | | 6 | ++++-- |
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/stagit.c b/stagit.c @@ -524,12 +524,13 @@ printshowfile(FILE *fp, struct commitinfo *ci) fwrite(&linestr[add], 1, del, fp); fputs("</span></td></tr>\n", fp); } - fprintf(fp, "</table></pre><pre>%zu file%s changed, %zu insertion%s(+), %zu deletion%s(-)\n", - ci->filecount, ci->filecount == 1 ? "" : "s", + fprintf(fp, "</table></pre></div><p>%zu file%s changed, %zu insertion%s(<span id=\"plus\">+</span>)" + ", %zu deletion%s(<span id=\"min\">-</span>)</p>\n", + ci->filecount, ci->filecount == 1 ? "" : "s", ci->addcount, ci->addcount == 1 ? "" : "s", ci->delcount, ci->delcount == 1 ? "" : "s"); - fputs("<hr/>", fp); + fputs("<div id=\"pre-scroll\">\n<pre>\n", fp); for (i = 0; i < ci->ndeltas; i++) { patch = ci->deltas[i]->patch; @@ -658,9 +659,9 @@ writelog(FILE *fp, const git_oid *oid) relpath = "../"; fpfile = efopen(path, "w"); writeheader(fpfile, ci->summary); - fputs("<pre>", fpfile); + fputs("<div id=\"pre-scroll\">\n<pre>", fpfile); printshowfile(fpfile, ci); - fputs("</pre>\n", fpfile); + fputs("</pre>\n</div>\n", fpfile); writefooter(fpfile); fclose(fpfile); } diff --git a/style.css b/style.css @@ -21,7 +21,7 @@ a { color: #8DBFFF; } -a:hover { +min, a:hover { color: #F9690E; } @@ -53,7 +53,7 @@ table td { padding: 0 0.4em; } -#blob, div#table-scroll { +#blob, div#table-scroll, div#pre-scroll { overflow: scroll; padding-bottom: 3em; } @@ -101,12 +101,14 @@ pre a.h { } .A, +#plus, span.i, pre a.i { color: #79D688; } .D, +#min, span.d, pre a.d { color: #F9690E;