diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-03-17 02:55:37 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-03-17 02:55:37 +0200 |
commit | f0ffc03272b911b4cab05403486ea2c77d689d90 (patch) | |
tree | a17139d3b3c1dace4318413e31f571dd8004f944 | |
parent | 42e81fb145ee9b8c120b6f1edb07f466e242c36f (diff) | |
download | arching-kaos-web-ui-f0ffc03272b911b4cab05403486ea2c77d689d90.tar.gz arching-kaos-web-ui-f0ffc03272b911b4cab05403486ea2c77d689d90.tar.bz2 arching-kaos-web-ui-f0ffc03272b911b4cab05403486ea2c77d689d90.zip |
Better naming
-rw-r--r-- | src/js/arching-kaos-modules-news.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/js/arching-kaos-modules-news.js b/src/js/arching-kaos-modules-news.js index b4c6819..6bd3b60 100644 --- a/src/js/arching-kaos-modules-news.js +++ b/src/js/arching-kaos-modules-news.js @@ -1,29 +1,30 @@ function akModuleNews(zblockIPFSHash, zblockObject, blockObject, json){ if (!document.querySelector('#news-'+zblockIPFSHash)){ - var divs = document.querySelector('#news-section'); - var art = document.createElement("article"); - art.id = 'news-'+zblockIPFSHash; + var newsSectionDivElement = document.querySelector('#news-section'); + var articleContainerElement = document.createElement("article"); + articleContainerElement.id = 'news-'+zblockIPFSHash; if(json.title){ var ahref = document.createElement("a"); ahref.innerText = json.title +' [permalink]'; - ahref.href = 'https://news.arching-kaos.net/?from_block='+zblockObject.block; - art.appendChild(ahref); + ahref.target = '_blank'; + ahref.href = 'https://news.arching-kaos.net/?from_zblock='+zblockIPFSHash; + articleContainerElement.appendChild(ahref); } if(json.datetime){ var small = document.createElement("p"); small.innerText="Published: " + new Date(blockObject.timestamp*1000); - art.appendChild(small); + articleContainerElement.appendChild(small); } var small = document.createElement("p"); small.innerText="Contributor: " + getNicknameAssossiatedWithGPG(blockObject.gpg); - art.appendChild(small); - art.appendChild(document.createElement("hr")); + articleContainerElement.appendChild(small); + articleContainerElement.appendChild(document.createElement("hr")); if(json.ipfs){ - getipfstext(json.ipfs,art.id); + getipfstext(json.ipfs,articleContainerElement.id); } if (document.querySelector("#news-sec-not-found")) document.querySelector("#news-sec-not-found").hidden=true; - divs.appendChild(art); - divs.appendChild(document.createElement("hr")); + newsSectionDivElement.appendChild(articleContainerElement); + newsSectionDivElement.appendChild(document.createElement("hr")); } } |