Improvments for hints/page-prev/page-next

This commit is contained in:
Florian Bruhin 2014-07-09 21:14:15 +02:00
parent 387ff8bbb6
commit 72b854049b
4 changed files with 8 additions and 11 deletions

View File

@ -5,8 +5,6 @@ Bugs
e.g. loading a page and immediately yanking the (non-resolved) URL should
work.
- page-forward clicks "Newest" on http://explosm.net/ instead of "Next".
- seir sometimes sees "-- COMMAND MODE --" even though that should never
happen.

View File

@ -375,7 +375,7 @@ class HintManager(QObject):
return None
for regex in config.get('hints', option):
for e in elems:
if regex.match(e.toPlainText()):
if regex.search(e.toPlainText()):
return e
return None

View File

@ -576,14 +576,13 @@ DATA = OrderedDict([
('next-regexes',
SettingValue(types.RegexList(flags=re.IGNORECASE),
r'\bnext\b,\bmore\b,\bnewer\b,^>$$,^(>>|»|→|≫)$$,'
r'^(>|»|→|≫),(>|»|→|≫)$$'),
r'\bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b'),
"A comma-separated list of regexes to use for 'next' links."),
('prev-regexes',
SettingValue(types.RegexList(flags=re.IGNORECASE),
r'\bprev(ious)\b,\bback\b,\bolder\b,^<$$,^(<<|«|←|≪)$$,'
r'^(<|«|←|≪),(<|«|←|≪)$$'),
r'\bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,'
r'\b(<<|«)\b'),
"A comma-separated list of regexes to use for 'prev' links."),
)),

View File

@ -40,10 +40,10 @@ Group = enum('all', 'links', 'images', 'editable', 'url', 'prevnext_rel',
SELECTORS = {
Group.all: ('a, textarea, select, input:not([type=hidden]), button, '
Group.all: ('a, area, textarea, select, input:not([type=hidden]), button, '
'frame, iframe, [onclick], [onmousedown], [role=link], '
'[role=option], [role=button], img'),
Group.links: 'a',
Group.links: 'a, area, link',
Group.images: 'img',
# This doesn't contain all the groups where we should switch to insert mode
# - it is just used when opening the external editor.
@ -56,8 +56,8 @@ SELECTORS = {
'input[type=search]:focus, '
'textarea:focus'),
Group.url: '[src], [href]',
Group.prevnext_rel: 'link, [role=link]',
Group.prevnext: 'a, button, [role=button]',
Group.prevnext_rel: 'a, area, link, [role=link]',
Group.prevnext: 'a, area, button, [role=button]',
}
FILTERS = {