Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dldx/hpstr-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/ipfs.js')
-rw-r--r--static/js/ipfs.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/static/js/ipfs.js b/static/js/ipfs.js
new file mode 100644
index 0000000..45d1947
--- /dev/null
+++ b/static/js/ipfs.js
@@ -0,0 +1,8 @@
+function use_ipfs(image) {
+ if (image.naturalWidth == 0 && image.src.search("/ipfs/") != -1) {
+ image.src = image.src.split('#')[1];
+ }
+}
+
+let image = document.getElementsByClassName("entry-image")[0].getElementsByTagName('img')[0];
+window.onload(use_ipfs(image));