diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-04-11 18:31:39 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-04-11 18:31:39 +0300 |
commit | b165b0e78e04d269eca33f78df6b86922fcae56e (patch) | |
tree | 7c834bda70efb78db3b9704c79071a05f671d47f | |
parent | 5652c7f391b92fb3ef0b9f401e22b9e51ca5a7a5 (diff) | |
download | arching-kaos-web-ui-b165b0e78e04d269eca33f78df6b86922fcae56e.tar.gz arching-kaos-web-ui-b165b0e78e04d269eca33f78df6b86922fcae56e.tar.bz2 arching-kaos-web-ui-b165b0e78e04d269eca33f78df6b86922fcae56e.zip |
changed places
-rw-r--r-- | src/js/arching-kaos-tools.js | 47 |
1 files changed, 9 insertions, 38 deletions
diff --git a/src/js/arching-kaos-tools.js b/src/js/arching-kaos-tools.js index 11f7d90..d7f69e0 100644 --- a/src/js/arching-kaos-tools.js +++ b/src/js/arching-kaos-tools.js @@ -309,6 +309,15 @@ function renderZblockAsModule(json, params){ else { archingKaosLog(action + " module not found"); } + if (!recursive) { + var button = document.createElement('button'); + button.innerText =`${action.split('/')[0]}-${zblockIPFSHash} 📖`; + var params = `${action.split('/')[0]}-${zblockIPFSHash}` + button.onclick = ()=>{ + showResult(params); + }; + resultsArea.appendChild(button); + } } function saveDataAndFullZblocks(json,params){ @@ -338,50 +347,12 @@ function doStuffWithFetchedDataBlock(json, params){ } function exe(action,dataIPFSHash,blockObject,zblockIPFSHash,group,zblockObject,recursive){ - if (!recursive) { - var button = document.createElement('button'); - button.innerText =`${action.split('/')[0]}-${zblockIPFSHash} 📖`; - var params = `${action.split('/')[0]}-${zblockIPFSHash}` - button.onclick = ()=>{ - showResult(params); - }; - resultsArea.appendChild(button); - } archingKaosLog(`Render ZBLOCK ${zblockIPFSHash} as ${action} ...`); archingKaosFetchJSON( getIPFSURL(dataIPFSHash), doStuffWithFetchedDataBlock, [action, group, zblockIPFSHash, zblockObject, blockObject, references, recursive] ); -// archingKaosFetchJSON(getIPFSURL(dataIPFSHash), saveDataAndFullZblocks, [group, zblockIPFSHash,zblockObject,blockObject]); -// fetch(getIPFSURL(dataIPFSHash), { -// method:'GET', -// headers:{ -// Accept: 'application/json' -// } -// }).then(response=>{ -// if(response.ok){ -// response.json().then(json=>{ -// fullZblocks[zblockIPFSHash]={ -// zblock:zblockIPFSHash, -// block:zblockObject.block, -// block_signature:zblockObject.block_signature, -// action:blockObject.action, -// previous:blockObject.previous, -// data:blockObject.data, -// dataExpansion:json, -// detach:blockObject.detach, -// gpg:blockObject.gpg, -// timestamp:blockObject.timestamp -// }; -// zblocks[group] = new Array; -// zblocks[group].push(zblockIPFSHash); -// data[dataIPFSHash]=json; -// progressPlaceholder.max++; -// progressPlaceholder.value++; -// }) -// } -// }) } function getipfstext(ipfsHash, articleid){ |