aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.coffee
AgeCommit message (Collapse)Author
2016-03-27Remove longestCommonPrefix(); not being used.Stephen Blott
2016-03-27Remove copyObjectOmittingProperties(); not being used.Stephen Blott
2016-03-27Add test for invokeCommandString().Stephen Blott
2016-03-26Multiple minor tweaks.Stephen Blott
Some of this code is showing its age, so these are just a number of minor tweaks (to keep things clear, consistent and concise). Also, add a couple of tests (while we're at it).
2016-03-26Merge branch 'standardise-foreground-commands'Stephen Blott
Conflicts: content_scripts/vimium_frontend.coffee
2016-03-26Simplify invokeCommandString().Stephen Blott
There's no need to have the previous unusual calling style (passing the arguments as a list. It looks more natural to pass tham just as regular arguments, as here.
2016-03-21Simplify singleton handling.Stephen Blott
While working on the visual-mode code, it became apparent that our current "singleton" implementation is unnecessarily complicated. This simplifies it. The keys are now required to be strings. (Previously, they could be any object; which meant we needed to gove objects an identity. All of which was complicated.)
2016-03-18Add Utils.makeIdempotent.Stephen Blott
The intention is to use this to clean up some of the initialisation sequences in the front end.
2016-02-16Use `for own ... of` instead of `for ... of`mrmr1993
2016-02-11Tidy up detection for the current page and context belonging to usmrmr1993
2016-02-03Move help dialog into an iframemrmr1993
2016-01-28Simplify hint-string generation; simplification.Stephen Blott
2015-09-20Merge pull request #1086 from mrmr1993/countMatchesPhil Crosby
Rework to make match counting code for searches more DRY and easier to read
2015-09-11Tweak comment from #1813.Stephen Blott
2015-09-11Move escaping regex special chars to its own utility functionmrmr1993
2015-09-10Don't decode javascript URIs on 46.0.2467.2 and latermrmr1993
The fix for Chromium issue 483000 landed in this version, so it is no longer necessary for #1611
2015-08-28fix a bug that Utils using DomUtilsgdh1995
remove Utils.createElementFromHtml since it's not in use
2015-08-26Use createElementNS for XML documents and remove XML specific codepathsmrmr1993
This implements @gdh1995's idea from #1796.
2015-06-20The second part of b09822eb349ec88a573d4f450e9b57e8fa3c6473 is incorrect.Stephen Blott
Revert it.
2015-06-20Fix SimpleCache bugs.Stephen Blott
This fixes two bugs in SimpleCache. 1. Rotate the cache on the next tick. There is a marginally small chance that the cache will rotate between calls to .has() and .get(). So, we do the rotation ansynchronously. This guarantees that these two functions will always see the same cache state. 2. The implementation of .clear() (which is unused, I think) has at some point become out of date (and incorrect) w.r.t. the implementation of .rotate().
2015-05-31Merge pull request #1697 from smblott-github/vomnibar-map-with-prepopulated-textStephen Blott
Direct keyboard access to custom-search engines via keyword flag
2015-05-29Verify keyword for custom search-engine activation.Stephen Blott
For ... map s Vomnibar.activate keyword=g ... we verify that "g" is indeed a custom search-engine keyword before setting it. If it is not, we output a console.log message and launch a vanilla vomnibar. (An alternative would be to bail.)
2015-05-29Move search-engine parsing to Utils.Stephen Blott
This will allow us to use the same search-engine parsing code in the background page and in content scripts.
2015-05-29Only perform settings migration in the background pagemrmr1993
2015-05-18Merge branch 'vomnibar-insert-history-with-tab'Stephen Blott
Conflicts: background_scripts/completion.coffee
2015-05-17use a less brittle approach to decoding URIs.Stephen Blott
2015-05-17TabToOpen: respect trailing options when extracting query terms.Stephen Blott
A custom search engine like this... i: https://www.google.ie/search?q=%s&num=30&newwindow=1&biw=1918&bih=1015&tbm=isch Google image search Should not match a URL like this... https://www.google.ie/search?q=bbc+sport
2015-05-17TabToOpen: more tidy up pre-PR.Stephen Blott
2015-05-17TabToOpen: tidy up pre-PR.Stephen Blott
2015-05-16Refactor query extraction to Utils.extractQuery().Stephen Blott
If we go with this and #1662, then we can share the utility.
2015-05-14Rework how SimpleCache works.Stephen Blott
Change the implementation of SimpleCache such that it does not rely upon timers. The problem with times is that they retain a reference to the object even if Vimium itself loses all references. This approach seems simpler, and perfectly adequate for our purposes.
2015-05-11Merge branch 'search-engine-completion-v5'Stephen Blott
2015-05-10Search completion; fix synchronisation issue.Stephen Blott
2015-05-10Search completion; reuse previous query.Stephen Blott
2015-05-10Search completion; refactor job-running logic.Stephen Blott
2015-05-10Search completion; rework SimpleCache.Stephen Blott
2015-05-10Search completion; refactor searchEngineCompleter.Stephen Blott
This revamps how search-engine configuration is handled, and revises some rather strange legacy code.
2015-05-09Search completion; refactor SearchCompleter activation.Stephen Blott
2015-05-08Search completion; search keyword on SPACE.Stephen Blott
2015-05-08Search completion; clear (not replace) the cache.Stephen Blott
2015-05-06Search completion; more tweaks.Stephen Blott
2015-05-05Search completion; misc.Stephen Blott
2015-05-05Search completion; better SimpleCache.Stephen Blott
SimpleCache should reset the timer very time it's rotated (including when the allowed number of entries is exceeded.
2015-05-05Fix javascript: URIs.Stephen Blott
This is @mrmr9393's suggestion from #1636. It mimic's Chrome's behaviour when a javascript: URI is enetered into the omnibox (or clicked). Fixes #1611.
2015-05-03Search completion; make completion lookup asynchronous.Stephen Blott
2015-05-03Search completion; tweaks and refactoring.Stephen Blott
2015-05-02Search completion; minor tweaks.Stephen Blott
Including: - Make completers classes. That way, we may be able to get better code reuse.
2015-05-02Search completion; refactor to separate file.Stephen Blott
2015-05-01Always URL decode javascript: URLs.Stephen Blott
2015-04-30URL decode bookmarklets, if necessary.Stephen Blott