diff --git a/index.html b/index.html index 4e1b042..5b2e46e 100644 --- a/index.html +++ b/index.html @@ -19,6 +19,7 @@ Blocks: 0 Workspaces: 0:0:0 +
diff --git a/src/index.js b/src/index.js index da90133..22bfd09 100644 --- a/src/index.js +++ b/src/index.js @@ -18,13 +18,16 @@ import './index.css' const topBlocksDiv = document.getElementById('top-blocks'), totalBlocksDiv = document.getElementById('total-blocks'), + allBlocksDiv = document.getElementById('all-blocks'), totalWorkspacesDiv = document.getElementById('total-workspaces'), blocklyJsonOutputDiv = document.getElementById('blockly-json'), bytecodeJsonOutputDiv = document.getElementById('bytecode-json'), onJsonUpdated = bytecodeJson => { + const allBlocks = workspace.getAllBlocks() topBlocksDiv.innerText = workspace.getTopBlocks().length - totalBlocksDiv.innerText = workspace.getAllBlocks().length + totalBlocksDiv.innerText = allBlocks.length + allBlocksDiv.innerHTML = allBlocks.map(block => `- ${block.type} (${block.id.slice(0,3)})`).join("
") blocklyJsonOutputDiv.innerText = `` bytecodeJsonOutputDiv.innerText = `Bytecode is valid JSON ✅\n\n${bytecodeJson}`