Merge pull request #978 from rachel-fenichel/feature/developer_background

Set background color to lilac if opening the playground from file:
This commit is contained in:
Rachel Fenichel
2017-03-13 14:55:43 -07:00
committed by GitHub

View File

@@ -64,6 +64,8 @@ var workspace = null;
var fakeDragStack = [];
function start() {
setBackgroundColor();
// Parse the URL arguments.
var match = location.search.match(/dir=([^&]+)/);
var rtl = match && match[1] == 'rtl';
@@ -117,6 +119,17 @@ function start() {
taChange();
}
function setBackgroundColor() {
var lilac = '#d6d6ff';
var currentPage = window.location.href;
var regexFile = /^file[\S]*$/;
if (regexFile.test(currentPage)) {
document.getElementsByTagName('body')[0].style.backgroundColor = lilac;
}
}
function getToolboxElement() {
var match = location.search.match(/toolbox=([^&]+)/);
return document.getElementById('toolbox-' + (match ? match[1] : 'categories'));