1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 02:07:59 +01:00

added "custom" for hintmatching, thanks trapezoid

This commit is contained in:
Martin Stubenschrott
2008-06-16 13:19:25 +00:00
parent 24e390b587
commit ebbbd24097
2 changed files with 3 additions and 1 deletions

View File

@@ -535,6 +535,7 @@ liberator.Hints = function () //{{{
case "contains" : return containsMatcher(hintString);
case "wordstartswith": return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ true);
case "firstletters" : return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ false);
case "custom" : return liberator.plugins.customHintMatcher(hintString);
default : liberator.echoerr("Invalid hintmatching type: " + hintMatching);
}
return null;
@@ -588,7 +589,7 @@ liberator.Hints = function () //{{{
"How links are matched",
"string", "contains",
{
validator: function (value) { return /^contains|wordstartswith|firstletters$/.test(value); }
validator: function (value) { return /^(?:contains|wordstartswith|firstletters|custom)$/.test(value); }
});
liberator.options.add(["wordseparators", "wsp"],

View File

@@ -241,6 +241,7 @@ Change the hint matching algorithm during hint mode. Possible values:
*contains* The typed characters are splitted by spaces, and these character groups have to be anywhere inside the text of the link.
*wordstartswith* The typed characters are matched with the beginning of the first word (see 'wordseparators') in the link as long as possible. If no more or no character matches in the current word, than the matching is continued at the beginning of the next word. The words are worked through in the order they appear in the link. If the typed characters contain spaces, than the characters are splitted by spaces. These character groups are than matched with the beginning of the words, beginning at the first one and continuing with the following words in the order they appear in the link.
*firstletters* Behaves almost as wordstartswith, but non matching words aren't overleaped.
*custom* Delegate to a custom function: liberator.plugins.customHintMatcher(hintString)
-----------------------------------------------------------------------------------------------------------------------------------------------------
____