From a6a70a647c8ce0e01735f82e379402f8964b2fe6 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Mon, 13 Mar 2017 14:37:27 -0700 Subject: [PATCH] set background color to lilac if opening the playground from file: --- tests/playground.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/playground.html b/tests/playground.html index 8c87b6383..a8bcb4a8f 100644 --- a/tests/playground.html +++ b/tests/playground.html @@ -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'));