Verified Commit 88eafdd1 authored by Davide Depau's avatar Davide Depau
Browse files

Make BITS button functional

parent 9b3248a8
<div class="material-kit hq-status-fab">
<a class="btn btn-round btn-lg btn-gialla" href="https://bits.poul.org">
<a class="btn btn-round btn-lg btn-gialla loading" href="https://bits.poul.org">
<i class="loading-indicator fa fa-sync fa-spin fa-fw"></i>
<div class="ripple-container"></div>
</a>
</div>
<script src="{{ site.baseurl }}/assets/js/simple-bits-client.js"></script>
......@@ -3,9 +3,13 @@
<script>window.jQuery || document.write('<script src="{{ \'/assets/js/jquery-1.11.2.min.js\' | prepend: site.baseurl }}"><\/script>')</script>
<!--script src="{{ site.baseurl }}/assets/vendor/material-kit/assets/js/core/jquery.min.js" type="text/javascript"></script-->
<script src="="{{ site.baseurl }}/assets/vendor/material-kit/assets/js/core/popper.min.js" type="text/javascript"></script>
<script src="="{{ site.baseurl }}/assets/vendor/material-kit/assets/js/core/bootstrap-material-design.min.js" type="text/javascript"></script>
<script src="{{ site.baseurl }}/assets/vendor/material-kit/assets/js/core/popper.min.js" type="text/javascript"></script>
<script src="{{ site.baseurl }}/assets/vendor/material-kit/assets/js/core/bootstrap-material-design.min.js" type="text/javascript"></script>
<script src="{{ '/assets/js/dropcap.min.js' | prepend: site.baseurl }}"></script>
<script src="{{ '/assets/js/responsive-nav.min.js' | prepend: site.baseurl }}"></script>
<script src="{{ '/assets/js/scripts.js' | prepend: site.baseurl }}"></script>
{% if page.has_bits_button %}
<script src="{{ site.baseurl }}/assets/js/simple-bits-client.js"></script>
{% endif %}
// Retrieve BITS status and update the button
val bitsDataUrl = "https://bits.poul.org/data";
//var bitsDataUrl = "/data";
var main = function() {
if (!window.jQuery) {
setTimeout(main, 200);
return;
}
$(document).ready(function() {
const hqStatusButtons = $(".hq-status-fab .btn");
$.ajax(
bitsDataUrl,
{
dataType: "json",
success: function(bitsData) {
hqStatusButtons
.removeClass("btn-gialla")
.addClass("btn-" + bitsData.status.value);
$("#we-are-currently").addClass(bitsData.status.value);
},
complete: function() {
hqStatusButtons.removeClass("loading");
}
}
);
});
};
main();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment