From b165b0e78e04d269eca33f78df6b86922fcae56e Mon Sep 17 00:00:00 2001 From: kaotisk Date: Thu, 11 Apr 2024 18:31:39 +0300 Subject: changed places --- src/js/arching-kaos-tools.js | 47 +++++++++----------------------------------- 1 file changed, 9 insertions(+), 38 deletions(-) (limited to 'src') 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){ -- cgit v1.2.3