From d7093262de30a2736cd9d92171d3bde0c9b1375d Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 7 Feb 2015 22:27:51 +0100 Subject: [PATCH] Reduce the number of hints on Google Calendar As noted in https://github.com/akhodakivskiy/VimFx/pull/451#issuecomment-71582664, Google Calendar gets too many hints. That's because many buttons are implemented as `
`s with lots of `
`s inside, all of which have "button" in the their class names. This commit exludes elements with "button" in the class name if they contain yet such an element. This works fine on Google Calendar. Hopefully it does not exlude too much on other pages. --- extension/lib/commands.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extension/lib/commands.coffee b/extension/lib/commands.coffee index 456b797..c9a8162 100644 --- a/extension/lib/commands.coffee +++ b/extension/lib/commands.coffee @@ -303,11 +303,12 @@ command_follow = (vim, event, count) -> if input and not getElementShape(input) type = 'clickable' # Elements that have “button” somewhere in the class might be clickable, - # unless they contain a real link or button in which case they likely are + # unless they contain a real link or button or yet an element with + # “button” somewhere in the class, in which case they likely are # “button-wrapper”s. (`.className` is not a string!) when not isXUL and typeof element.className == 'string' and element.className.toLowerCase().contains('button') - unless element.querySelector('a, button') + unless element.querySelector('a, button, [class*=button]') type = 'clickable' semantic = false # When viewing an image it should get a marker to toggle zoom. -- 2.39.3