mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-24 08:12:29 +01:00
Fix help link bugs, needs cleanup
This commit is contained in:
@@ -16,13 +16,9 @@ window.addEventListener("message", function (event) {
|
||||
}, true);
|
||||
|
||||
document.addEventListener("click", function (event) {
|
||||
let elem = event.target;
|
||||
if (/^(option|mapping|command)$/.test(elem.className))
|
||||
var tag = elem.textContent.replace(/\s.*/, "");
|
||||
if (elem.className == "command")
|
||||
tag = tag.replace(/\[.*?\]/g, "");
|
||||
if (tag)
|
||||
elem.href = "chrome://liberator/content/help.xul?" + encodeURIComponent(tag);
|
||||
let evt = document.createEvent("UIEvents");
|
||||
evt.initEvent("liberatorHelpLink", true, true);
|
||||
event.target.dispatchEvent(evt);
|
||||
}, true);
|
||||
|
||||
// vim: set fdm=marker sw=4 ts=4 et:
|
||||
|
||||
Reference in New Issue
Block a user