   ;; Bind changes of user selections to update the generated POSTing URL
   (bind ($ "#url-uuid-input") :keyup update-post-url)
   (bind ($ "#url-scheme-input") :change update-post-url)
-  (bind ($ "#url-status-input") :change update-post-url))
-
-;; ----- Exported function for the results page -----
-
-(defn ^:export setup-results []
-  (doseq [result js/resultData]
-    (.append ($ "#results") (result-template result)))
-  (.initHighlightingOnLoad js/hljs)) ; syntax highlight the results+  (bind ($ "#url-status-input") :change update-post-url))

;; ----- Hiccup HTML snippets for the results page -----

(defhtml row-for
  "Hiccup HTML for a key/value row in a table."
  [key val]
  [:tr 
    [:td key]
    [:td val]])

(defhtml body-table
  "
  HTML for a table, containing an optional query string row and the query string content
  and a body label row and the body content that was POSTed.
  "
  [result]
  (let [query-string (aget result "parsed-query-string")
        body (aget result "body")]
    [:div.col-md-8
      (if (or query-string body)
        [:table.table.table-bordered.result-table
          [:tbody
            (if query-string (table-header "Query String"))
            (if query-string (map-content query-string result))
            (if body (table-header "Body"))
            (if body (map-content body result))]])]))

(defhtml headers-table
  "HTML for a table with all the HTTP header name/value pairs."
  [result]
  [:div.col-md-4
    [:table.table.table-bordered.result-table
      [:tbody
        [:tr
          [:th.text-center {:colspan 2} "Headers"]]
        (table-rows (js->clj (.-headers result)))]]])

(defhtml result-table-header
  "HTML for a table header with timestamp and status."
  [result]
  [:div
    [:div.clearfix

  [result]
  ;; DIV container for the whole result
  [:div.result-group.clearfix
    ;; General information about this request
    (result-metadata result)
    ;; Details about the request
    [:div.clearfix
      [:div.col-md-8
        (request-query-string-table result)
        (request-body-table result)]
      [:div.col-md-4
        (request-headers-table result)]]
    ;; Row divider
    [:div
      [:div.col-md-12
        [:hr]]]])

;; ----- Exported function for the results page -----

(defn ^:export setup-results []
  ;; Render each result
  (doseq [result js/resultData]
    (.append ($ "#results") (result-template result)))
  ;; Syntax highlight the results
  (.initHighlightingOnLoad js/hljs))

;; ----- Exported function for the home page -----

