SHOW:
|
|
- or go back to the newest paste.
| 1 | // JS from jQuery, AddThis, Pinterest. | |
| 2 | <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> | |
| 3 | <script src="//catalogue.ulrls.lon.ac.uk/screens/jquery.urlshortener.js" type="text/javascript"></script> | |
| 4 | <script src="//s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f32821f48ef902e" type="text/javascript"></script> | |
| 5 | <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script> | |
| 6 | <script src="//catalogue.ulrls.lon.ac.uk/screens/stackrequest.js" type="text/javascript"></script> | |
| 7 | - | //alert(recordid); |
| 7 | + | |
| 8 | // ISBN13 to ISBN10 conversion for Amazon jackets | |
| 9 | function isbn13to10(isbn13) {
| |
| 10 | var isbn9 = isbn13.substring(3,12); | |
| 11 | var n=0; var c=0; | |
| 12 | for (dig=0;dig<9;dig++) {
| |
| 13 | c = isbn9.substr(dig,1) * 1; | |
| 14 | n += (10-dig)*c; | |
| 15 | } | |
| 16 | n = 11 - n%11; | |
| 17 | if (n==11) isbn10=isbn9+'0'; | |
| 18 | else if (n==10) isbn10=isbn9+'X'; | |
| 19 | else isbn10=isbn9+n; | |
| 20 | return isbn10; | |
| 21 | } | |
| 22 | </script> | |
| 23 | <script type="text/javascript"> | |
| 24 | // Rewrite Amazon image and link if ISBN-13. | |
| 25 | var azAsin = key.substring(5); | |
| 26 | if (azAsin.length == 13) {
| |
| 27 | azAsin10 = isbn13to10(azAsin); | |
| 28 | azAsin10img = 'http://images-eu.amazon.com/images/P/' + azAsin10 + '.02.MZZZZZZZ.jpg'; | |
| 29 | azAsin10url = 'http://www.amazon.co.uk/exec/obidos/tg/detail/-/' + azAsin10; | |
| 30 | document.getElementById("imageAnyComponent_0").src=azAsin10img;
| |
| 31 | document.getElementById("imageLinkComponent").href=azAsin10url;
| |
| 32 | } | |
| 33 | </script> | |
| 34 | <script type="text/javascript"> | |
| 35 | var urlindex = document.URL.indexOf('record/C__R');
| |
| 36 | recordid = document.URL.substring(urlindex + 11,urlindex + 19); | |
| 37 | </script> | |
| 38 | <script type="text/javascript"> | |
| 39 | (function() {
| |
| 40 | var mobilestub = "http://encore.ulrls.lon.ac.uk/iii/mobile/record/C__R"; | |
| 41 | var qrrecordid = (recordid); | |
| 42 | var longurl = '' + mobilestub + qrrecordid + '?utm_source=encore%26utm_medium=qr%26utm_campaign=mobile'; | |
| 43 | var qrdiv=document.createElement('div');
| |
| 44 | //alert(longurl); | |
| 45 | - | var azImageDiv = document.getElementById("imageAnyComponent_0");
|
| 45 | + | |
| 46 | //alert(shorturl); | |
| 47 | qrdiv.innerHTML = '<span class="bibInfoHeader">Mobile Catalogue</span><div class="headerFields"><img src="http://chart.apis.google.com/chart?cht=qr&chs=100x100&chld=L|2&chl=' + shorturl + '" alt="Scan to view this record on the Mobile Catalogue" title="Scan to view this record on the Mobile Catalogue" /><br><a href="http://www.senatehouselibrary.ac.uk/library/helpandsupport/qrcodes.shtml">What\'s this\?</a></div>'; | |
| 48 | - | //alert (azImageDiv.width); |
| 48 | + | |
| 49 | - | //alert (azImageDiv.height); |
| 49 | + | |
| 50 | - | // key is a variable Encore uses for checking Google Books. It contains 'ISBN:' plus an ISBN10. |
| 50 | + | |
| 51 | )(); | |
| 52 | - | //alert (azAsin); |
| 52 | + | |
| 53 | <script type="text/javascript"> | |
| 54 | - | pinterestDiv.innerHTML = '<span class="bibInfoHeader">Pinterest</span><div class="addthis_toolbox addthis_default_style" ><p>' + '<a class="addthis_button_pinterest" pi:pinit:url="https://encore.ulrls.lon.ac.uk/iii/encore/record/C__R' + recordid + '" pi:pinit:media="' + 'http://images-eu.amazon.com/images/P/' + azAsin + '.01._SCLZZZZZZZ_.jpg"' + ' pi:pinit:layout="horizontal" pi:pinit:description="Senate House Libraries"></a></div>'; |
| 54 | + | |
| 55 | var addthisDiv=document.createElement('div');
| |
| 56 | addthisDiv.innerHTML = '<span class="bibInfoHeader">Bookmark This Record</span><div class="addthis_toolbox addthis_default_style ">' + | |
| 57 | '<p><div class="headerFields">Persistent link to this record: <a title="Persistent link to this record for bookmarking" alt="Persistent link to this record for bookmarking" href="https://encore.ulrls.lon.ac.uk/iii/encore/record/C__R' + recordid + '">https://encore.ulrls.lon.ac.uk/iii/encore/record/C__R' + recordid + '</a></p></div>' + | |
| 58 | '<a class="addthis_button_twitter"></a>' + | |
| 59 | //'<a class="addthis_button_pinterest"></a>' + | |
| 60 | '<a class="addthis_button_connotea"></a>' + | |
| 61 | '<a class="addthis_button_citeulike"></a>' + | |
| 62 | '<a class="addthis_button_diigo"></a>' + | |
| 63 | '<a class="addthis_button_mendeley"></a>' + | |
| 64 | '<a class="addthis_button_email"></a>' + | |
| 65 | '<a class="addthis_button_compact"></a>' + | |
| 66 | '<a class="addthis_counter addthis_bubble_style"></a>' + | |
| 67 | '</p></div>' ; | |
| 68 | document.getElementById("customBottom").appendChild(addthisDiv);
| |
| 69 | } | |
| 70 | )(); | |
| 71 | </script> | |
| 72 | <script type="text/javascript"> | |
| 73 | (function() {
| |
| 74 | var azImageDiv = document.getElementById("imageAnyComponent_0");
| |
| 75 | if (azImageDiv) {
| |
| 76 | if (azImageDiv.width>1 && azImageDiv.height>1) {
| |
| 77 | var azAsin = key.substring(5); | |
| 78 | if (azAsin.length == 13) {
| |
| 79 | azAsin = isbn13to10(azAsin); | |
| 80 | } | |
| 81 | var pinUrl = encodeURI('https://encore.ulrls.lon.ac.uk/iii/encore/record/C__R' + recordid);
| |
| 82 | var pinMedia = encodeURI('http://images-eu.amazon.com/images/P/' + azAsin + '.01._SCLZZZZZZZ_.jpg');
| |
| 83 | var pinDesc = encodeURIComponent(document.title.substring(38)); | |
| 84 | var pinterestDiv=document.createElement('div');
| |
| 85 | pinterestDiv.innerHTML = '<span class="bibInfoHeader">Pinterest</span><p>' | |
| 86 | + '<a href="http://pinterest.com/pin/create/button/' | |
| 87 | + '?url=' + pinUrl | |
| 88 | + '&media=' + pinMedia | |
| 89 | + '&description=' + pinDesc | |
| 90 | + '" class="pin-it-button" count-layout="horizontal" target="_blank"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></p>' | |
| 91 | document.getElementById("customBottom").appendChild(pinterestDiv);
| |
| 92 | } | |
| 93 | } | |
| 94 | })(); | |
| 95 | </script> | |
| 96 | <script type="text/javascript"> | |
| 97 | stackrequest(); | |
| 98 | </script> | |
| 99 | <script src="//catalogue.ulrls.lon.ac.uk/screens/ltfl.js" type="text/javascript"></script> | |
| 100 | <script type="text/javascript"> | |
| 101 | ltflencore(); | |
| 102 | </script> | |
| 103 | <script src="//ltfl.librarything.com/forlibraries/widget.js?id=702-3388231028" type="text/javascript"></script> | |
| 104 | ||
| 105 | <script type="text/javascript"> | |
| 106 | // This is catalogue.ulrls.lon.ac.uk/screens/stackrequest.js: | |
| 107 | function stackrequest() {
| |
| 108 | var holdingsdiv = document.getElementById('toggleAnyComponent');
| |
| 109 | if (holdingsdiv) {
| |
| 110 | if (holdingsdiv.innerHTML.match(/STACK SERVICE/)) {
| |
| 111 | var requeststub = "http://www.ulrls.lon.ac.uk/itemrequest/requestform.aspx?record="; | |
| 112 | var stackrequestDiv=document.createElement('div');
| |
| 113 | stackrequestDiv.innerHTML = '<div style="padding-bottom: 15px;" class="taggingLink">' | |
| 114 | + '<a id="stackrequestbutton" href="' | |
| 115 | + requeststub | |
| 116 | + recordid | |
| 117 | + '">Request from Store</a>' | |
| 118 | + '</div>' ; | |
| 119 | document.getElementById("customTop").appendChild(stackrequestDiv);
| |
| 120 | } | |
| 121 | } | |
| 122 | } | |
| 123 | </script> | |
| 124 | <script type="text/javascript"> | |
| 125 | // This is catalogue.ulrls.lon.ac.uk/screens/ltfl.js | |
| 126 | function ltflencore() {
| |
| 127 | var ltflDiv=document.createElement('div');
| |
| 128 | ltflDiv.innerHTML = '<!-- other edns -->' + | |
| 129 | '<div id="ltfl_related" class="ltfl"></div>' + | |
| 130 | '<!-- Similar items -->' + | |
| 131 | '<div id="ltfl_similars" class="ltfl"></div>' + | |
| 132 | '<!-- Tags -->' + | |
| 133 | '<div id="ltfl_tagbrowse" class="ltfl"></div>' + | |
| 134 | '<!-- Reviews -->' + | |
| 135 | '<div class="ltfl_reviews"></div>' + | |
| 136 | '<!-- Shelf browse -->' + | |
| 137 | '<div id="ltfl_shelfbrowse_both" class="ltfl"></div>' + | |
| 138 | '<!-- Series -->' + | |
| 139 | '<div id="ltfl_series" class="ltfl"></div>' ; | |
| 140 | document.getElementById("moreDetailsAnyComponent").appendChild(ltflDiv);
| |
| 141 | } | |
| 142 | </script> |