Skip to content

Feature flag added for simulator #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ <h2><i class="fa fa-unlock-alt"></i> <strong>{{ title }}</strong></h2>
</div>
<div class="roundlabel">Blockly</div>
</a>
<a href="#" class="roundbutton" id="command-sim"
<a href="#" class="roundbutton hidden" id="command-sim"
tabindex="12">
<div class="roundsymbol">
<i class="fa fa-arrow-circle-right"></i>
Expand Down Expand Up @@ -363,7 +363,9 @@ <h2><i class="fa fa-unlock-alt"></i> <strong>{{ title }}</strong></h2>
'flags': {
'blocks': true,
'snippets': true,
'share': true
'share': true,
'experimental': false,
'sim': true
},
});
</script>
Expand Down
7 changes: 7 additions & 0 deletions python-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down