Add git commit to footer & about page

This commit is contained in:
Ayanami 2022-05-25 15:54:24 +09:00
parent cda4559cfd
commit a0e72a6ac0
No known key found for this signature in database
GPG Key ID: 0CABDF03077D92E4
4 changed files with 20 additions and 3 deletions

5
.git-hooks-post-checkout Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
commit=$(git cat-file commit HEAD) #
sha1=($((printf "commit %s\0" $(echo "$commit" | wc -c); echo "$commit") | sha1sum))
commit="var git_commit = '${sha1}';"
sed -i "s/.*var git_commit =.*/${commit}/" js/git-commit.js

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
js/git-commit.js

View File

@ -37,6 +37,7 @@
<script type="text/javascript" src="js/coin.js"></script>
<script type="text/javascript" src="js/coinbin.js"></script>
<script type="text/javascript" src="js/git-commit.js"></script>
</head>
<body>
@ -1356,9 +1357,10 @@
<div class="tab-pane tab-content" id="about">
<h2>About <small>open source bitcoin wallet</small></h2>
<p>Version 1.7</p>
<p>Commit: <a id="git-commit-href" href="https://github.com/OutCast3k/coinbin/commit/" target="_blank"><span id="git-commit"></span></a></p>
<p>Compatible with bitcoin core</p>
<p>Github <a href="https://github.com/OutCast3k/coinbin/">https://github.com/OutCast3k/coinbin/</a></p>
<p style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">TOR <a href="http://coinbin3ravkwb24f7rmxx6w3snkjw45jhs5lxbh3yfeg3vpt6janwqd.onion"><i>coinbin</i>3ravkwb24f7rmxx6w3snkjw45jhs5lxbh3yfeg3vpt6janwqd.onion</a> | <i><s><a href="http://4zpinp6gdkjfplhk.onion">4zpinp6gdkjfplhk.onion</a></s></i></p>
<p>Github <a href="https://github.com/OutCast3k/coinbin/" target="_blank">https://github.com/OutCast3k/coinbin/</a></p>
<p style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">TOR <a href="http://coinbin3ravkwb24f7rmxx6w3snkjw45jhs5lxbh3yfeg3vpt6janwqd.onion" target="_blank"><i>coinbin</i>3ravkwb24f7rmxx6w3snkjw45jhs5lxbh3yfeg3vpt6janwqd.onion</a> | <i><s><a href="http://4zpinp6gdkjfplhk.onion">4zpinp6gdkjfplhk.onion</a></s></i></p>
<h3>What is Bitcoin?</h3>
<p>Bitcoin is a type of digital currency in which encryption techniques are used to regulate the generation of units of currency and verify the transfer of funds, operating independently of a central bank. See <a href="http://www.weusecoins.com/" target="_blank">weusecoins.com</a> for more information.</p>
<h3>Information</h3>
@ -1493,7 +1495,7 @@
<div id="footer">
<div class="container text-right">
<p class="text-muted">Version 1.7</p>
<p class="text-muted">Version 1.7 commit: <a id="git-commit-href-footer" href="https://github.com/OutCast3k/coinbin/" target="_blank"><span id="git-commit-footer"></span></a></p>
</div>
</div>

9
js/git-commit.js Normal file
View File

@ -0,0 +1,9 @@
var git_commit = '';
var git_commit_sub = git_commit.substring(0, 8);
$(document).ready(function(){
$('#git-commit').text(`${git_commit_sub}`);
$('#git-commit-footer').text(`${git_commit_sub}`);
$('#git-commit-href').attr('href', `https://github.com/OutCast3k/coinbin/commit/${git_commit}`);
$('#git-commit-href-footer').attr('href', `https://github.com/OutCast3k/coinbin/commit/${git_commit}`);
});