From 0edb8edee529665bf39a52b9ff9f83b0ce79d29e Mon Sep 17 00:00:00 2001 From: Benjamin Penhey Date: Tue, 1 May 2018 17:31:52 +0100 Subject: [PATCH] Feature flag added for simulator --- editor.html | 6 ++++-- python-main.js | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/editor.html b/editor.html index 59b547a0..aa7cae58 100644 --- a/editor.html +++ b/editor.html @@ -190,7 +190,7 @@

{{ title }}

Blockly
-
@@ -363,7 +363,9 @@

{{ title }}

'flags': { 'blocks': true, 'snippets': true, - 'share': true + 'share': true, + 'experimental': false, + 'sim': true }, }); diff --git a/python-main.js b/python-main.js index 3473fbe0..cbb19b86 100644 --- a/python-main.js +++ b/python-main.js @@ -300,6 +300,9 @@ function web_editor(config) { if(config.flags.share) { $("#command-share").removeClass('hidden'); } + if(config.flags.sim) { + $("#command-sim").removeClass('hidden'); + } }; // This function is called to initialise the editor. It sets things up so @@ -337,6 +340,10 @@ function web_editor(config) { EDITOR.setCode(config.translate.code.start); } EDITOR.ACE.gotoLine(EDITOR.ACE.session.getLength()); + // If configured as experimental update editor background to indicate it + if(config.flags.experimental) { + EDITOR.ACE.renderer.scroller.style.backgroundImage = "url('static/img/experimental.png')" + } // Configure the zoom related buttons. $("#zoom-in").click(function (e) { e.stopPropagation();