From 6593c399c1639a020fbf06818635c10a95214b15 Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Wed, 1 Jun 2016 10:47:47 -0400 Subject: [PATCH] Update to use syntax highlighting in block explorer --- package.json | 1 + playground/index.html | 5 ++++- playground/playground.css | 3 ++- playground/playground.js | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d7a8b859d..8fc379822 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ }, "devDependencies": { "eslint": "2.7.0", + "highlightjs": "^8.7.0", "json-loader": "0.5.4", "scratch-blocks": "git+https://git@github.com/LLK/scratch-blocks.git", "tap": "5.7.1", diff --git a/playground/index.html b/playground/index.html index 657b6ba3a..cbb7c2ac5 100644 --- a/playground/index.html +++ b/playground/index.html @@ -5,12 +5,13 @@ Scratch VM Playground +

VM Block Representation

- +

         
@@ -75,6 +76,8 @@ + + diff --git a/playground/playground.css b/playground/playground.css index 294746ce6..f1a54242e 100644 --- a/playground/playground.css +++ b/playground/playground.css @@ -20,7 +20,8 @@ body { #blockexplorer { position: absolute; width: 100%; - height: 90%; + height: 80%; + overflow: scroll; border: 1px solid #fff; background: rgb(36,36,36); color: rgb(217,217,217); diff --git a/playground/playground.js b/playground/playground.js index d4caf06c9..1b8b99523 100644 --- a/playground/playground.js +++ b/playground/playground.js @@ -18,6 +18,7 @@ window.onload = function() { workspace.addChangeListener(function() { // On a change, update the block explorer. explorer.innerHTML = JSON.stringify(vm.runtime.blocks, null, 2); + window.hljs.highlightBlock(explorer); }); // Run threads