mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
set background color to lilac if opening the playground from file:
This commit is contained in:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user