                     (map #(dom/option #js {:value (name %)})
                          (sort (keys (commands-index)))))
              (dom/input #js {:id "search_term" :type "text" :autoFocus "autofocus" :list "commands"})
-             (dom/a #js {:className "btn btn-default mic" :href "#" :onClick (partial speech/toggle-speech "#search_term" "#search_submit") }
+             (dom/a #js {:className "btn btn-default mic" :href "#" :onClick toggle-speech}
                          (dom/img #js {:id "mic" :src "img/mic.gif"}))
              (dom/input #js {:id "search_submit" :type "submit" :value "Search" :className "btn btn-default btn-lg"}))))
 

                    (map (fn [cmd] [(keyword (:alias cmd)) (:url cmd)]))
                    (into {}))))))

(defn search-form [app owner {:keys [chan]}]
  (om/component
   (dom/form #js {:onSubmit #(submit-search chan %)

;; Routing

(defroute "/" []
  (om/root app-state bolt-app (.getElementById js/document "app"))
  (when (-> window.location.search (.indexOf "start=") (> -1))
    (toggle-speech #js {:target (.querySelector js/document "#mic")})))

(defroute "/to/:command" [command]
  (om/root app-state bolt-app (.getElementById js/document "app"))
