       window.open this.href.replace 'file://', ''
       false
 
-  innerHTML: ->
-    html = '''
-      <link rel="stylesheet" href="static/bootstrap-1.4.0.css">
-      <style>body { padding:10px; }</style>
-    '''
-    html += '<h1>Results</h1>'
-    html += '<ul id="find-in-project-results-view">'
-    for {name, url} in @results
+  render: ->
+    results = _.map @results, ({name, url}) =>
       line = _.escape name
       [file, match...] = line.split ':'
-      match = (match.join ':').replace @term, "<code>#{@term}</code>"
-      html += "<li><a href='#{url}'>#{file}:#{match}</a></li>"
-    html += '</ul>'
-    html+
+      match: (match.join ':').replace(@term, "<code>#{@term}</code>")
+      url: url
+      file: file
+
+    @template results: results
+
+  template: handlebars.compile '''
+    <link rel="stylesheet" href="static/bootstrap-1.4.0.css">
+    <style>body { padding:10px; }</style>
+    <h1>Results</h1>
+    <ul id="find-in-project-results-view">
+    {{#each results}}
+      <li><a href='{{url}}'>{{{file}}}:{{{match}}}</a></li>
+    {{/each}}
+    </ul>
+  '''

_ = require 'underscore'
$ = require 'jquery'
fs = require 'fs'

ChildProcess = require 'child-process'
Browser = require 'browser'

        url: _.first line.split ":"

  add: ->
    super @render()

    # gross!
    iframe = $ $('iframe')[0].contentDocument.body
