View | Details | Raw Unified | Return to bug 9580
Collapse All | Expand All

(-)a/C4/Auth.pm (+2 lines)
Lines 318-323 sub get_template_and_user { Link Here
318
            "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,
318
            "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,
319
            EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
319
            EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
320
            GoogleJackets                => C4::Context->preference("GoogleJackets"),
320
            GoogleJackets                => C4::Context->preference("GoogleJackets"),
321
            CoceHost                     => C4::Context->preference("CoceHost"),
322
            CoceProviders                => C4::Context->preference("CoceProviders"),
321
            OpenLibraryCovers            => C4::Context->preference("OpenLibraryCovers"),
323
            OpenLibraryCovers            => C4::Context->preference("OpenLibraryCovers"),
322
            KohaAdminEmailAddress        => "" . C4::Context->preference("KohaAdminEmailAddress"),
324
            KohaAdminEmailAddress        => "" . C4::Context->preference("KohaAdminEmailAddress"),
323
            LoginBranchcode              => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
325
            LoginBranchcode              => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (+9 lines)
Lines 319-321 Enhanced Content: Link Here
319
            - pref: HTML5MediaExtensions
319
            - pref: HTML5MediaExtensions
320
              class: multi
320
              class: multi
321
            - (separated with |).
321
            - (separated with |).
322
    Coce Cover images cache:
323
        -
324
            - Coce server URL
325
            - pref: CoceHost
326
              class: url
327
        -
328
            - Providers
329
            - pref: CoceProviders
330
            - 'separated by comma, for example: aws,gb. Leave empty not to activate this service.'
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc (+3 lines)
Lines 102-107 Link Here
102
	//]]>
102
	//]]>
103
</script>
103
</script>
104
[% END %]
104
[% END %]
105
[% IF CoceProviders %]
106
<script type="text/javascript" src="[% themelang %]/js/coce.js"></script>
107
[% END %]
105
[% IF OpenLibraryCovers %]
108
[% IF OpenLibraryCovers %]
106
<script type="text/javascript" src="[% themelang %]/js/openlibrary.js"></script>
109
<script type="text/javascript" src="[% themelang %]/js/openlibrary.js"></script>
107
<script type="text/javascript">
110
<script type="text/javascript">
(-)a/koha-tmpl/opac-tmpl/prog/en/js/coce.js (+42 lines)
Line 0 Link Here
1
if (KOHA === undefined || !KOHA) { var KOHA = {}; }
2
3
4
/**
5
 * A namespace for Coce cover images cache
6
 */
7
KOHA.coce = {
8
9
  /**
10
   * Search all:
11
   *    <div title="biblionumber" id="isbn" class="coce-thumbnail"></div>
12
   * or
13
   *    <div title="biblionumber" id="isbn" class="coce-thumbnail-preview"></div>
14
   * and run a search with all collected isbns to coce cover service.
15
   * The result is asynchronously returned, and used to append <img>.
16
   */
17
  getURL: function(host,provider,newWindow) {
18
    var ids = [];
19
    $("[id^=coce-thumbnail]").each(function(i) {
20
        ids.push($(this).attr("class")); // id=isbn
21
    });
22
    if (ids.length == 0) return;
23
    ids = ids.join(',');
24
    var coceURL = host + '/cover?id=' + ids + '&provider=' + provider;
25
    $.ajax({
26
      url: coceURL,
27
      dataType: 'jsonp',
28
      success: function(urlPerID){
29
        for (var id in urlPerID) {
30
          var url = urlPerID[id];
31
          $("[id^=coce-thumbnail]."+id).each(function() {
32
            var img = document.createElement("img");
33
            img.src = url;
34
            img.title = url; //FIXME: to delete
35
            $(this).append(img);
36
         });
37
        }
38
      }
39
    });
40
  }
41
  
42
};
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (+7 lines)
Lines 96-101 Link Here
96
	[% IF ( GoogleJackets ) %]
96
	[% IF ( GoogleJackets ) %]
97
        KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
97
        KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
98
	[% END %]
98
	[% END %]
99
100
[% IF ( CoceProviders ) %]
101
KOHA.coce.getURL('[% CoceHost %]', '[% CoceProviders %]',[% covernewwindow %]);
102
[% END %]
103
99
	[% IF OpenLibraryCovers %]
104
	[% IF OpenLibraryCovers %]
100
	KOHA.OpenLibrary.GetCoverFromIsbn();
105
	KOHA.OpenLibrary.GetCoverFromIsbn();
101
	[% END %]
106
	[% END %]
Lines 402-407 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
402
407
403
    [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
408
    [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
404
409
410
[% IF ( CoceProviders ) %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="coce-thumbnail-preview"></div>[% END %]
411
405
    [% IF ( GoogleJackets ) %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>[% END %]
412
    [% IF ( GoogleJackets ) %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>[% END %]
406
    [% IF OpenLibraryCovers %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>[% END %]
413
    [% IF OpenLibraryCovers %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>[% END %]
407
    [% IF ( BakerTaylorEnabled ) %][% IF ( normalized_isbn ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]" target="_blank"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>[% ELSE %]<a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>[% END %][% END %][% END %]
414
    [% IF ( BakerTaylorEnabled ) %][% IF ( normalized_isbn ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]" target="_blank"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>[% ELSE %]<a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>[% END %][% END %][% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (-1 / +7 lines)
Lines 303-308 $(document).ready(function(){ Link Here
303
    [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
303
    [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
304
    [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
304
    [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
305
305
306
[% IF ( CoceProviders ) %]
307
KOHA.coce.getURL('[% CoceHost %]', '[% CoceProviders %]');
308
[% END %]
309
306
    $('#didyoumean').load('/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring | uri %]',
310
    $('#didyoumean').load('/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring | uri %]',
307
        function() {
311
        function() {
308
            $('.searchsuggestion').parent().parent().css({
312
            $('.searchsuggestion').parent().parent().css({
Lines 680-685 $(document).ready(function(){ Link Here
680
                [% END %]
684
                [% END %]
681
685
682
                [% IF ( GoogleJackets ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
686
                [% IF ( GoogleJackets ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
687
688
[% IF ( CoceProviders ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="coce-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
689
683
        [% IF OpenLibraryCovers %][% IF SEARCH_RESULT.normalized_isbn %]<span style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
690
        [% IF OpenLibraryCovers %][% IF SEARCH_RESULT.normalized_isbn %]<span style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
684
                </a>
691
                </a>
685
                [% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
692
                [% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
686
- 

Return to bug 9580