Remove remnants of ipfs
This commit is contained in:
parent
7557f5041c
commit
b93aab5742
22
js/api.js
22
js/api.js
@ -1,22 +0,0 @@
|
||||
|
||||
var getApiIpfsCurrent = function(onSuccess, onError) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', '/api/ipfs/current', true);
|
||||
xhr.setRequestHeader('Accept', 'application/json');
|
||||
xhr.onreadystatechange = function () {
|
||||
var res = null;
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 204 || xhr.status === 205) {
|
||||
onSuccess();
|
||||
} else if (xhr.status >= 200 && xhr.status < 300) {
|
||||
try { res = JSON.parse(xhr.responseText); } catch (e) { onError(e); }
|
||||
if (res) onSuccess(res);
|
||||
} else {
|
||||
try { res = JSON.parse(xhr.responseText); } catch (e) { onError(e); }
|
||||
if (res) onError(res);
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
10
js/app.js
10
js/app.js
@ -1,10 +0,0 @@
|
||||
$(document).ready(function() {
|
||||
var success = function(x) {
|
||||
$("#ipfs > em").html(x);
|
||||
};
|
||||
var error = function(x) {
|
||||
$("#ipfs").hide();
|
||||
console.log("ipfs hash not found: " + x);
|
||||
};
|
||||
getApiIpfsCurrent(success, error);
|
||||
});
|
2
js/jquery-3.3.1.min.js
vendored
2
js/jquery-3.3.1.min.js
vendored
File diff suppressed because one or more lines are too long
@ -29,10 +29,6 @@
|
||||
<footer>
|
||||
Site proudly generated by
|
||||
<a href="http://jaspervdj.be/hakyll">Hakyll</a>
|
||||
<span id="ipfs">and found on IPFS as <em></em></ipfs>
|
||||
</footer>
|
||||
</body>
|
||||
<script type="application/javascript" src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script type="application/javascript" src="/js/api.js"></script>
|
||||
<script type="application/javascript" src="/js/app.js"></script>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user