1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-01 20:22:29 +01:00

Fix help link bugs, needs cleanup

This commit is contained in:
Kris Maglione
2009-01-02 18:40:32 -05:00
parent 5d1f9db967
commit 6d8194232f
3 changed files with 19 additions and 8 deletions

View File

@@ -1414,6 +1414,21 @@ const liberator = (function () //{{{
window.liberator = liberator;
// FIXME: Ugly, etc.
window.addEventListener("liberatorHelpLink", function (event) {
let elem = event.target;
liberator.dump(String(elem));
if (/^(option|mapping|command)$/.test(elem.className))
var tag = elem.textContent.replace(/\s.*/, "");
if (elem.className == "command")
tag = tag.replace(/\[.*?\]/g, "");
if (tag)
var page = liberator.findHelp(tag);
if (page)
elem.href = "chrome://liberator/locale/" + page;
},
true, true);
// called when the chrome is fully loaded and before the main window is shown
window.addEventListener("load", liberator.startup, false);
window.addEventListener("unload", liberator.shutdown, false);