Consolidated star/release repo scripts

This commit is contained in:
tsmitty11 2023-06-02 13:40:20 +01:00
parent 1f2b3c038a
commit b37f884423
2 changed files with 26 additions and 29 deletions

View file

@ -134,29 +134,3 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+
} }
</script> </script>
<script>
$(document).ready(function() {
var repository = "teaxyz/cli";
var url = "https://api.github.com/repos/" + repository;
$.get(url, function(data) {
var stargazers = numeral(data.stargazers_count).format("0.0a");
$(".stargazers").html(stargazers).hide().fadeIn(400);
});
});
</script>
<script>
$(document).ready(function() {
var repository = "teaxyz/cli";
var url = "https://api.github.com/repos/"+ repository +"/releases/latest";
$.get(url, function(data) {
var release = data.tag_name;
$(".release").html(release).hide().fadeIn(400);
});
});
</script>

View file

@ -44,8 +44,6 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+
</script> </script>
<script> <script>
const toastTrigger = document.getElementById('liveToastBtn') const toastTrigger = document.getElementById('liveToastBtn')
const toastLiveExample = document.getElementById('liveToast') const toastLiveExample = document.getElementById('liveToast')
if (toastTrigger) { if (toastTrigger) {
@ -55,7 +53,6 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+
toast.show() toast.show()
}) })
} }
</script> </script>
<script> <script>
@ -108,3 +105,29 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+
} }
}); });
</script> </script>
<script>
$(document).ready(function() {
var repository = "teaxyz/cli";
var url = "https://api.github.com/repos/" + repository;
$.get(url, function(data) {
var stargazers = numeral(data.stargazers_count).format("0.0a");
$(".stargazers").html(stargazers).hide().fadeIn(400);
});
});
</script>
<script>
$(document).ready(function() {
var repository = "teaxyz/cli";
var url = "https://api.github.com/repos/"+ repository +"/releases/latest";
$.get(url, function(data) {
var release = data.tag_name;
$(".release").html(release).hide().fadeIn(400);
});
});
</script>