    (for [language languages]
      [:option {:key (:value language) :value (:value language)} (:text language)])])
 
-(defn- single-input-view [corpus query-cursor displayed-query show-remove-btn?
-                          remove-query-handler on-text-changed]
+(defn- single-input-view
+  "HTML that is shared by the search views that only show a single text input,
+  i.e., the simple and CQP views."
+  [corpus query-cursor displayed-query show-remove-btn? show-checkboxes?
+   remove-query-handler on-text-changed]
   (let [query     (:query @query-cursor)
         phonetic? (not= -1 (.indexOf query "phon="))]
     [:form {:style {:display "table" :margin-left -30 :margin-bottom 20}}

                                       :value       displayed-query
                                       :on-change   #(on-text-changed % query-cursor phonetic?)
                                       :on-key-down #(on-key-down % query-cursor)}]]]
     [:div {:style {:display "table-row"}}
      [:div {:style {:display "table-cell"}}]
      [:div.checkbox {:style {:display "table-cell"}}
       (when (:has-phonetic corpus)
         [:label
          [:input {:name      "phonetic"
                   :type      "checkbox"
                   :checked   phonetic?
                   :on-change #(on-phonetic-changed % query-cursor)}] " Phonetic form"])
       (when (:has-headword-search corpus)
         [:label {:style {:margin-left 20}}
          [:input {:type      "checkbox"
                   :value     "1"
                   :checked   (:headword-search @query-cursor)
                   :on-change #(on-headword-search-changed % query-cursor)
                   :id        "headword_search"
                   :name=     "headword_search"} " Headword search"]])]]]))

(defn- simple [corpus query-cursor show-remove-btn? remove-query-handler]
(defn- simple
  "Simple search view component"
  [corpus query-cursor show-remove-btn? remove-query-handler]

                          (let [query (aget event "target" "value")]
                            (swap! query-cursor assoc :query query)))]
    (single-input-view corpus query-cursor displayed-query show-remove-btn?
                       false remove-query-handler on-text-changed)))

(defn search-inputs
  "Component that lets the user select a search view (simple, extended
