Start at a Chrome app
This commit is contained in:
parent
85c036e967
commit
d6438fe2c2
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "LADD Scoreboard",
|
||||
"description": "Roller Derby Scoreboard",
|
||||
"version": "5.2",
|
||||
"manifest_version": 2,
|
||||
"permissions": [ "storage" ],
|
||||
"icons": {
|
||||
"128": "res/icon.png"
|
||||
},
|
||||
"app": {
|
||||
"background": {
|
||||
"scripts": ["res/background.js"]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
chrome.app.runtime.onLaunched.addListener(function() {
|
||||
chrome.app.window.create('../scoreboard.html', {
|
||||
'state': 'fullscreen'
|
||||
})
|
||||
})
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
|
@ -447,22 +447,38 @@ function key(event) {
|
|||
}
|
||||
|
||||
function get(k, d) {
|
||||
if (! window.localStorage) {
|
||||
return d;
|
||||
var storage;
|
||||
|
||||
if (chrome) {
|
||||
storage = chrome.storage.local
|
||||
} else {
|
||||
var v = window.localStorage["rdsb_" + k];
|
||||
storage = window.localStorage;
|
||||
}
|
||||
|
||||
if (! storage) {
|
||||
return d;
|
||||
}
|
||||
|
||||
var v = storage["rdsb_" + k];
|
||||
if (v == undefined) {
|
||||
return d;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
function store(k, v) {
|
||||
if ((v == undefined) || ! window.localStorage) {
|
||||
var storage;
|
||||
|
||||
if (chrome) {
|
||||
storage = chrome.storage.local
|
||||
} else {
|
||||
storage = window.localStorage;
|
||||
}
|
||||
|
||||
if ((v == undefined) || ! storage) {
|
||||
return;
|
||||
} else {
|
||||
localStorage["rdsb_" + k] = v;
|
||||
storage["rdsb_" + k] = v;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -499,6 +515,8 @@ function iecheck() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function start() {
|
||||
resize();
|
||||
iecheck();
|
||||
|
@ -520,9 +538,7 @@ function start() {
|
|||
period = Number(get("period", 0));
|
||||
jamno = Number(get("jamno", 0));
|
||||
|
||||
if (window.localStorage) {
|
||||
save_itimer = setInterval(save, 1000);
|
||||
}
|
||||
|
||||
if (window.penalties) {
|
||||
penalties_init();
|
||||
|
|
Loading…
Reference in New Issue