1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 16:37:58 +01:00

XPath validators for 'extendhinttags', 'nextpattern', 'prevpattern'.

This commit is contained in:
Kris Maglione
2010-09-28 16:31:00 -04:00
parent 84ae493dfb
commit 50c1c568a2
5 changed files with 53 additions and 42 deletions

View File

@@ -1053,25 +1053,15 @@ const Hints = Module("hints", {
util.makeXPath(["input[not(@type='hidden')]", "a", "area", "iframe", "textarea", "button", "select",
"*[@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @role='link']"]);
function checkXPath(val) {
try {
util.evaluateXPath(val, document.implementation.createDocument("", "", null));
return true;
}
catch (e) {
return false;
}
}
options.add(["extendedhinttags", "eht"],
"XPath string of hintable elements activated by ';'",
"regexmap", "[iI]:" + Option.quote(util.makeXPath(["img"])),
{ validator: checkXPath });
{ validator: Option.validateXPath });
options.add(["hinttags", "ht"],
"XPath string of hintable elements activated by 'f' and 'F'",
"string", DEFAULT_HINTTAGS,
{ validator: checkXPath });
{ validator: Option.validateXPath });
options.add(["hintkeys", "hk"],
"The keys used to label and select hints",