From: Dan Scott Date: Mon, 17 Apr 2017 02:27:52 +0000 (-0400) Subject: LP#1685840: Dojoless Google Books Preview X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4a86025c88500d171b04ac321eadf2f5d23e424b;p=working%2FEvergreen.git LP#1685840: Dojoless Google Books Preview Avoid polluting the global namespace by wrapping the code in (function() {})(). Add event listeners to the DOM elements rather than the crufty href=javascript:function approach. Optimization: do not load the Google Books JSAPI unless there is a matching embedded ISBN. Use display style directly, rather than munging class names with hide_me Supports IE 10/11, which does not handle responseType = 'json', through the fallback to XHR responseText. IE9 for now; it seems the new Google Books Loader wipes out the DOM in IE9 instead of loading nicely in the . Could go back to the old Google JS loader, which still works, but is deprecated, so could disappear at any point. Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2 index aba12de235..3daeb4985a 100644 --- a/Open-ILS/src/templates/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates/opac/css/style.css.tt2 @@ -774,6 +774,10 @@ div.format_icon { margin:0; } +#gbp_extra, #gbp_arrow_down_link { + display: none; +} + .almost-content-wrapper { background: [% css_colors.background %]; } diff --git a/Open-ILS/src/templates/opac/parts/ac_google_books.tt2 b/Open-ILS/src/templates/opac/parts/ac_google_books.tt2 index a03bfb9c5b..c5a13031ff 100644 --- a/Open-ILS/src/templates/opac/parts/ac_google_books.tt2 +++ b/Open-ILS/src/templates/opac/parts/ac_google_books.tt2 @@ -1,132 +1,161 @@ - diff --git a/Open-ILS/src/templates/opac/parts/record/extras.tt2 b/Open-ILS/src/templates/opac/parts/record/extras.tt2 index 04cdd141e0..b35cf5471d 100644 --- a/Open-ILS/src/templates/opac/parts/record/extras.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/extras.tt2 @@ -8,14 +8,13 @@ IF ctx.google_books_preview; label = l('Google Preview'); name = 'google_preview'; - href = 'javascript:GBDisplayPreview();'; %] -
[% END %]