mirror of
https://github.com/9001/copyparty.git
synced 2025-08-21 02:42:21 -06:00
handle key-normalization errors
This commit is contained in:
parent
0850b8ae2b
commit
b2fafec5fc
|
@ -1289,16 +1289,33 @@ var mukey = (function () {
|
||||||
|
|
||||||
if (min)
|
if (min)
|
||||||
for (var a = 0, aa = rows.length; a < aa; a++) {
|
for (var a = 0, aa = rows.length; a < aa; a++) {
|
||||||
var v = rows[a].cells[i].getAttribute('html');
|
var c = rows[a].cells[i];
|
||||||
rows[a].cells[i].setAttribute('html', map[v] || v);
|
if (!c)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var v = c.getAttribute('html');
|
||||||
|
c.setAttribute('html', map[v] || v);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for (var a = 0, aa = rows.length; a < aa; a++) {
|
for (var a = 0, aa = rows.length; a < aa; a++) {
|
||||||
var v = rows[a].cells[i].textContent;
|
var c = rows[a].cells[i];
|
||||||
rows[a].cells[i].textContent = map[v] || v;
|
if (!c)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var v = c.textContent;
|
||||||
|
c.textContent = map[v] || v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function try_render() {
|
||||||
|
try {
|
||||||
|
render();
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
console.log("key notation failed: " + ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var notation = sread("key_notation") || "rekobo_alnum";
|
var notation = sread("key_notation") || "rekobo_alnum";
|
||||||
ebi('key_' + notation).checked = true;
|
ebi('key_' + notation).checked = true;
|
||||||
load_notation(notation);
|
load_notation(notation);
|
||||||
|
@ -1309,7 +1326,7 @@ var mukey = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"render": render
|
"render": try_render
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue