From ba3768c3e961e1c9bafa0809c5ac17e9071734b0 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 4 Dec 2015 14:32:08 -0500 Subject: [PATCH] Bug 15313 - Use Bootstrap modal for z39.50 search MARC and Card preview In order to reduce the number of dependencies for common interactions we should attempt to use Bootstrap modals in place of Greybox ones. This patch modifies the cataloging Z39.50 search results page so that "MARC" and "Card" previews are displayed in Bootstrap modals. Because the modal is triggered from a pop-up window, the modal has been reformated to exclude the footer and reduce the size of the modal header. To test: 1. Apply the patch and navigate to Cataloging. 2. Click the "New from Z39.50/SRU button to open the search window. 3. Perform any search which will return results. 4. Test the "MARC" and "Card" links for multiple results and confirm that the correct data is shown each time. Signed-off-by: Galen Charlton --- .../prog/en/modules/cataloguing/z3950_search.tt | 31 ++++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt index 4272f84..6884be2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt @@ -1,6 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Z39.50/SRU search results -[% INCLUDE 'greybox.inc' %] [% INCLUDE 'doc-head-close.inc' %] @@ -63,6 +62,19 @@ $(document).ready(function(){ e.preventDefault(); $("form[name='f']").find("input[type=text]").val(""); }); + $(".previewData").on("click", function(e){ + e.preventDefault(); + var ltitle = $(this).text(); + var page = $(this).attr("href"); + $("#dataPreviewLabel").text(ltitle); + $("#dataPreview .modal-body").load(page + " div"); + $('#dataPreview').modal({show:true}); + }); + $("#dataPreview").on("hidden", function(){ + $("#dataPreviewLabel").html(""); + $("#dataPreview .modal-body").html("
\"\" "+_("Loading")+"
"); + }); + }); [% IF ( total_pages ) %] @@ -89,6 +101,7 @@ function validate_goto_page(){ .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;} .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;} tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; } +#dataPreview { width : 90%; margin-left : -45%; top: 5%; } .modal-body { max-height: 380px; } .modal-header { padding: 0 14px; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } } [% IF ( opsearch ) %]