[Koha-patches] [PATCH] Bug 9764 - Replace YUI buttons on authority search popup with Bootstrap

Owen Leonard oleonard at myacpl.org
Thu Mar 7 20:30:41 CET 2013


The authority search popup styles several buttons with YUI. Bootstrap
should be used instead.

This patch removes YUI styling from two buttons ("Submit" and "Cancel")
in favor of default styling for consistency's sake. The other buttons
("Clear field" and "Create new") have been moved to a standard toolbar
div and styled with Bootstrap.

Some inline JavaScript has been moved to the <script> tag in order to
eliminate undesirable javascript: pseudo-protocol links.

To test, open a bibliographic record for editing and click the authority
edit link next to a field with authority-linked data in it.
- Confirm that buttons in the popup window look correct.
- Confirm that the "Clear field" button clears the field in the MARC
  editor.
- Confirm that the "Create new authority" button launches a blank
  authority editor.
---
 .../prog/en/includes/auth-finder-search.inc        |   24 +++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc
index 7bffbc5..17d1138 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc
@@ -3,11 +3,14 @@
 //<![CDATA[
 
 $(document).ready(function(){
-
-    var searchButton = new YAHOO.widget.Button("search");
-    var cancelButton = new YAHOO.widget.Button("cancel");
-    var clearButton = new YAHOO.widget.Button("clear");
-    var newButton = new YAHOO.widget.Button("createnew");
+    $("#clear").on("click",function(e){
+        e.preventDefault();
+        finderjumpfull('blinddetail-biblio-search.pl?authid=0&index=[% index %]');
+    });
+    $("#createnew").on("click",function(e){
+        e.preventDefault();
+        finderjumpfull('authorities.pl?index=[% index %]&authtypecode=[% authtypecode %]');
+    });
     // marclist
     $( "#value_any" ).autocomplete({
         source: function(request, response) {
@@ -99,7 +102,10 @@ function finderjumpfull(page)
 //]]>
 </script>
 
-
+<div id="toolbar" class="btn-toolbar">
+    <div class="btn-group"><a href="#" id="clear" class="btn btn-small"><i class="icon-remove-sign"></i> Clear field</a></div>
+    <div class="btn-group"><a href="#" id="createnew" class="btn btn-small"><i class="icon-plus"></i> Create new authority</a></div>
+</div>
 <form name="f" method="get" action="auth_finder.pl">
             <input type="hidden" name="source" value="[% source %]" />
             <input type="hidden" name="op" value="do_search" />
@@ -195,10 +201,6 @@ function finderjumpfull(page)
             </ol>
         </fieldset>
         [% END %]
-        <fieldset class="action"> <input type="submit" value="Start search" class="submit" id="search" /> <a id="cancel" class="cancel close" href="#">Cancel</a>
-        <span id="authfinderops">
-        <a href="javascript:finderjumpfull('blinddetail-biblio-search.pl?authid=0&index=[% index %]')" id="clear" class="button">Clear field</a>
-        <a href="javascript:finderjumpfull('authorities.pl?index=[% index %]&authtypecode=[% authtypecode %]')" id="createnew" class="button">Create new</a>
-        </span>
+        <fieldset class="action"> <input type="submit" value="Search" class="submit" id="search" /> <a id="cancel" class="cancel close" href="#">Cancel</a>
         </fieldset>
 </form>
-- 
1.7.9.5


More information about the Koha-patches mailing list