aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorPhil Crosby2012-07-22 14:42:34 -0700
committerPhil Crosby2012-07-22 14:42:34 -0700
commita5a645d1770e844afad9173592eee10349589714 (patch)
tree4b980f81b8a246f08f19b813d4c7f9f04c05d6ca /background_scripts
parent2fa1f87c9422dc9c34e6951f3447a4df0c94aca7 (diff)
downloadvimium-a5a645d1770e844afad9173592eee10349589714.tar.bz2
Use vimium-specific class names, and use vimium reset. Now the vomnibar is more resistant to a site's css.
Previously the vomnibar didn't look great on Quora because of this.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/completion.coffee13
1 files changed, 7 insertions, 6 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee
index b9069dce..5920db0b 100644
--- a/background_scripts/completion.coffee
+++ b/background_scripts/completion.coffee
@@ -27,13 +27,14 @@ class Suggestion
generateHtml: ->
return @html if @html
relevancyHtml = if @showRelevancy then "<span class='relevancy'>#{@computeRelevancy() + ''}</span>" else ""
+ # NOTE(philc): We're using these vimium-specific class names so we don't collide with the page's CSS.
@html =
- "<div class='topHalf'>
- <span class='source'>#{@type}</span>
- <span class='title'>#{@highlightTerms(Utils.escapeHtml(@title))}</span>
+ "<div class='vimiumReset vomnibarTopHalf'>
+ <span class='vimiumReset vomnibarSource'>#{@type}</span>
+ <span class='vimiumReset vomnibarTitle'>#{@highlightTerms(Utils.escapeHtml(@title))}</span>
</div>
- <div class='bottomHalf'>
- <span class='url'>#{@shortenUrl(@highlightTerms(@url))}</span>
+ <div class='vimiumReset vomnibarBottomHalf'>
+ <span class='vimiumReset vomnibarUrl'>#{@shortenUrl(@highlightTerms(@url))}</span>
#{relevancyHtml}
</div>"
@@ -58,7 +59,7 @@ class Suggestion
for [start, end] in ranges
string =
string.substring(0, start) +
- "<span class='match'>" + string.substring(start, end) + "</span>" +
+ "<span class='vomnibarMatch'>" + string.substring(start, end) + "</span>" +
string.substring(end)
string