Bug 7741 [Follow-up] Clear search terms in Z3950 search page
authorOwen Leonard <oleonard@myacpl.org>
Tue, 9 Dec 2014 18:00:02 +0000 (13:00 -0500)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 17 Feb 2015 02:40:08 +0000 (23:40 -0300)
This patch makes a follow-up change and takes as its basis a dependency
on Bug 13218 - usability enhancement for z39.50 search. If we have a
one-column search form it's possible to put the "Clear search form" link
at the bottom of the form rather than in the header, logically
associating it with the grouping of form fields which will be affected.

Doing so also allows us to eliminate all the custom styling which was an
issue for QA.

Other changes made by this patch: Fixing the indentation
error, correcting the case of the link text ("Clear search form" instead
of "Clear Search Form"), and adding "preventDefault()" to the click
handler so that clicking the link doesn't scroll the user back to the
top of the page.

To test, apply the previous patch and this one on top of Bug 13218.
Repeat the test plan.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt

index 92b1f86..9b89e91 100644 (file)
@@ -32,7 +32,8 @@
         $(".linktools").hide();
         $("tr").removeClass("selected");
     });
-    $("#resetZ3950Search").click(function() {
+    $("#resetZ3950Search").click(function(e) {
+        e.preventDefault();
         $("form[name='f']").find("input[type=text]").val("");
     });
 
@@ -89,7 +90,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
 <div id="doc3" class="yui-t7">
       <div id="bd">
          [% IF ( opsearch ) %]
-<h2>Order from external source <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="clearsearch"><a id="resetZ3950Search" href="#">Clear Search Form</a></span></span></h2>
+<h2>Order from external source</h2>
     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
     <input type="hidden" name="op" id="op" value="do_search" />
        <div class="yui-g">
@@ -117,6 +118,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
               </select>
               </li>
          </ol>
+        <p><a id="resetZ3950Search" href="#">Clear search form</a></p>
     </fieldset>
     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
     <input type="hidden" name="basketno" value="[% basketno %]" />
index 1878578..70d2b26 100644 (file)
@@ -58,9 +58,10 @@ $(document).ready(function(){
         } else
             return true;
     });
-    $("#resetZ3950Search").click(function() {
-               $("form[name='f']").find("input[type=text]").val("");
-       });
+    $("#resetZ3950Search").click(function(e) {
+        e.preventDefault();
+        $("form[name='f']").find("input[type=text]").val("");
+    });
 });
 
 [% IF ( total_pages ) %]
@@ -103,7 +104,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
     [% END %]
     <div id="bd">
     [% IF ( opsearch ) %]
-        <h2>Z39.50 Authority search points<span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="clearsearch"><a id="resetZ3950Search" href="#">Clear Search Form</a></span></span></h2>
+        <h2>Z39.50 Authority search points</h2>
         <form method="post" action="z3950_auth_search.pl" name="f" class="checkboxed">
         <input type="hidden" name="op" id="op" value="do_search" />
         <input type="hidden" name="authid" value="[% authid %]" />
@@ -128,6 +129,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
                     <li><label for="title">Title (any): </label> <input type="text" id="title"  name="title" value="[% title | html %]" /></li>
                     <li><label for="uniformtitle">Title (uniform): </label> <input type="text" id="uniformtitle"  name="uniformtitle" value="[% uniformtitle | html %]" /></li>
                 </ol>
+                <p><a id="resetZ3950Search" href="#">Clear search form</a></p>
                 </fieldset>
             </div>
             <div class="yui-g">
index cc16e9a..79e8015 100644 (file)
@@ -59,7 +59,8 @@ $(document).ready(function(){
         } else
             return true;
     });
-    $("#resetZ3950Search").click(function() {
+    $("#resetZ3950Search").click(function(e) {
+        e.preventDefault();
        $("form[name='f']").find("input[type=text]").val("");
     });
 });
@@ -104,7 +105,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
 [% END %]
       <div id="bd">
          [% IF ( opsearch ) %]
-<h2>Z39.50/SRU search <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="clearsearch"><a id="resetZ3950Search" href="#">Clear Search Form</a></span></span></h2>
+<h2>Z39.50/SRU search</h2>
     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
     <input type="hidden" name="op" id="op" value="do_search" />
        <div class="yui-g">
@@ -122,6 +123,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
         <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
         <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li>
         </ol>
+    <p><a id="resetZ3950Search" href="#">Clear search form</a></p>
     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
     <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
     </div>