From a79d95c567f023f4209fe09c94483d9457a36e6b Mon Sep 17 00:00:00 2001 From: Nikolay Govorov Date: Sun, 30 Aug 2026 01:20:18 +0100 Subject: Unify ci checks --- .editorconfig | 26 + .github/workflows/build.yml | 15 +- .github/workflows/legal.yml | 1 - .gitignore | 5 +- CODEOWNERS | 2 +- REUSE.toml | 4 +- assets/favicon.ico | Bin 1078 -> 0 bytes assets/gilti.css | 918 -------------------------------- assets/gilti.js | 72 --- assets/gilti.png | Bin 1366 -> 0 bytes crates/gilti/Cargo.toml | 2 +- crates/gilti/assets/favicon.ico | Bin 0 -> 1078 bytes crates/gilti/assets/gilti.css | 918 ++++++++++++++++++++++++++++++++ crates/gilti/assets/gilti.js | 72 +++ crates/gilti/assets/gilti.png | Bin 0 -> 1366 bytes mise.toml | 6 +- scripts/build-artifacts.sh | 8 +- 17 files changed, 1038 insertions(+), 1011 deletions(-) create mode 100644 .editorconfig delete mode 100644 assets/favicon.ico delete mode 100644 assets/gilti.css delete mode 100644 assets/gilti.js delete mode 100644 assets/gilti.png create mode 100644 crates/gilti/assets/favicon.ico create mode 100644 crates/gilti/assets/gilti.css create mode 100644 crates/gilti/assets/gilti.js create mode 100644 crates/gilti/assets/gilti.png diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..fa7d6d2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-License-Identifier: AGPL-3.0-or-later + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 + +[*.md] +# double whitespace at end of line +# denotes a line break in Markdown +trim_trailing_whitespace = false + +[*.rs] +max_line_length = 100 + +[*.yml] +indent_size = 2 + +[{Makefile,*.mk}] +indent_style = tab diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d16f7f..09866d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,8 +17,12 @@ concurrency: group: gilti-build-${{ github.ref }} cancel-in-progress: true +env: + CARGO_TERM_COLOR: always + RELEASE_TAG: nightly + jobs: - check: + lint: name: Static checks runs-on: ubuntu-latest steps: @@ -33,15 +37,16 @@ jobs: run: mise bootstrap --locked --yes --update - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 - - name: Check formatting + - name: formatting run: cargo fmt --all --check - - run: shellcheck scripts/*.sh tests/*.sh + - name: shellcheck + run: shellcheck scripts/*.sh tests/*.sh build: name: Build (${{ matrix.arch }}) runs-on: ${{ matrix.runner }} - needs: [check] + needs: [lint] strategy: fail-fast: false matrix: @@ -62,7 +67,7 @@ jobs: run: mise bootstrap --locked --yes --update - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 - - run: cargo clippy --locked --all-targets --all-features --release -- -D warnings + - run: cargo clippy --workspace --locked --all-targets --all-features --release -- -D warnings - run: cargo test --all-features --release --locked - run: tests/chart.sh diff --git a/.github/workflows/legal.yml b/.github/workflows/legal.yml index 0336344..8a739c4 100644 --- a/.github/workflows/legal.yml +++ b/.github/workflows/legal.yml @@ -6,7 +6,6 @@ name: Legal on: push: branches: [main] - tags: ["v*"] pull_request: branches: [main] diff --git a/.gitignore b/.gitignore index 2127774..bc1d763 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: 2026 Nikolay Govorov # SPDX-License-Identifier: AGPL-3.0-or-later -/.container /dist /target -/.gilti-state mise.local.toml mise.*.local.toml + +/.container +/.gilti-state diff --git a/CODEOWNERS b/CODEOWNERS index 7aeb094..faf8e2e 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2026 Nikolay Govorov # SPDX-License-Identifier: AGPL-3.0-or-later -* @mrdimidium +* @mrdimidium diff --git a/REUSE.toml b/REUSE.toml index 5759d8f..901485f 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -30,8 +30,8 @@ SPDX-License-Identifier = "CC-BY-3.0" [[annotations]] path = [ - "assets/gilti.png", - "assets/favicon.ico", + "crates/gilti/assets/gilti.png", + "crates/gilti/assets/favicon.ico", ] SPDX-FileCopyrightText = "cgit Development Team " SPDX-License-Identifier = "GPL-2.0-only" diff --git a/assets/favicon.ico b/assets/favicon.ico deleted file mode 100644 index 56ff59384f2ce308996d0027bb928c18e2c61785..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmZQzU}RuoP*4zH0D%`w3=C>OT0j88*I;B|;A3WB&;W`l0I>rQGcvFMNd|@npjvF; z|Ns9C0RhJtRg<^2w%koLc6#^Xc+0@0b{MP-o1OzLl-9~e-YS1Ul?BuYCnv> z#KonkqvMJTjNjt&3#2gw%9kpEI8*}4mzx5yR}9J*bMb-L1Lymp@uB{Jhzg3q{6#aq z8`OSCc*w!R4H`aDQy}3Ynvz4-Gxez`(qOVcN923pEhL}vDprG(XphWx5PkxC&dE;ey?|`(_3qip;AboEmP##EM2C5T32%&+h j!F(8fQ5MKogs78y2r*au9mF0%&v&mh1O>7AhZHdY^--`s diff --git a/assets/gilti.css b/assets/gilti.css deleted file mode 100644 index e9a423e..0000000 --- a/assets/gilti.css +++ /dev/null @@ -1,918 +0,0 @@ -/* SPDX-FileCopyrightText: cgit Development Team - * SPDX-License-Identifier: GPL-2.0-only - */ - -div#gilti { - padding: 0em; - margin: 0em; - font-family: sans-serif; - font-size: 10pt; - color: #333; - background: white; - padding: 4px; -} - -div#gilti a { - color: blue; - text-decoration: none; -} - -div#gilti a:hover { - text-decoration: underline; -} - -div#gilti table { - border-collapse: collapse; -} - -div#gilti table#header { - width: 100%; - margin-bottom: 1em; -} - -div#gilti table#header td.logo { - width: 96px; - vertical-align: top; -} - -div#gilti table#header td.main { - font-size: 250%; - padding-left: 10px; - white-space: nowrap; -} - -div#gilti table#header td.main a { - color: #000; -} - -div#gilti table#header td.form { - text-align: right; - vertical-align: bottom; - padding-right: 1em; - padding-bottom: 2px; - white-space: nowrap; -} - -div#gilti table#header td.form form, -div#gilti table#header td.form input, -div#gilti table#header td.form select { - font-size: 90%; -} - -div#gilti table#header td.sub { - color: #777; - border-top: solid 1px #ccc; - padding-left: 10px; -} - -div#gilti table.tabs { - border-bottom: solid 3px #ccc; - border-collapse: collapse; - margin-top: 2em; - margin-bottom: 0px; - width: 100%; -} - -div#gilti table.tabs td { - padding: 0px 1em; - vertical-align: bottom; -} - -div#gilti table.tabs td a { - padding: 2px 0.75em; - color: #777; - font-size: 110%; -} - -div#gilti table.tabs td a.active { - color: #000; - background-color: #ccc; -} - -div#gilti table.tabs a[href^="http://"]:after, div#gilti table.tabs a[href^="https://"]:after { - content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfgAhcJDQY+gm2TAAAAHWlUWHRDb21tZW50AAAAAABDcmVhdGVkIHdpdGggR0lNUGQuZQcAAABbSURBVAhbY2BABs4MU4CwhYHBh2Erww4wrGFQZHjI8B8IgUIscJWyDHcggltQhI4zGDCcRwhChPggHIggP1QoAVmQkSETrGoHsiAEsACtBYN0oDAMbgU6EBcAAL2eHUt4XUU4AAAAAElFTkSuQmCC); - opacity: 0.5; - margin: 0 0 0 5px; -} - -div#gilti table.tabs td.form { - text-align: right; -} - -div#gilti table.tabs td.form form { - padding-bottom: 2px; - font-size: 90%; - white-space: nowrap; -} - -div#gilti table.tabs td.form input, -div#gilti table.tabs td.form select { - font-size: 90%; -} - -div#gilti div.path { - margin: 0px; - padding: 5px 2em 2px 2em; - color: #000; - background-color: #eee; -} - -div#gilti div.content { - margin: 0px; - padding: 2em; - border-bottom: solid 3px #ccc; -} - - -div#gilti table.list { - width: 100%; - border: none; - border-collapse: collapse; -} - -div#gilti table.list tr { - background: white; -} - -div#gilti table.list tr.logheader { - background: #eee; -} - -div#gilti table.list tr:nth-child(even) { - background: #f7f7f7; -} - -div#gilti table.list tr:nth-child(odd) { - background: white; -} - -div#gilti table.list tr:hover { - background: #eee; -} - -div#gilti table.list tr.nohover { - background: white; -} - -div#gilti table.list tr.nohover:hover { - background: white; -} - -div#gilti table.list tr.nohover-highlight:hover:nth-child(even) { - background: #f7f7f7; -} - -div#gilti table.list tr.nohover-highlight:hover:nth-child(odd) { - background: white; -} - -div#gilti table.list th { - font-weight: bold; - /* color: #888; - border-top: dashed 1px #888; - border-bottom: dashed 1px #888; - */ - padding: 0.1em 0.5em 0.05em 0.5em; - vertical-align: baseline; -} - -div#gilti table.list td { - border: none; - padding: 0.1em 0.5em 0.1em 0.5em; -} - -div#gilti table.list td.commitgraph { - font-family: monospace; - white-space: pre; -} - -div#gilti table.list td.commitgraph .column1 { - color: #a00; -} - -div#gilti table.list td.commitgraph .column2 { - color: #0a0; -} - -div#gilti table.list td.commitgraph .column3 { - color: #aa0; -} - -div#gilti table.list td.commitgraph .column4 { - color: #00a; -} - -div#gilti table.list td.commitgraph .column5 { - color: #a0a; -} - -div#gilti table.list td.commitgraph .column6 { - color: #0aa; -} - -div#gilti table.list td.logsubject { - font-family: monospace; - font-weight: bold; -} - -div#gilti table.list td.logmsg { - font-family: monospace; - white-space: pre; - padding: 0 0.5em; -} - -div#gilti table.list td a { - color: black; -} - -div#gilti table.list td a.ls-dir { - font-weight: bold; - color: #00f; -} - -div#gilti table.list td a:hover { - color: #00f; -} - -div#gilti img { - border: none; -} - -div#gilti input#switch-btn { - margin: 2px 0px 0px 0px; -} - -div#gilti td#sidebar input.txt { - width: 100%; - margin: 2px 0px 0px 0px; -} - -div#gilti table#grid { - margin: 0px; -} - -div#gilti td#content { - vertical-align: top; - padding: 1em 2em 1em 1em; - border: none; -} - -div#gilti div#summary { - vertical-align: top; - margin-bottom: 1em; -} - -div#gilti div#summary pre { - margin: 0; - white-space: pre-wrap; -} - -div#gilti table#downloads { - float: right; - border-collapse: collapse; - border: solid 1px #777; - margin-left: 0.5em; - margin-bottom: 0.5em; -} - -div#gilti table#downloads th { - background-color: #ccc; -} - -div#gilti div#blob { - border: solid 1px black; -} - -div#gilti div.error { - color: red; - font-weight: bold; - margin: 1em 2em; -} - -div#gilti a.ls-blob, div#gilti a.ls-dir, div#gilti .ls-mod { - font-family: monospace; -} - -div#gilti td.ls-size { - text-align: right; - font-family: monospace; - width: 10em; -} - -div#gilti td.ls-mode { - font-family: monospace; - width: 10em; -} - -div#gilti table.blob { - margin-top: 0.5em; - border-top: solid 1px black; -} - -div#gilti table.blob td.hashes, -div#gilti table.blob td.lines { - margin: 0; padding: 0 0 0 0.5em; - vertical-align: top; - color: black; -} - -div#gilti table.blob td.linenumbers { - margin: 0; padding: 0 0.5em 0 0.5em; - vertical-align: top; - text-align: right; - border-right: 1px solid gray; -} - -div#gilti table.blob pre { - padding: 0; margin: 0; -} - -div#gilti table.blob td.linenumbers a, -div#gilti table.ssdiff td.lineno a { - color: gray; - text-align: right; - text-decoration: none; -} - -div#gilti table.blob td.linenumbers a:hover, -div#gilti table.ssdiff td.lineno a:hover { - color: black; -} - -div#gilti table.blob td.linenumbers a:target:before { - color: red; - content: "\2BA9"; -} - -div#gilti table.blame td.hashes, -div#gilti table.blame td.lines, -div#gilti table.blame td.linenumbers { - padding: 0; -} - -div#gilti table.blame td.hashes div.alt, -div#gilti table.blame td.lines div.alt { - padding: 0 0.5em 0 0.5em; -} - -div#gilti table.blame td.linenumbers div.alt { - padding: 0 0.5em 0 0; -} - -div#gilti table.blame div.alt:nth-child(even) { - background: #eee; -} - -div#gilti table.blame div.alt:nth-child(odd) { - background: white; -} - -div#gilti table.blame td.lines > div { - position: relative; -} - -div#gilti table.blame td.lines > div > pre { - padding: 0 0 0 0.5em; - position: absolute; - top: 0; -} - -div#gilti table.blame .oid { - font-size: 100%; -} - -div#gilti table.bin-blob { - margin-top: 0.5em; - border: solid 1px black; -} - -div#gilti table.bin-blob th { - font-family: monospace; - white-space: pre; - border: solid 1px #777; - padding: 0.5em 1em; -} - -div#gilti table.bin-blob td { - font-family: monospace; - white-space: pre; - border-left: solid 1px #777; - padding: 0em 1em; -} - -div#gilti table.nowrap td { - white-space: nowrap; -} - -div#gilti table.commit-info { - border-collapse: collapse; - margin-top: 1.5em; -} - -div#gilti div.gilti-panel { - float: right; - margin-top: 1.5em; -} - -div#gilti div.gilti-panel table { - border-collapse: collapse; - border: solid 1px #aaa; - background-color: #eee; -} - -div#gilti div.gilti-panel th { - text-align: center; -} - -div#gilti div.gilti-panel td { - padding: 0.25em 0.5em; -} - -div#gilti div.gilti-panel td.label { - padding-right: 0.5em; -} - -div#gilti div.gilti-panel td.ctrl { - padding-left: 0.5em; -} - -div#gilti table.commit-info th { - text-align: left; - font-weight: normal; - padding: 0.1em 1em 0.1em 0.1em; - vertical-align: top; -} - -div#gilti table.commit-info td { - font-weight: normal; - padding: 0.1em 1em 0.1em 0.1em; -} - -div#gilti div.commit-subject { - font-weight: bold; - font-size: 125%; - margin: 1.5em 0em 0.5em 0em; - padding: 0em; -} - -div#gilti div.commit-msg { - white-space: pre; - font-family: monospace; -} - -div#gilti div.notes-header { - font-weight: bold; - padding-top: 1.5em; -} - -div#gilti div.notes { - white-space: pre; - font-family: monospace; - border: solid 1px #ee9; - background-color: #ffd; - padding: 0.3em 2em 0.3em 1em; - float: left; -} - -div#gilti div.notes-footer { - clear: left; -} - -div#gilti div.diffstat-header { - font-weight: bold; - padding-top: 1.5em; -} - -div#gilti table.diffstat { - border-collapse: collapse; - border: solid 1px #aaa; - background-color: #eee; -} - -div#gilti table.diffstat th { - font-weight: normal; - text-align: left; - text-decoration: underline; - padding: 0.1em 1em 0.1em 0.1em; - font-size: 100%; -} - -div#gilti table.diffstat td { - padding: 0.2em 0.2em 0.1em 0.1em; - font-size: 100%; - border: none; -} - -div#gilti table.diffstat td.mode { - white-space: nowrap; -} - -div#gilti table.diffstat td span.modechange { - padding-left: 1em; - color: red; -} - -div#gilti table.diffstat td.add a { - color: green; -} - -div#gilti table.diffstat td.del a { - color: red; -} - -div#gilti table.diffstat td.upd a { - color: blue; -} - -div#gilti table.diffstat td.graph { - width: 500px; - vertical-align: middle; -} - -div#gilti table.diffstat td.graph table { - border: none; -} - -div#gilti table.diffstat td.graph td { - padding: 0px; - border: 0px; - height: 7pt; -} - -div#gilti table.diffstat td.graph td.add { - background-color: #5c5; -} - -div#gilti table.diffstat td.graph td.rem { - background-color: #c55; -} - -div#gilti div.diffstat-summary { - color: #888; - padding-top: 0.5em; -} - -div#gilti table.diff { - width: 100%; -} - -div#gilti table.diff td { - font-family: monospace; - white-space: pre; -} - -div#gilti table.diff td div.head { - font-weight: bold; - margin-top: 1em; - color: black; -} - -div#gilti table.diff td div.hunk { - color: #009; -} - -div#gilti table.diff td div.add { - color: green; -} - -div#gilti table.diff td div.del { - color: red; -} - -div#gilti .oid { - font-family: monospace; - font-size: 90%; -} - -div#gilti .left { - text-align: left; -} - -div#gilti .right { - text-align: right; -} - -div#gilti table.list td.reposection { - font-style: italic; - color: #888; -} - -div#gilti a.button { - font-size: 80%; - padding: 0em 0.5em; -} - -div#gilti a.primary { - font-size: 100%; -} - -div#gilti a.secondary { - font-size: 90%; -} - -div#gilti td.toplevel-repo { - -} - -div#gilti table.list td.sublevel-repo { - padding-left: 1.5em; -} - -div#gilti ul.pager { - list-style-type: none; - text-align: center; - margin: 1em 0em 0em 0em; - padding: 0; -} - -div#gilti ul.pager li { - display: inline-block; - margin: 0.25em 0.5em; -} - -div#gilti ul.pager a { - color: #777; -} - -div#gilti ul.pager .current { - font-weight: bold; -} - -div#gilti span.age-mins { - font-weight: bold; - color: #080; -} - -div#gilti span.age-hours { - color: #080; -} - -div#gilti span.age-days { - color: #040; -} - -div#gilti span.age-weeks { - color: #444; -} - -div#gilti span.age-months { - color: #888; -} - -div#gilti span.age-years { - color: #bbb; -} - -div#gilti span.insertions { - color: #080; -} - -div#gilti span.deletions { - color: #800; -} - -div#gilti div.footer { - margin-top: 0.5em; - text-align: center; - font-size: 80%; - color: #ccc; -} - -div#gilti div.footer a { - color: #ccc; - text-decoration: none; -} - -div#gilti div.footer a:hover { - text-decoration: underline; -} - -div#gilti a.branch-deco { - color: #000; - margin: 0px 0.5em; - padding: 0px 0.25em; - background-color: #88ff88; - border: solid 1px #007700; - border-radius: 2px; -} - -div#gilti a.tag-deco { - color: #000; - margin: 0px 0.5em; - padding: 0px 0.25em; - background-color: #ffff88; - border: solid 1px #777700; - border-radius: 2px; -} - -div#gilti a.tag-annotated-deco { - color: #000; - margin: 0px 0.5em; - padding: 0px 0.25em; - background-color: #ffcc88; - border: solid 1px #777700; - border-radius: 2px; -} - -div#gilti a.remote-deco { - color: #000; - margin: 0px 0.5em; - padding: 0px 0.25em; - background-color: #ccccff; - border: solid 1px #000077; - border-radius: 2px; -} - -div#gilti a.deco { - color: #000; - margin: 0px 0.5em; - padding: 0px 0.25em; - background-color: #ff8888; - border: solid 1px #770000; - border-radius: 2px; -} - -div#gilti div.commit-subject a.branch-deco, -div#gilti div.commit-subject a.tag-deco, -div#gilti div.commit-subject a.tag-annotated-deco, -div#gilti div.commit-subject a.remote-deco, -div#gilti div.commit-subject a.deco { - margin-left: 1em; - font-size: 75%; -} - -div#gilti table.stats { - border: solid 1px black; - border-collapse: collapse; -} - -div#gilti table.stats th { - text-align: left; - padding: 1px 0.5em; - background-color: #eee; - border: solid 1px black; -} - -div#gilti table.stats td { - text-align: right; - padding: 1px 0.5em; - border: solid 1px black; -} - -div#gilti table.stats td.total { - font-weight: bold; - text-align: left; -} - -div#gilti table.stats td.sum { - color: #c00; - font-weight: bold; -/* background-color: #eee; */ -} - -div#gilti table.stats td.left { - text-align: left; -} - -div#gilti table.vgraph { - border-collapse: separate; - border: solid 1px black; - height: 200px; -} - -div#gilti table.vgraph th { - background-color: #eee; - font-weight: bold; - border: solid 1px white; - padding: 1px 0.5em; -} - -div#gilti table.vgraph td { - vertical-align: bottom; - padding: 0px 10px; -} - -div#gilti table.vgraph div.bar { - background-color: #eee; -} - -div#gilti table.hgraph { - border: solid 1px black; - width: 800px; -} - -div#gilti table.hgraph th { - background-color: #eee; - font-weight: bold; - border: solid 1px black; - padding: 1px 0.5em; -} - -div#gilti table.hgraph td { - vertical-align: middle; - padding: 2px 2px; -} - -div#gilti table.hgraph div.bar { - background-color: #eee; - height: 1em; -} - -div#gilti table.ssdiff { - width: 100%; -} - -div#gilti table.ssdiff td { - font-size: 75%; - font-family: monospace; - white-space: pre; - padding: 1px 4px 1px 4px; - border-left: solid 1px #aaa; - border-right: solid 1px #aaa; -} - -div#gilti table.ssdiff td.add { - color: black; - background: #cfc; - min-width: 50%; -} - -div#gilti table.ssdiff td.add_dark { - color: black; - background: #aca; - min-width: 50%; -} - -div#gilti table.ssdiff span.add { - background: #cfc; - font-weight: bold; -} - -div#gilti table.ssdiff td.del { - color: black; - background: #fcc; - min-width: 50%; -} - -div#gilti table.ssdiff td.del_dark { - color: black; - background: #caa; - min-width: 50%; -} - -div#gilti table.ssdiff span.del { - background: #fcc; - font-weight: bold; -} - -div#gilti table.ssdiff td.changed { - color: black; - background: #ffc; - min-width: 50%; -} - -div#gilti table.ssdiff td.changed_dark { - color: black; - background: #cca; - min-width: 50%; -} - -div#gilti table.ssdiff td.lineno { - color: black; - background: #eee; - text-align: right; - width: 3em; - min-width: 3em; -} - -div#gilti table.ssdiff td.hunk { - color: black; - background: #ccf; - border-top: solid 1px #aaa; - border-bottom: solid 1px #aaa; -} - -div#gilti table.ssdiff td.head { - border-top: solid 1px #aaa; - border-bottom: solid 1px #aaa; -} - -div#gilti table.ssdiff td.head div.head { - font-weight: bold; - color: black; -} - -div#gilti table.ssdiff td.foot { - border-top: solid 1px #aaa; - border-left: none; - border-right: none; - border-bottom: none; -} - -div#gilti table.ssdiff td.space { - border: none; -} - -div#gilti table.ssdiff td.space div { - min-height: 3em; -} diff --git a/assets/gilti.js b/assets/gilti.js deleted file mode 100644 index b4ade48..0000000 --- a/assets/gilti.js +++ /dev/null @@ -1,72 +0,0 @@ -/* SPDX-FileCopyrightText: cgit Development Team - * SPDX-License-Identifier: GPL-2.0-only - */ - -/* gilti.js: JavaScript helpers for Gilti - * - * Copyright (C) 2006-2018 cgit Development Team - * - * Licensed under GNU General Public License v2 - * (see LICENSES/GPL-2.0-only.txt for full license text) - */ - -(function () { - -/* Relative-age rendering shared by Gilti browser views. */ - -var age_classes = [ "age-mins", "age-hours", "age-days", "age-weeks", "age-months", "age-years" ]; -var age_suffix = [ "min.", "hours", "days", "weeks", "months", "years", "years" ]; -var age_next = [ 60, 3600, 24 * 3600, 7 * 24 * 3600, 30 * 24 * 3600, 365 * 24 * 3600, 365 * 24 * 3600 ]; -var age_limit = [ 7200, 24 * 7200, 7 * 24 * 7200, 30 * 24 * 7200, 365 * 25 * 7200, 365 * 25 * 7200 ]; -var update_next = [ 10, 5 * 60, 1800, 24 * 3600, 24 * 3600, 24 * 3600, 24 * 3600 ]; - -function render_age(e, age) { - var t, n; - - for (n = 0; n < age_classes.length; n++) - if (age < age_limit[n]) - break; - - t = Math.round(age / age_next[n]) + " " + age_suffix[n]; - - if (e.textContent != t) { - e.textContent = t; - if (n == age_classes.length) - n--; - if (e.className != age_classes[n]) - e.className = age_classes[n]; - } -} - -function aging() { - var n, next = 24 * 3600, - now_ut = Math.round((new Date().getTime() / 1000)); - - for (n = 0; n < age_classes.length; n++) { - var m, elems = document.getElementsByClassName(age_classes[n]); - - if (elems.length && update_next[n] < next) - next = update_next[n]; - - for (m = 0; m < elems.length; m++) { - var age = now_ut - elems[m].getAttribute("data-ut"); - - render_age(elems[m], age); - } - } - - /* - * We only need to come back when the age might have changed. - * Eg, if everything is counted in hours already, once per - * 5 minutes is accurate enough. - */ - - window.setTimeout(aging, next * 1000); -} - -document.addEventListener("DOMContentLoaded", function() { - /* we can do the aging on DOM content load since no layout dependency */ - aging(); -}, false); - -})(); diff --git a/assets/gilti.png b/assets/gilti.png deleted file mode 100644 index 425528ee39519a781b23bbec64df948b78ae87cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1366 zcmeAS@N?(olHy`uVBq!ia0vp^2|(Q0X`wF|Ns97$~S<~Dh7u63=BYWCIiDF28JbI?lQ0lkX#HF0m?1~ zBcKQntzckS4psmpfoz~Ggj@+`14$qkjf69FiFSl6Kevqi||TkY6wZBNGc72PYRd zpMZ#{xTK7nysCztzM-*+shNePwUdjRyQi0ba9DUmRCG*iTzo=ea!P7iR!(kyL19sG zX?aCuRdr2WLt|5OYj;my|Aa}Cr%s{PfxL7q4EwdHe4DhmW5=fBE|D`;VW$e*gLV@9M(Mx&?dUecBVA&~xtncsFN=9+ zE_QA5IBas3RhEU5>Dk}<-wpnT(4vGi z8s(vqAM6=kS`oP4+;EiOR#T0V1QgZ=rqEpZ`hGZQY# z2rw%}zFzUO{s+ef*O2Rr>YZ86Fuq(t@$6vaAC21#&3qI&%UA$x2;*36#Chmi{Tq{#`0;q z*PE)I;n-!d%SL?X`Z;AtF5@OuO!LZm?U3Q(c9mAqBWAz>X6GBcKUb{Ny z$?RoetBd}#F1V!pgzxsJ9X~I0MEnX~!*C#|Qhnl7`Q5pv_a|PNFaN>s=%ooE%WM13 zU5yOcJGtlEyjx}E1$tAXWa^9Gdz4-bmk71rcB0?FKy~>Q9}}riZI;5VY&8>@e`J|h z=P^}iu^aFd#0pq5T0LdRV_YF!a_bmt!`dQ--3%OQ|Cj8Y%&>UUucN>6Zg%ZWzb&%# zsZ03%3b%q2uTC7>@lp4(*4pRgZalB{Z}Tn*eS28m>8JkjwMD(rwLjLS+e~55HI$av hwdZh_=5hOu`2qG-XIl%F*8OT0j88*I;B|;A3WB&;W`l0I>rQGcvFMNd|@npjvF; z|Ns9C0RhJtRg<^2w%koLc6#^Xc+0@0b{MP-o1OzLl-9~e-YS1Ul?BuYCnv> z#KonkqvMJTjNjt&3#2gw%9kpEI8*}4mzx5yR}9J*bMb-L1Lymp@uB{Jhzg3q{6#aq z8`OSCc*w!R4H`aDQy}3Ynvz4-Gxez`(qOVcN923pEhL}vDprG(XphWx5PkxC&dE;ey?|`(_3qip;AboEmP##EM2C5T32%&+h j!F(8fQ5MKogs78y2r*au9mF0%&v&mh1O>7AhZHdY^--`s literal 0 HcmV?d00001 diff --git a/crates/gilti/assets/gilti.css b/crates/gilti/assets/gilti.css new file mode 100644 index 0000000..e9a423e --- /dev/null +++ b/crates/gilti/assets/gilti.css @@ -0,0 +1,918 @@ +/* SPDX-FileCopyrightText: cgit Development Team + * SPDX-License-Identifier: GPL-2.0-only + */ + +div#gilti { + padding: 0em; + margin: 0em; + font-family: sans-serif; + font-size: 10pt; + color: #333; + background: white; + padding: 4px; +} + +div#gilti a { + color: blue; + text-decoration: none; +} + +div#gilti a:hover { + text-decoration: underline; +} + +div#gilti table { + border-collapse: collapse; +} + +div#gilti table#header { + width: 100%; + margin-bottom: 1em; +} + +div#gilti table#header td.logo { + width: 96px; + vertical-align: top; +} + +div#gilti table#header td.main { + font-size: 250%; + padding-left: 10px; + white-space: nowrap; +} + +div#gilti table#header td.main a { + color: #000; +} + +div#gilti table#header td.form { + text-align: right; + vertical-align: bottom; + padding-right: 1em; + padding-bottom: 2px; + white-space: nowrap; +} + +div#gilti table#header td.form form, +div#gilti table#header td.form input, +div#gilti table#header td.form select { + font-size: 90%; +} + +div#gilti table#header td.sub { + color: #777; + border-top: solid 1px #ccc; + padding-left: 10px; +} + +div#gilti table.tabs { + border-bottom: solid 3px #ccc; + border-collapse: collapse; + margin-top: 2em; + margin-bottom: 0px; + width: 100%; +} + +div#gilti table.tabs td { + padding: 0px 1em; + vertical-align: bottom; +} + +div#gilti table.tabs td a { + padding: 2px 0.75em; + color: #777; + font-size: 110%; +} + +div#gilti table.tabs td a.active { + color: #000; + background-color: #ccc; +} + +div#gilti table.tabs a[href^="http://"]:after, div#gilti table.tabs a[href^="https://"]:after { + content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfgAhcJDQY+gm2TAAAAHWlUWHRDb21tZW50AAAAAABDcmVhdGVkIHdpdGggR0lNUGQuZQcAAABbSURBVAhbY2BABs4MU4CwhYHBh2Erww4wrGFQZHjI8B8IgUIscJWyDHcggltQhI4zGDCcRwhChPggHIggP1QoAVmQkSETrGoHsiAEsACtBYN0oDAMbgU6EBcAAL2eHUt4XUU4AAAAAElFTkSuQmCC); + opacity: 0.5; + margin: 0 0 0 5px; +} + +div#gilti table.tabs td.form { + text-align: right; +} + +div#gilti table.tabs td.form form { + padding-bottom: 2px; + font-size: 90%; + white-space: nowrap; +} + +div#gilti table.tabs td.form input, +div#gilti table.tabs td.form select { + font-size: 90%; +} + +div#gilti div.path { + margin: 0px; + padding: 5px 2em 2px 2em; + color: #000; + background-color: #eee; +} + +div#gilti div.content { + margin: 0px; + padding: 2em; + border-bottom: solid 3px #ccc; +} + + +div#gilti table.list { + width: 100%; + border: none; + border-collapse: collapse; +} + +div#gilti table.list tr { + background: white; +} + +div#gilti table.list tr.logheader { + background: #eee; +} + +div#gilti table.list tr:nth-child(even) { + background: #f7f7f7; +} + +div#gilti table.list tr:nth-child(odd) { + background: white; +} + +div#gilti table.list tr:hover { + background: #eee; +} + +div#gilti table.list tr.nohover { + background: white; +} + +div#gilti table.list tr.nohover:hover { + background: white; +} + +div#gilti table.list tr.nohover-highlight:hover:nth-child(even) { + background: #f7f7f7; +} + +div#gilti table.list tr.nohover-highlight:hover:nth-child(odd) { + background: white; +} + +div#gilti table.list th { + font-weight: bold; + /* color: #888; + border-top: dashed 1px #888; + border-bottom: dashed 1px #888; + */ + padding: 0.1em 0.5em 0.05em 0.5em; + vertical-align: baseline; +} + +div#gilti table.list td { + border: none; + padding: 0.1em 0.5em 0.1em 0.5em; +} + +div#gilti table.list td.commitgraph { + font-family: monospace; + white-space: pre; +} + +div#gilti table.list td.commitgraph .column1 { + color: #a00; +} + +div#gilti table.list td.commitgraph .column2 { + color: #0a0; +} + +div#gilti table.list td.commitgraph .column3 { + color: #aa0; +} + +div#gilti table.list td.commitgraph .column4 { + color: #00a; +} + +div#gilti table.list td.commitgraph .column5 { + color: #a0a; +} + +div#gilti table.list td.commitgraph .column6 { + color: #0aa; +} + +div#gilti table.list td.logsubject { + font-family: monospace; + font-weight: bold; +} + +div#gilti table.list td.logmsg { + font-family: monospace; + white-space: pre; + padding: 0 0.5em; +} + +div#gilti table.list td a { + color: black; +} + +div#gilti table.list td a.ls-dir { + font-weight: bold; + color: #00f; +} + +div#gilti table.list td a:hover { + color: #00f; +} + +div#gilti img { + border: none; +} + +div#gilti input#switch-btn { + margin: 2px 0px 0px 0px; +} + +div#gilti td#sidebar input.txt { + width: 100%; + margin: 2px 0px 0px 0px; +} + +div#gilti table#grid { + margin: 0px; +} + +div#gilti td#content { + vertical-align: top; + padding: 1em 2em 1em 1em; + border: none; +} + +div#gilti div#summary { + vertical-align: top; + margin-bottom: 1em; +} + +div#gilti div#summary pre { + margin: 0; + white-space: pre-wrap; +} + +div#gilti table#downloads { + float: right; + border-collapse: collapse; + border: solid 1px #777; + margin-left: 0.5em; + margin-bottom: 0.5em; +} + +div#gilti table#downloads th { + background-color: #ccc; +} + +div#gilti div#blob { + border: solid 1px black; +} + +div#gilti div.error { + color: red; + font-weight: bold; + margin: 1em 2em; +} + +div#gilti a.ls-blob, div#gilti a.ls-dir, div#gilti .ls-mod { + font-family: monospace; +} + +div#gilti td.ls-size { + text-align: right; + font-family: monospace; + width: 10em; +} + +div#gilti td.ls-mode { + font-family: monospace; + width: 10em; +} + +div#gilti table.blob { + margin-top: 0.5em; + border-top: solid 1px black; +} + +div#gilti table.blob td.hashes, +div#gilti table.blob td.lines { + margin: 0; padding: 0 0 0 0.5em; + vertical-align: top; + color: black; +} + +div#gilti table.blob td.linenumbers { + margin: 0; padding: 0 0.5em 0 0.5em; + vertical-align: top; + text-align: right; + border-right: 1px solid gray; +} + +div#gilti table.blob pre { + padding: 0; margin: 0; +} + +div#gilti table.blob td.linenumbers a, +div#gilti table.ssdiff td.lineno a { + color: gray; + text-align: right; + text-decoration: none; +} + +div#gilti table.blob td.linenumbers a:hover, +div#gilti table.ssdiff td.lineno a:hover { + color: black; +} + +div#gilti table.blob td.linenumbers a:target:before { + color: red; + content: "\2BA9"; +} + +div#gilti table.blame td.hashes, +div#gilti table.blame td.lines, +div#gilti table.blame td.linenumbers { + padding: 0; +} + +div#gilti table.blame td.hashes div.alt, +div#gilti table.blame td.lines div.alt { + padding: 0 0.5em 0 0.5em; +} + +div#gilti table.blame td.linenumbers div.alt { + padding: 0 0.5em 0 0; +} + +div#gilti table.blame div.alt:nth-child(even) { + background: #eee; +} + +div#gilti table.blame div.alt:nth-child(odd) { + background: white; +} + +div#gilti table.blame td.lines > div { + position: relative; +} + +div#gilti table.blame td.lines > div > pre { + padding: 0 0 0 0.5em; + position: absolute; + top: 0; +} + +div#gilti table.blame .oid { + font-size: 100%; +} + +div#gilti table.bin-blob { + margin-top: 0.5em; + border: solid 1px black; +} + +div#gilti table.bin-blob th { + font-family: monospace; + white-space: pre; + border: solid 1px #777; + padding: 0.5em 1em; +} + +div#gilti table.bin-blob td { + font-family: monospace; + white-space: pre; + border-left: solid 1px #777; + padding: 0em 1em; +} + +div#gilti table.nowrap td { + white-space: nowrap; +} + +div#gilti table.commit-info { + border-collapse: collapse; + margin-top: 1.5em; +} + +div#gilti div.gilti-panel { + float: right; + margin-top: 1.5em; +} + +div#gilti div.gilti-panel table { + border-collapse: collapse; + border: solid 1px #aaa; + background-color: #eee; +} + +div#gilti div.gilti-panel th { + text-align: center; +} + +div#gilti div.gilti-panel td { + padding: 0.25em 0.5em; +} + +div#gilti div.gilti-panel td.label { + padding-right: 0.5em; +} + +div#gilti div.gilti-panel td.ctrl { + padding-left: 0.5em; +} + +div#gilti table.commit-info th { + text-align: left; + font-weight: normal; + padding: 0.1em 1em 0.1em 0.1em; + vertical-align: top; +} + +div#gilti table.commit-info td { + font-weight: normal; + padding: 0.1em 1em 0.1em 0.1em; +} + +div#gilti div.commit-subject { + font-weight: bold; + font-size: 125%; + margin: 1.5em 0em 0.5em 0em; + padding: 0em; +} + +div#gilti div.commit-msg { + white-space: pre; + font-family: monospace; +} + +div#gilti div.notes-header { + font-weight: bold; + padding-top: 1.5em; +} + +div#gilti div.notes { + white-space: pre; + font-family: monospace; + border: solid 1px #ee9; + background-color: #ffd; + padding: 0.3em 2em 0.3em 1em; + float: left; +} + +div#gilti div.notes-footer { + clear: left; +} + +div#gilti div.diffstat-header { + font-weight: bold; + padding-top: 1.5em; +} + +div#gilti table.diffstat { + border-collapse: collapse; + border: solid 1px #aaa; + background-color: #eee; +} + +div#gilti table.diffstat th { + font-weight: normal; + text-align: left; + text-decoration: underline; + padding: 0.1em 1em 0.1em 0.1em; + font-size: 100%; +} + +div#gilti table.diffstat td { + padding: 0.2em 0.2em 0.1em 0.1em; + font-size: 100%; + border: none; +} + +div#gilti table.diffstat td.mode { + white-space: nowrap; +} + +div#gilti table.diffstat td span.modechange { + padding-left: 1em; + color: red; +} + +div#gilti table.diffstat td.add a { + color: green; +} + +div#gilti table.diffstat td.del a { + color: red; +} + +div#gilti table.diffstat td.upd a { + color: blue; +} + +div#gilti table.diffstat td.graph { + width: 500px; + vertical-align: middle; +} + +div#gilti table.diffstat td.graph table { + border: none; +} + +div#gilti table.diffstat td.graph td { + padding: 0px; + border: 0px; + height: 7pt; +} + +div#gilti table.diffstat td.graph td.add { + background-color: #5c5; +} + +div#gilti table.diffstat td.graph td.rem { + background-color: #c55; +} + +div#gilti div.diffstat-summary { + color: #888; + padding-top: 0.5em; +} + +div#gilti table.diff { + width: 100%; +} + +div#gilti table.diff td { + font-family: monospace; + white-space: pre; +} + +div#gilti table.diff td div.head { + font-weight: bold; + margin-top: 1em; + color: black; +} + +div#gilti table.diff td div.hunk { + color: #009; +} + +div#gilti table.diff td div.add { + color: green; +} + +div#gilti table.diff td div.del { + color: red; +} + +div#gilti .oid { + font-family: monospace; + font-size: 90%; +} + +div#gilti .left { + text-align: left; +} + +div#gilti .right { + text-align: right; +} + +div#gilti table.list td.reposection { + font-style: italic; + color: #888; +} + +div#gilti a.button { + font-size: 80%; + padding: 0em 0.5em; +} + +div#gilti a.primary { + font-size: 100%; +} + +div#gilti a.secondary { + font-size: 90%; +} + +div#gilti td.toplevel-repo { + +} + +div#gilti table.list td.sublevel-repo { + padding-left: 1.5em; +} + +div#gilti ul.pager { + list-style-type: none; + text-align: center; + margin: 1em 0em 0em 0em; + padding: 0; +} + +div#gilti ul.pager li { + display: inline-block; + margin: 0.25em 0.5em; +} + +div#gilti ul.pager a { + color: #777; +} + +div#gilti ul.pager .current { + font-weight: bold; +} + +div#gilti span.age-mins { + font-weight: bold; + color: #080; +} + +div#gilti span.age-hours { + color: #080; +} + +div#gilti span.age-days { + color: #040; +} + +div#gilti span.age-weeks { + color: #444; +} + +div#gilti span.age-months { + color: #888; +} + +div#gilti span.age-years { + color: #bbb; +} + +div#gilti span.insertions { + color: #080; +} + +div#gilti span.deletions { + color: #800; +} + +div#gilti div.footer { + margin-top: 0.5em; + text-align: center; + font-size: 80%; + color: #ccc; +} + +div#gilti div.footer a { + color: #ccc; + text-decoration: none; +} + +div#gilti div.footer a:hover { + text-decoration: underline; +} + +div#gilti a.branch-deco { + color: #000; + margin: 0px 0.5em; + padding: 0px 0.25em; + background-color: #88ff88; + border: solid 1px #007700; + border-radius: 2px; +} + +div#gilti a.tag-deco { + color: #000; + margin: 0px 0.5em; + padding: 0px 0.25em; + background-color: #ffff88; + border: solid 1px #777700; + border-radius: 2px; +} + +div#gilti a.tag-annotated-deco { + color: #000; + margin: 0px 0.5em; + padding: 0px 0.25em; + background-color: #ffcc88; + border: solid 1px #777700; + border-radius: 2px; +} + +div#gilti a.remote-deco { + color: #000; + margin: 0px 0.5em; + padding: 0px 0.25em; + background-color: #ccccff; + border: solid 1px #000077; + border-radius: 2px; +} + +div#gilti a.deco { + color: #000; + margin: 0px 0.5em; + padding: 0px 0.25em; + background-color: #ff8888; + border: solid 1px #770000; + border-radius: 2px; +} + +div#gilti div.commit-subject a.branch-deco, +div#gilti div.commit-subject a.tag-deco, +div#gilti div.commit-subject a.tag-annotated-deco, +div#gilti div.commit-subject a.remote-deco, +div#gilti div.commit-subject a.deco { + margin-left: 1em; + font-size: 75%; +} + +div#gilti table.stats { + border: solid 1px black; + border-collapse: collapse; +} + +div#gilti table.stats th { + text-align: left; + padding: 1px 0.5em; + background-color: #eee; + border: solid 1px black; +} + +div#gilti table.stats td { + text-align: right; + padding: 1px 0.5em; + border: solid 1px black; +} + +div#gilti table.stats td.total { + font-weight: bold; + text-align: left; +} + +div#gilti table.stats td.sum { + color: #c00; + font-weight: bold; +/* background-color: #eee; */ +} + +div#gilti table.stats td.left { + text-align: left; +} + +div#gilti table.vgraph { + border-collapse: separate; + border: solid 1px black; + height: 200px; +} + +div#gilti table.vgraph th { + background-color: #eee; + font-weight: bold; + border: solid 1px white; + padding: 1px 0.5em; +} + +div#gilti table.vgraph td { + vertical-align: bottom; + padding: 0px 10px; +} + +div#gilti table.vgraph div.bar { + background-color: #eee; +} + +div#gilti table.hgraph { + border: solid 1px black; + width: 800px; +} + +div#gilti table.hgraph th { + background-color: #eee; + font-weight: bold; + border: solid 1px black; + padding: 1px 0.5em; +} + +div#gilti table.hgraph td { + vertical-align: middle; + padding: 2px 2px; +} + +div#gilti table.hgraph div.bar { + background-color: #eee; + height: 1em; +} + +div#gilti table.ssdiff { + width: 100%; +} + +div#gilti table.ssdiff td { + font-size: 75%; + font-family: monospace; + white-space: pre; + padding: 1px 4px 1px 4px; + border-left: solid 1px #aaa; + border-right: solid 1px #aaa; +} + +div#gilti table.ssdiff td.add { + color: black; + background: #cfc; + min-width: 50%; +} + +div#gilti table.ssdiff td.add_dark { + color: black; + background: #aca; + min-width: 50%; +} + +div#gilti table.ssdiff span.add { + background: #cfc; + font-weight: bold; +} + +div#gilti table.ssdiff td.del { + color: black; + background: #fcc; + min-width: 50%; +} + +div#gilti table.ssdiff td.del_dark { + color: black; + background: #caa; + min-width: 50%; +} + +div#gilti table.ssdiff span.del { + background: #fcc; + font-weight: bold; +} + +div#gilti table.ssdiff td.changed { + color: black; + background: #ffc; + min-width: 50%; +} + +div#gilti table.ssdiff td.changed_dark { + color: black; + background: #cca; + min-width: 50%; +} + +div#gilti table.ssdiff td.lineno { + color: black; + background: #eee; + text-align: right; + width: 3em; + min-width: 3em; +} + +div#gilti table.ssdiff td.hunk { + color: black; + background: #ccf; + border-top: solid 1px #aaa; + border-bottom: solid 1px #aaa; +} + +div#gilti table.ssdiff td.head { + border-top: solid 1px #aaa; + border-bottom: solid 1px #aaa; +} + +div#gilti table.ssdiff td.head div.head { + font-weight: bold; + color: black; +} + +div#gilti table.ssdiff td.foot { + border-top: solid 1px #aaa; + border-left: none; + border-right: none; + border-bottom: none; +} + +div#gilti table.ssdiff td.space { + border: none; +} + +div#gilti table.ssdiff td.space div { + min-height: 3em; +} diff --git a/crates/gilti/assets/gilti.js b/crates/gilti/assets/gilti.js new file mode 100644 index 0000000..b4ade48 --- /dev/null +++ b/crates/gilti/assets/gilti.js @@ -0,0 +1,72 @@ +/* SPDX-FileCopyrightText: cgit Development Team + * SPDX-License-Identifier: GPL-2.0-only + */ + +/* gilti.js: JavaScript helpers for Gilti + * + * Copyright (C) 2006-2018 cgit Development Team + * + * Licensed under GNU General Public License v2 + * (see LICENSES/GPL-2.0-only.txt for full license text) + */ + +(function () { + +/* Relative-age rendering shared by Gilti browser views. */ + +var age_classes = [ "age-mins", "age-hours", "age-days", "age-weeks", "age-months", "age-years" ]; +var age_suffix = [ "min.", "hours", "days", "weeks", "months", "years", "years" ]; +var age_next = [ 60, 3600, 24 * 3600, 7 * 24 * 3600, 30 * 24 * 3600, 365 * 24 * 3600, 365 * 24 * 3600 ]; +var age_limit = [ 7200, 24 * 7200, 7 * 24 * 7200, 30 * 24 * 7200, 365 * 25 * 7200, 365 * 25 * 7200 ]; +var update_next = [ 10, 5 * 60, 1800, 24 * 3600, 24 * 3600, 24 * 3600, 24 * 3600 ]; + +function render_age(e, age) { + var t, n; + + for (n = 0; n < age_classes.length; n++) + if (age < age_limit[n]) + break; + + t = Math.round(age / age_next[n]) + " " + age_suffix[n]; + + if (e.textContent != t) { + e.textContent = t; + if (n == age_classes.length) + n--; + if (e.className != age_classes[n]) + e.className = age_classes[n]; + } +} + +function aging() { + var n, next = 24 * 3600, + now_ut = Math.round((new Date().getTime() / 1000)); + + for (n = 0; n < age_classes.length; n++) { + var m, elems = document.getElementsByClassName(age_classes[n]); + + if (elems.length && update_next[n] < next) + next = update_next[n]; + + for (m = 0; m < elems.length; m++) { + var age = now_ut - elems[m].getAttribute("data-ut"); + + render_age(elems[m], age); + } + } + + /* + * We only need to come back when the age might have changed. + * Eg, if everything is counted in hours already, once per + * 5 minutes is accurate enough. + */ + + window.setTimeout(aging, next * 1000); +} + +document.addEventListener("DOMContentLoaded", function() { + /* we can do the aging on DOM content load since no layout dependency */ + aging(); +}, false); + +})(); diff --git a/crates/gilti/assets/gilti.png b/crates/gilti/assets/gilti.png new file mode 100644 index 0000000000000000000000000000000000000000..425528ee39519a781b23bbec64df948b78ae87cb GIT binary patch literal 1366 zcmeAS@N?(olHy`uVBq!ia0vp^2|(Q0X`wF|Ns97$~S<~Dh7u63=BYWCIiDF28JbI?lQ0lkX#HF0m?1~ zBcKQntzckS4psmpfoz~Ggj@+`14$qkjf69FiFSl6Kevqi||TkY6wZBNGc72PYRd zpMZ#{xTK7nysCztzM-*+shNePwUdjRyQi0ba9DUmRCG*iTzo=ea!P7iR!(kyL19sG zX?aCuRdr2WLt|5OYj;my|Aa}Cr%s{PfxL7q4EwdHe4DhmW5=fBE|D`;VW$e*gLV@9M(Mx&?dUecBVA&~xtncsFN=9+ zE_QA5IBas3RhEU5>Dk}<-wpnT(4vGi z8s(vqAM6=kS`oP4+;EiOR#T0V1QgZ=rqEpZ`hGZQY# z2rw%}zFzUO{s+ef*O2Rr>YZ86Fuq(t@$6vaAC21#&3qI&%UA$x2;*36#Chmi{Tq{#`0;q z*PE)I;n-!d%SL?X`Z;AtF5@OuO!LZm?U3Q(c9mAqBWAz>X6GBcKUb{Ny z$?RoetBd}#F1V!pgzxsJ9X~I0MEnX~!*C#|Qhnl7`Q5pv_a|PNFaN>s=%ooE%WM13 zU5yOcJGtlEyjx}E1$tAXWa^9Gdz4-bmk71rcB0?FKy~>Q9}}riZI;5VY&8>@e`J|h z=P^}iu^aFd#0pq5T0LdRV_YF!a_bmt!`dQ--3%OQ|Cj8Y%&>UUucN>6Zg%ZWzb&%# zsZ03%3b%q2uTC7>@lp4(*4pRgZalB{Z}Tn*eS28m>8JkjwMD(rwLjLS+e~55HI$av hwdZh_=5hOu`2qG-XIl%F*8