[Vimprobable-users] [PATCH] Refactured hinting
Vimprobable is a lean web browser optimised for full keyboard control
Brought to you by:
hanness
From: Daniel C. <dan...@gm...> - 2011-08-10 08:19:44
|
Hi! I used the chance to test the new mailinglist to public a refactured hinting.js. I spent some time in cleaning up the hinting code and added some changes so that the hinting acts like in the vimperator. Changes i made: - Ported hinting javascript in to object to make the code cleaner. - Used speaking varibale names. - Also removed useless code and added some utility methods - Adde early breakout to hinting.js - Also reduced some if else nesting by logical reduction - Added focusHint() function and used cloning to generate hintelements - Made some methods private - Reduced number of variables in hinting javascript. Hints are now saved with some metadata (element, number, text, span, backgrouncolor, color) into one array - Removed extravariable for focused element in hinting.js - Implemented removing of hints if a number is selected. That means that hint are removed that don't match a given number like in vimperator. I you type 1 in hintingmode all hint except of [1,10-19] will be removed. The hintnumber will not be updated and it's already possible to tab or shift- tab through the remaining hints. - Implemented possibility to fire focused hint by return key. I hope this feature will make other hintingfeteatures easier to implement Sorry for the squash patch, was much easier for me to generate. I this we should made some decision where to handle the different to implement hinting actions (open link, copy linktext to clipboard, focus hinted element). In my opinion this could be given via parameter to the js-function that generates the hints, so we can later if the hint is selected simply use fire() to handle the action. This should also keep the c-code cleaner. I could not find the path for copy the hinted url to clipboard that was mentioned in a previous mail, i think i should it merke into the patch. Daniel -- Daniel Carl Gustav-Fischer-Straße 33 07745 Jena 0176/20166455 NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone |