PageSourceSearch

https://www.beauvoisin.fr/wp-content/themes/noyau/assets/js/ReaderPDF/liseuse.js?ver=1.0

js beauvoisin.fr collected 2026-10-02 21:56:53 UTC 8,223 bytes, 155 lines download raw bytes

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                        $('.df-lightbox-close').on('click', function () {
73                            $('#flipbookContainer').remove();
74                            $('body').css('overflow-y', 'auto');
75                            $('body').removeClass('liseuse-open');
76                        })
77
78                        // Insertion de l'input hidden pour le lien direct du PDF
79                        $('.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>');
80
81                        if ($(window).width() < 400) {
82                            $('.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"
83                            $('.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"
84                            $('.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"
85                        }
86                    },
87                };
88
89                var flipBook = $("#flipbookContainer").flipBook(url_pdf, options);
90            }
91        };
92
93        printPDF = function (divName) {
94            var printContents = document.getElementById(divName).innerHTML;
95            var originalContents = document.body.innerHTML;
96
97            document.body.innerHTML = printContents;
98
99            window.print();
100
101            document.body.innerHTML = originalContents;
102        }
103
104        // Copier le lien
105        $('body').on('click', '.df-ui-link', function () {
106            var toCopy = document.getElementById('lien_direct_pdf');
107            $('#lien_direct_pdf').css('display', ' block');
108            toCopy.select();
109
110            if (document.execCommand('copy')) {
111                $('#lien_direct_pdf').css('display', ' none');
112                alert('Le lien a bien été copié');
113            } else {
114                $('#lien_direct_pdf').css('display', ' none');
115                console.info('document.execCommand went wrong…');
116            }
117
118            return false;
119        })
120
121        // Déclaration du script
122        var url = window.location.href;
123        var ancreTmp = url.indexOf('#') + 1;
124        var ancre = url.substring(url.indexOf('#') + 1);
125        if (ancreTmp != 0 && (ancre != "" && ancre != undefined)) {
126            if (typeof is_base_doc != "undefined" && is_base_doc) {
127                if (is_base_doc && $('a.link-document--feuilleter[data-id=' + ancre + ']').length > 0) {
128                    $('body').addClass('liseuse-open');
129                    liseuse.init($('a.link-document--feuilleter[data-id=' + ancre + ']'));
130                }
131            } else {
132                if ($('a.link-document--feuilleter[data-id=' + ancre + ']').length > 0) {
133                    $('body').addClass('liseuse-open');
134                    liseuse.init($('a.link-document--feuilleter[data-id=' + ancre + ']'));
135                }
136            }
137        }
138
139        $('.front-page, .listing-cards, .bloc-document').on('click', 'a.link-document--feuilleter', function () {
140            _this = $(this);
141
142            // Ajout d'une class sur le body
143            $('body').addClass('liseuse-open');
144
145            liseuse.init(_this);
146        });
147
148
149        $('.df-lightbox-close').on('click', function () {
150            $('#flipbookContainer').remove();
151            $('body').css('overflow-y', 'auto');
152            $('body').removeClass('liseuse-open');
153        })
154    })
155});

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.