Take advantage of Wekbit speech input user/dbs/ttopac-speech-input
authorDan Scott <dan@coffeecode.net>
Tue, 28 Jun 2011 18:19:13 +0000 (14:19 -0400)
committerDan Scott <dan@coffeecode.net>
Tue, 28 Jun 2011 18:28:16 +0000 (14:28 -0400)
The x-webkit-speech attribute enables speech input on current versions
of Chrome. It's a frill, and I'm not sure we really want entire
libraries of patrons mumbling to themselves more than we already have,
but it's a low-cost frill so let's take advantage of it.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/web/templates/default/opac/parts/advanced/global_row.tt2
Open-ILS/web/templates/default/opac/parts/searchbar.tt2

index ae8081e..6325c0a 100644 (file)
@@ -23,7 +23,7 @@
             <option value="[_1]"[% c == o.value ? ' selected="selected"' : '' %]>[_2]</option>
             [% END; END %]
         </select>
-        <input type='text' size='18' name='query' value="[% q | html %]" />
+        <input type='text' size='18' name='query' value="[% q | html %]" x-webkit-speech />
         <a href="javascript:;" class="row-remover"
             title="[% l('Remove row') %]" alt="[% l('Remove row') %]"
             onclick='var row = this.parentNode.parentNode;var tbody = row.parentNode; if( tbody.getElementsByTagName("tr").length > 2 ) row.parentNode.removeChild(row);'><img src="[% ctx.media_prefix %]/images/adv_row_close_btn.png" /></a>
index 433ce68..383c1d2 100644 (file)
@@ -28,7 +28,8 @@
                     <input type="text" id="search_box" name="query" value="[% is_advanced ? ctx.processed_search_query : CGI.param('query') || l("Search Keyword") | html %]"
                         [% IF is_advanced %]style="width: 450px"[% END %]
                         onfocus="if (this.value=='[% l("Search Keyword") %]'){this.value='';this.style.color='#000';}"
-                        onblur="if (this.value==''){this.value='[% l("Search Keyword") %]';this.style.color='#999';}" />
+                        onblur="if (this.value==''){this.value='[% l("Search Keyword") %]';this.style.color='#999';}"
+                        x-webkit-speech />
                 </div>
                 <input name='page' type='hidden' value="0" />
             </td>