1jQuery(function ($) { 2 3 $('document').ready(function () { 4 5 var liseuse = liseuse || {}; 6 7 // Déclaration des fonctions 8 liseuse = { 9 init: function (_this) { 10 url_pdf = _this.attr('data-href'); 11 id_pdf = _this.attr('data-id'); 12 13 download = _this.data('dwnl'); 14 print = _this.data('print'); 15 16 $('body').append('<div id="flipbookContainer" style="margin:0 auto;"></div>'); 17 $('body').css('overflow-y', 'hidden'); 18 19 hideControlsPDF = 'sound, share, fullScreen, outline'; 20 if (download == 'non') hideControlsPDF = hideControlsPDF + ', download'; 21 22 var options = { 23 soundEnable: false, 24 height: '100%', 25 duration: 800, 26 hideControls: hideControlsPDF, 27 backgroundColor: "rgba(0, 0, 0, 0.9)", 28 text: { 29 toggleSound: "Activer/désactiver le son", 30 toggleThumbnails: "Afficher les miniatures", 31 toggleOutline: "Afficher les ancres", 32 previousPage: "Page précédente", 33 nextPage: "Page suivante", 34 toggleFullscreen: "Plein écran", 35 zoomIn: "Zoomer", 36 zoomOut: "Dézoomer", 37 toggleHelp: "Activer l'aide", 38 39 singlePageMode: "Une page", 40 doublePageMode: "Double page", 41 downloadPDFFile: "Télécharger le PDF", 42 gotoFirstPage: "Première page", 43 gotoLastPage: "Dernière page", 44 45 share: "Partager" 46 }, 47 onCreateUI: function () { 48 49 var url = window.location.href; 50 if (url.substring(0, url.indexOf('#')) != '') { 51 url_site = url.substring(0, url.indexOf('#')); 52 } else { 53 url_site = url; 54 } 55 56 // Régorganiser la barre d'outil 57 $('.df-ui-wrapper.df-ui-controls .df-ui-more .more-container .df-ui-start').prependTo('.df-ui-wrapper.df-ui-controls'); // Btn "Première page" au tout début 58 $('.df-ui-wrapper.df-ui-controls .df-ui-more .more-container .df-ui-end').insertAfter('.df-ui-wrapper.df-ui-controls .df-ui-next'); // Btn "Dernière page" après le btn "Page suivante" 59 $('.df-ui-wrapper.df-ui-controls .df-ui-zoomin').insertBefore('.df-ui-wrapper.df-ui-controls .df-ui-outline'); // Btn "Zoom" après le btn "Dernière page" 60 $('.df-ui-wrapper.df-ui-controls .df-ui-zoomout').insertAfter('.df-ui-wrapper.df-ui-controls .df-ui-zoomin'); // Btn "Dézoom" après le btn "Dernière page" 61 $('.df-ui-wrapper.df-ui-controls .df-ui-zoomout').after('<a class="df-ui-btn df-ui-link ti-link" href="#" title="Copier le lien"><span>Copier le lien</span></a>'); // Ajouter le btn "Copier le lien" après "Impression" ou "Téléchargement" si impression pas dispo 62 if (print != 'non') { 63 $('.df-ui-wrapper.df-ui-controls .df-ui-zoomout').after('<a class="df-ui-btn df-ui-print ti-printer" href="javascript: w=window.open(\'' + url_pdf + '\'); w.print();" title="Imprimer le PDF"><span>Imprimer le PDF</span></a>'); 64 } 65 $('.df-ui-wrapper.df-ui-controls .df-ui-more .more-container .df-ui-download').insertAfter('.df-ui-wrapper.df-ui-controls .df-ui-zoomout'); // Btn "Télécharger le PDF" après le btn "Dézoom" 66 $('.df-ui-wrapper.df-ui-controls .df-ui-thumbnail').insertAfter('.df-ui-wrapper.df-ui-controls .df-ui-more .more-container .df-ui-pagemode'); // Btn "Miniatures" après le btn "Une page" 67 $('.df-ui-wrapper.df-ui-controls .df-ui-outline').insertAfter('.df-ui-wrapper.df-ui-controls .df-ui-more .more-container .df-ui-pagemode'); // Btn "Ancres" après le btn "Une page" 68 69 // Insertion du bouton "fermer" 70 $('#flipbookContainer').append('<div class="df-lightbox-close df-ui-btn ti-close"></div>'); 71 72 // Insertion de l'input hidden pour le lien direct du PDF 73 $('.df-ui-wrapper.df-ui-controls .df-ui-more').after('<textarea name="lien_direct_pdf" id="lien_direct_pdf" style="display:none;">' + url_site + '#' + id_pdf + '</textarea>'); 74 75 if ($(window).width() < 400) { 76 $('.df-ui-wrapper.df-ui-controls .df-ui-link').prependTo('.df-ui-wrapper.df-ui-controls .df-ui-more .more-container'); // Déplacer en responsive le btn "Copier le lien" dans le "More" 77 $('.df-ui-wrapper.df-ui-controls .df-ui-print').prependTo('.df-ui-wrapper.df-ui-controls .df-ui-more .more-container'); // Déplacer en responsive le btn "Imprimer" dans le "More" 78 $('.df-ui-wrapper.df-ui-controls .df-ui-download').prependTo('.df-ui-wrapper.df-ui-controls .df-ui-more .more-container'); // Déplacer en responsive le btn "Télécharger le PDF" dans le "More" 79 } 80 }, 81 }; 82 83 var flipBook = $("#flipbookContainer").flipBook(url_pdf, options); 84 } 85 }; 86 87 printPDF = function (divName) { 88 var printContents = document.getElementById(divName).innerHTML; 89 var originalContents = document.body.innerHTML; 90 91 document.body.innerHTML = printContents; 92 93 window.print(); 94 95 document.body.innerHTML = originalContents; 96 } 97 98 // Copier le lien 99 $('body').on('click', '.df-ui-link', function () { 100 var toCopy = document.getElementById('lien_direct_pdf'); 101 $('#lien_direct_pdf').css('display', ' block'); 102 toCopy.select(); 103 104 if (document.execCommand('copy')) { 105 $('#lien_direct_pdf').css('display', ' none'); 106 alert('Le lien a bien été copié'); 107 } else { 108 $('#lien_direct_pdf').css('display', ' none'); 109 console.info('document.execCommand went wrongâ¦'); 110 } 111 112 return false;
113 }) 114 115 // Déclaration du script 116 var url = window.location.href; 117 var ancreTmp = url.indexOf('#') + 1; 118 var ancre = url.substring(url.indexOf('#') + 1); 119 120 if (ancreTmp != 0 && (ancre != "" && ancre != undefined)) { 121 if (typeof is_base_doc != "undefined" && is_base_doc) { 122 if (is_base_doc && $('a.consulter-ligne.feuilleter[data-id=' + ancre + ']').length > 0) { 123 $('body').addClass('liseuse-open'); 124 liseuse.init($('a.consulter-ligne.feuilleter[data-id=' + ancre + ']')); 125 } 126 } else { 127 if ($('.liseuse-miniature[data-id=' + ancre + ']').length > 0) { 128 $('body').addClass('liseuse-open'); 129 liseuse.init($('.liseuse-miniature[data-id=' + ancre + ']')); 130 } 131 } 132 } 133 134 $('body').on('click', '.liseuse-miniature, a.consulter-ligne.feuilleter', function () { 135 _this = $(this); 136 137 // Ajout d'une class sur le body 138 $('body').addClass('liseuse-open'); 139 140 liseuse.init(_this); 141 }); 142 143 $('body').on('click', '.df-lightbox-close',function () { 144 $('#flipbookContainer').remove(); 145 $('body').css('overflow-y', 'auto'); 146 $('body').removeClass('liseuse-open'); 147 }) 148 }) 149});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.