1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 22:52:38 +01:00

Validate 'hinttags' and 'extendedhinttags'

This commit is contained in:
Kris Maglione
2009-04-13 08:42:06 -04:00
parent 87adc9c1db
commit 5231ce880f

View File

@@ -779,13 +779,27 @@ function Hints() //{{{
"//input[not(@type='hidden')] | //a | //area | //iframe | //textarea | //button | //select | " +
"//xhtml:input[not(@type='hidden')] | //xhtml:a | //xhtml:area | //xhtml:iframe | //xhtml:textarea | //xhtml:button | //xhtml:select";
function checkXPath(val) {
try
{
buffer.evaluateXPath(val, document.implementation.createDocument("", "", null));
return true;
}
catch (e)
{
return false;
}
}
options.add(["extendedhinttags", "eht"],
"XPath string of hintable elements activated by ';'",
"string", DEFAULT_HINTTAGS);
"string", DEFAULT_HINTTAGS,
{ validator: checkXPath });
options.add(["hinttags", "ht"],
"XPath string of hintable elements activated by 'f' and 'F'",
"string", DEFAULT_HINTTAGS);
"string", DEFAULT_HINTTAGS,
{ validator: checkXPath });
options.add(["hinttimeout", "hto"],
"Timeout before automatically following a non-unique numerical hint",