[source:revert] remove support for alias arrays
May re-add in the future.
This commit is contained in:
parent
4cae733ff4
commit
6464f04fed
4
keys.js
4
keys.js
|
@ -763,14 +763,14 @@ const maps = {
|
|||
{
|
||||
path: "/thermostat/DEVICE_.*",
|
||||
leader: "",
|
||||
alias: ["+", "="],
|
||||
alias: "=",
|
||||
description: "Increment temperature",
|
||||
callback: actions.nt.adjustTemp(1),
|
||||
},
|
||||
{
|
||||
path: "/thermostat/DEVICE_.*",
|
||||
leader: "",
|
||||
alias: ["-", "_"],
|
||||
alias: "-",
|
||||
description: "Decrement temperature",
|
||||
callback: actions.nt.adjustTemp(-1),
|
||||
},
|
||||
|
|
14
util.js
14
util.js
|
@ -120,26 +120,24 @@ util.processMaps = (maps, aliases, siteleader) => {
|
|||
leader = (domain === "global") ? "" : siteleader,
|
||||
category = categories.misc,
|
||||
description = "",
|
||||
path = "(/.*)?",
|
||||
} = mapObj;
|
||||
(Array.isArray(alias) ? alias : [alias]).forEach((a) => {
|
||||
} = mapObj
|
||||
const opts = {}
|
||||
const key = `${leader}${a}`
|
||||
|
||||
const key = `${leader}${alias}`
|
||||
|
||||
// Determine if it's a site-specific mapping
|
||||
if (domain !== "global") {
|
||||
const d = util.escapeRegExp(domain)
|
||||
opts.domain = new RegExp(`^http(s)?://(([a-zA-Z0-9-_]+\\.)*)(${d})${path}`)
|
||||
const d = domain.replace(".", "\\.")
|
||||
opts.domain = new RegExp(`^http(s)?://(([a-zA-Z0-9-_]+\\.)*)(${d})(/.*)?`)
|
||||
}
|
||||
|
||||
const fullDescription = `#${category} ${description}`
|
||||
|
||||
if (mapObj.map !== undefined) {
|
||||
map(a, mapObj.map)
|
||||
map(alias, mapObj.map)
|
||||
} else {
|
||||
mapkey(key, fullDescription, callback, opts)
|
||||
}
|
||||
})
|
||||
})))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue