Bugzilla – Attachment 10539 Details for
Bug 7161
Open Library - Larger image, Read, borrow and checked-out status
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 7161
patch.txt (text/plain), 4.08 KB, created by
Marcel de Rooy
on 2012-06-27 12:43:42 UTC
(
hide
)
Description:
Patch for 7161
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2012-06-27 12:43:42 UTC
Size:
4.08 KB
patch
obsolete
>From 31e314277889c119492e66d8cba6932222ee2ff9 Mon Sep 17 00:00:00 2001 >From: Amit Gupta <amit.gupta@osslabs.biz> >Date: Sat, 5 Nov 2011 03:36:23 -0400 >Subject: [PATCH] Bug-7161 Open Library - Larger image, Read, borrow and > checked-out status >Content-Type: text/plain; charset="utf-8" > >To test: >1. go into system administration and search for "cover" >2. change "OpenLibraryCovers" to "add" and all other to "don't show" >3. verify that opac search results have small covers, while > detail page has big ones > >Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org> > >Addressing M. de Rooy's concerns > >* remove console.log >* removed some comments that looked like debug code? >* remove ebook display - I couldn't get it to work properly, and we want the bigger images. So it's gone. >* remove get_cover > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >June 27, 2012: Removing unused function keys from openlibrary.js. >--- > koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js | 61 +++++++++++++------------ > 1 files changed, 31 insertions(+), 30 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js b/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js >index 1c62e6c..afac4d3 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js >+++ b/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js >@@ -27,44 +27,45 @@ KOHA.OpenLibrary = { > scriptElement.setAttribute("id", "jsonScript"); > scriptElement.setAttribute("src", > "http://openlibrary.org/api/books?bibkeys=" + escape(bibkeys) + >- "&callback=KOHA.OpenLibrary.olCallBack"); >+ "&callback=KOHA.OpenLibrary.olCallBack&jscmd=data"); > scriptElement.setAttribute("type", "text/javascript"); > document.documentElement.firstChild.appendChild(scriptElement); > > }, > >+ >+ > /** > * Add cover pages <div > * and link to preview if div id is gbs-thumbnail-preview > */ > olCallBack: function(booksInfo) { >- for (id in booksInfo) { >- var book = booksInfo[id]; >- var isbn = book.bib_key.substring(5); >- >- $("."+isbn).each(function() { >- var a = document.createElement("a"); >- a.href = book.info_url; >- if (typeof(book.thumbnail_url) != "undefined") { >- var img = document.createElement("img"); >- img.src = book.thumbnail_url; >- $(this).append(img); >- var re = /^openlibrary-thumbnail-preview/; >- if ( re.exec($(this).attr("id")) ) { >- $(this).append( >- '<div style="margin-bottom:5px; margin-top:-5px;font-size:9px">' + >- '<a href="' + >- book.info_url + >- '">Preview</a></div>' >- ); >- } >- } else { >- var message = document.createElement("span"); >- $(message).attr("class","no-image"); >- $(message).html(NO_OL_JACKET); >- $(this).append(message); >- } >- }); >- } >- } >+ for (id in booksInfo) { >+ var book = booksInfo[id]; >+ var isbn = id.substring(5); >+ $("."+isbn).each(function() { >+ var is_opacdetail = /openlibrary-thumbnail-preview/.exec($(this).attr("id")); >+ var a = document.createElement("a"); >+ a.href = booksInfo.url; >+ if (book.cover) { >+ var img = document.createElement("img"); >+ if (is_opacdetail) { >+ img.src = book.cover.medium; >+ $(this).append(img); >+ $(this).append( >+ '<div class="results_summary">' + '<a href="' + book.url + '">Preview</a></div>' >+ ); >+ } else { >+ img.src = book.cover.small; >+ $(this).append(img); >+ } >+ } else { >+ var message = document.createElement("span"); >+ $(message).attr("class","no-image"); >+ $(message).html(NO_OL_JACKET); >+ $(this).append(message); >+ } >+ }); >+ } >+ } > }; >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7161
:
6221
|
6227
|
9865
|
9873
| 10539 |
10540
|
11312