diff options
| author | Phil Crosby | 2012-06-03 01:19:02 -0700 |
|---|---|---|
| committer | Phil Crosby | 2012-06-03 16:56:39 -0700 |
| commit | b04a90e85ffb65d53429c0d482bff98c9a80151e (patch) | |
| tree | 6e7faaf768138f21d9f7e3f321406e4576c5f481 | |
| parent | 51f197952208701542eef60b353f248e5b9c6054 (diff) | |
| download | vimium-b04a90e85ffb65d53429c0d482bff98c9a80151e.tar.bz2 | |
Show relevancy in the ui for debugging search ranking
| -rw-r--r-- | background_scripts/completion.coffee | 13 | ||||
| -rw-r--r-- | vimium.css | 3 |
2 files changed, 13 insertions, 3 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 2f6053b8..47ab1ac4 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -1,14 +1,21 @@ class Suggestion + showRelevancy: true # Set this to true to render relevancy when debugging the ranking scores. + # - type: one of [bookmark, history, tab]. constructor: (@queryTerms, @type, @url, @title, @computeRelevancyFunction, @extraRelevancyData) -> generateHtml: -> - @html ||= + return @html if @html + relevancyHtml = if @showRelevancy then "<span class='relevancy'>#{@computeRelevancy() + ''}</span>" else "" + @html = "<div class='topHalf'> <span class='source'>#{@type}</span> <span class='title'>#{@highlightTerms(utils.escapeHtml(@title))}</span> </div> - <div class='bottomHalf'><span class='url'>#{@shortenUrl(@highlightTerms(@url))}</span></div>" + <div class='bottomHalf'> + <span class='url'>#{@shortenUrl(@highlightTerms(@url))}</span> + #{relevancyHtml} + </div>" shortenUrl: (url) -> @stripTrailingSlash(url).replace(/^http:\/\//, "") @@ -177,4 +184,4 @@ root = exports ? window root.Suggestion = Suggestion root.BookmarkCompleter = BookmarkCompleter root.MultiCompleter = MultiCompleter -root.HistoryCompleter = HistoryCompleter
\ No newline at end of file +root.HistoryCompleter = HistoryCompleter @@ -323,6 +323,9 @@ body.vimiumFindMode ::selection { padding: 5px; background-color: white; color: black !important; + font-family: monospace; + width: 100px; + overflow: hidden; } #vomnibar li .url { color: #224684 !important; } |
