From d8e2de75544381e1f92389bad0faa060228d9ede Mon Sep 17 00:00:00 2001 From: Darren Jeacocke Date: Wed, 12 Sep 2012 14:19:06 +1000 Subject: Use block strings --- background_scripts/completion.coffee | 16 +++++++++------- content_scripts/vomnibar.coffee | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 5539f7c7..58725fa0 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -29,14 +29,16 @@ class Suggestion relevancyHtml = if @showRelevancy then "#{@computeRelevancy()}" else "" # NOTE(philc): We're using these vimium-specific class names so we don't collide with the page's CSS. @html = - "
- #{@type} - #{@highlightTerms(Utils.escapeHtml(@title))} + """ +
+ #{@type} + #{@highlightTerms(Utils.escapeHtml(@title))}
-
- #{@shortenUrl(@highlightTerms(@url))} +
+ #{@shortenUrl(@highlightTerms(@url))} #{relevancyHtml} -
" +
+ """ shortenUrl: (url) -> @stripTrailingSlash(url).replace(/^http:\/\//, "") @@ -59,7 +61,7 @@ class Suggestion for [start, end] in ranges string = string.substring(0, start) + - "" + string.substring(start, end) + "" + + "#{string.substring(start, end)}" + string.substring(end) string diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index 4a23b95c..ec444e9e 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -138,7 +138,7 @@ class VomnibarUI populateUiWithCompletions: (completions) -> # update completion list with the new data - @completionList.innerHTML = completions.map((completion) -> "
  • " + completion.html + "
  • ").join("") + @completionList.innerHTML = completions.map((completion) -> "
  • #{completion.html}
  • ").join("") @completionList.style.display = if completions.length > 0 then "block" else "none" @updateSelection() @@ -161,12 +161,14 @@ class VomnibarUI initDom: -> @box = Utils.createElementFromHtml( - '
    ' + - '
    ' + - '' + - '
    ' + - '' + - '
    ') + """ +
    +
    + +
    + +
    + """) @box.style.display = "none" document.body.appendChild(@box) -- cgit v1.2.3