diff options
| author | Stephen Blott | 2016-04-03 09:07:57 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2016-04-04 06:15:52 +0100 | 
| commit | 7bdbebf7b50c305c01152c02e9bebf6aa00b3f87 (patch) | |
| tree | efc4a049cf48aa318c4a5980acef6eb0f7162616 | |
| parent | 34f05dcc98c89ce64f242f46f57d95b4da4b77aa (diff) | |
| download | vimium-7bdbebf7b50c305c01152c02e9bebf6aa00b3f87.tar.bz2 | |
Document hint descriptors.
| -rw-r--r-- | content_scripts/link_hints.coffee | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 4d9a02b8..ab13e4a4 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -72,6 +72,12 @@ HintCoordinator =      @onExit = [onExit]      @sendMessage "prepareToActivateMode", modeIndex: availableModes.indexOf mode +  # Hint descriptors are global.  They include all of the information necessary for each frame to determine +  # whether and when a hint from *any* frame is selected.  They include the following properties: +  #   frameId: the frame id of this hint's local frame +  #   localIndex: the index in @localHints for the full hint descriptor for this hint +  #   linkText: the link's text for filtered hints (this is empty for alphabet hints) +  #   hasHref: boolean indicating whether this hint has an href property    getHintDescriptors: ->      console.log "getHintDescriptors", frameId if @debug      # Ensure that the settings are loaded.  The request might have been initiated in another frame. @@ -79,8 +85,7 @@ HintCoordinator =        @localHints = LocalHints.getLocalHints()        console.log "getHintDescriptors", frameId, "[#{@localHints.length}]" if @debug        @sendMessage "postHintDescriptors", hintDescriptors: -        @localHints.map ({linkText, hasHref}, localIndex) -> -          {linkText, hasHref, frameId, localIndex} +        @localHints.map ({linkText, hasHref}, localIndex) -> {frameId, localIndex, linkText, hasHref}    # We activate LinkHintsMode() in every frame and provide every frame with exactly the same hint descriptors.    # We also propagate the key state between frames.  Therefore, the hint-selection process proceeds in lock | 
