ternary accessKeyModifiers
This commit is contained in:
parent
2429845dd6
commit
7245e0f073
22
js/sudoku.js
22
js/sudoku.js
@ -1,15 +1,14 @@
|
|||||||
const VALUES = "123456789"
|
const VALUES = "123456789"
|
||||||
const UNKNOWN = '.'
|
const UNKNOWN = '.'
|
||||||
|
|
||||||
let boxes = []
|
let boxes = []
|
||||||
let rows = Array.from(Array(9), x => [])
|
let rows = Array.from(Array(9), x => [])
|
||||||
let columns = Array.from(Array(9), x => [])
|
let columns = Array.from(Array(9), x => [])
|
||||||
let regions = Array.from(Array(9), x => [])
|
let regions = Array.from(Array(9), x => [])
|
||||||
let valueToInsert = ""
|
let valueToInsert = ""
|
||||||
let history = []
|
let history = []
|
||||||
let accessKeyModifiers = "AccessKey+"
|
let easyBoxes = []
|
||||||
let easyBoxes = []
|
let insertRadios = []
|
||||||
let insertRadios = []
|
|
||||||
|
|
||||||
function shuffle(iterable) {
|
function shuffle(iterable) {
|
||||||
array = Array.from(iterable)
|
array = Array.from(iterable)
|
||||||
@ -70,8 +69,9 @@ window.onload = function() {
|
|||||||
label.control.label = label
|
label.control.label = label
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/Win/.test(navigator.userAgent) || /Linux/.test(navigator.userAgent)) accessKeyModifiers = "Alt+Maj+"
|
let accessKeyModifiers = (/Win/.test(navigator.userAgent) || /Linux/.test(navigator.userAgent)) ? "Alt+Maj+"
|
||||||
else if (/Mac/.test(navigator.userAgent)) accessKeyModifiers = "⌃⌥"
|
: (/Mac/.test(navigator.userAgent)) ? "⌃⌥"
|
||||||
|
: "AccessKey+"
|
||||||
for (node of document.querySelectorAll("*[accesskey]")) {
|
for (node of document.querySelectorAll("*[accesskey]")) {
|
||||||
shortcut = ` [${node.accessKeyLabel||(accessKeyModifiers+node.accessKey)}]`
|
shortcut = ` [${node.accessKeyLabel||(accessKeyModifiers+node.accessKey)}]`
|
||||||
if (node.title) node.title += shortcut
|
if (node.title) node.title += shortcut
|
||||||
|
Loading…
x
Reference in New Issue
Block a user