1jQuery(document).ready(function ($) { 2 //Popup - Default config 3 const popupCenter = function (url, title, width, height) { 4 const popupWidth = width || 640; 5 const popupHeight = height || 320; 6 const windowLeft = window.screenLeft || window.screenX; 7 const windowTop = window.screenTop || window.screenY; 8 const windowWidth = window.innerWidth || document.documentElement.clientWidth; 9 const windowHeight = window.innerHeight || document.documentElement.clientHeight; 10 const popupLeft = windowLeft + windowWidth / 2 - popupWidth / 2; 11 const popupTop = windowTop + windowHeight / 2 - popupHeight / 2; 12 const popup = window.open(url, title, 'scrollbars=yes, width=' + popupWidth + ', height=' + popupHeight + ', top=' + popupTop + ', left=' + popupLeft); 13 popup.focus(); 14 return true; 15 }; 16 17 //Récupération des informations de la page en cours de consultation 18 const url = window.location.href; 19 const title = document.title; 20 21 //Bouton Twitter 22 $('#share-twitter').on('click', function (e) { 23 e.preventDefault(); 24 let shareUrl = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(title) + 25 "&url=" + encodeURIComponent(url); 26 popupCenter(shareUrl, "Partager sur Twitter"); 27 }); 28 29 //Bouton Facebook 30 $('#share-facebook').on('click', function (e) { 31 e.preventDefault(); 32 let shareUrl = "https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(url); 33 popupCenter(shareUrl, "Partager sur Facebook"); 34 }); 35 36 //Bouton LinkedIn 37 $('#share-linkedin').on('click', function (e) { 38 e.preventDefault(); 39 let shareUrl = "https://www.linkedin.com/shareArticle?url=" + encodeURIComponent(url); 40 popupCenter(shareUrl, "Partager sur Linkedin"); 41 }); 42 43 //Bouton Pinterest 44 $('#share-pinterest').on('click', function (e) { 45 e.preventDefault(); 46 let shareUrl = "http://www.pinterest.com/pin/create/button/?url=" + encodeURIComponent(url) + 47 "&description=" + encodeURIComponent(document.title) + 48 "&media=" + encodeURIComponent(url); 49 popupCenter(shareUrl, "Partager sur Pinterest"); 50 }); 51 52 //Bouton Bluesky 53 $('#share-bluesky').on('click', function (e) { 54 e.preventDefault(); 55 let shareUrl = "https://bsky.app/intent/compose?text=" + encodeURIComponent(title + " " + url); 56 popupCenter(shareUrl, "Partager sur Bluesky"); 57 }); 58 59 //Bouton Email 60 61 $('#share-email-send').on('click', function (e) { 62 e.preventDefault(); 63 $('#share-email-alerte .alert').hide(); 64 let titre = title.split('|'); 65 $.post(ajax.url,{ 66 'action': 'sendmailShare', 67 'name': $('#share-email-body #name').val(), 68 'email': $('#share-email-body #email').val(), 69 'link': '<a href="' + url + '" title="' + titre[0] + '">' + titre[0] + '</a>', 70 }).done(function (response) { 71 $('#share-email-body #name').val(''); 72 $('#share-email-body #email').val(''); 73 if (response.success === true) { 74 $('#share-email-alerte .alert-success').show(); 75 } else { 76 $('#share-email-alerte .alert-warning').show(); 77 } 78 }); 79 }); 80});
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.