forked from andreeuuetoa/litsimaja
Replace hexToRgb function to work with legacy mobile browsers
This commit is contained in:
@@ -7,11 +7,16 @@
|
|||||||
<link rel="stylesheet" href="custom.css">
|
<link rel="stylesheet" href="custom.css">
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const hexToRgb = hex =>
|
'use strict';
|
||||||
hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i
|
function hexToRgb(value) {
|
||||||
,(m, r, g, b) => '#' + r + r + g + g + b + b)
|
var aRgbHex = value.substring(1).match(/.{1,2}/g);
|
||||||
.substring(1).match(/.{2}/g)
|
var aRgb = [
|
||||||
.map(x => parseInt(x, 16));
|
parseInt(aRgbHex[0], 16),
|
||||||
|
parseInt(aRgbHex[1], 16),
|
||||||
|
parseInt(aRgbHex[2], 16)
|
||||||
|
];
|
||||||
|
return aRgb;
|
||||||
|
}
|
||||||
|
|
||||||
function show_loading(visible) {
|
function show_loading(visible) {
|
||||||
document.getElementById('loading').style.visibility = visible ? 'visible' : 'hidden';
|
document.getElementById('loading').style.visibility = visible ? 'visible' : 'hidden';
|
||||||
@@ -51,7 +56,7 @@
|
|||||||
document.getElementById('tempo').value = status.features.tempo.bpm;
|
document.getElementById('tempo').value = status.features.tempo.bpm;
|
||||||
let regions = status.features.region;
|
let regions = status.features.region;
|
||||||
let regLen = regions.length;
|
let regLen = regions.length;
|
||||||
for(i = 0; i < regLen; i++) {
|
for(let i = 0; i < regLen; i++) {
|
||||||
if (regions[i]) {
|
if (regions[i]) {
|
||||||
document.getElementById('region_' + i).classList.remove('region_off');
|
document.getElementById('region_' + i).classList.remove('region_off');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user