set background color to lilac if opening the playground from file:

This commit is contained in:
Rachel Fenichel
2017-03-13 14:37:27 -07:00
parent 847d83e4af
commit a6a70a647c

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'));