1if(typeof TrackingJsAlreadyLoaded == 'undefined') 2{ 3 let TrackingJsAlreadyLoaded = window.TrackingJs || false; 4 5 function loadDatatable() { 6 if (!TrackingJsAlreadyLoaded) { 7 let script = document.createElement('script'); 8 script.onload = function () { 9 console.log('IsLoaded', window); 10 $('#translateDT').DataTable({ 11 "language": { 12 "lengthMenu": "Afficher _MENU_ résultats par page", 13 "zeroRecords": "Aucun résultat ne correspond à votre recherche", 14 "info": "Page _PAGE_ sur _PAGES_", 15 "infoEmpty": "Aucun enregistrement", 16 "emptyTable": "Aucun enregistrement", 17 "search": "Rechercher:", 18 "paginate": { 19 "first": "Premier", 20 "last": "Dernier", 21 "next": "Suivant", 22 "previous": "Précedent" 23 }, 24 } 25 }); 26 }; 27 script.src = "/CMS/lib/datatable/js/datatable.1.10.19.min.js"; 28 script.type = "text/javascript"; 29 30 document.querySelector(".trackingTranslateBlock").appendChild(script); 31 addCss("/CMS/lib/datatable/css/datatable.custom.css?2"); 32 window.TrackingJs = true; 33 TrackingJsAlreadyLoaded = true; 34 } else { 35 36 $('#translateDT').DataTable({}); 37 } 38 } 39 function addCss(fileName) { 40 var head = document.head; 41 var link = document.createElement("link"); 42 43 link.type = "text/css"; 44 link.rel = "stylesheet"; 45 link.href = fileName; 46 47 head.appendChild(link); 48 } 49 50 function dragElement(elmnt) { 51 var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; 52 if (document.querySelector('.headerMove')) { 53 // if present, the header is where you move the DIV from: 54 document.querySelector('.headerMove').onmousedown = dragMouseDown; 55 } else { 56 // otherwise, move the DIV from anywhere inside the DIV: 57 elmnt.onmousedown = dragMouseDown; 58 } 59 60 function dragMouseDown(e) { 61 e = e || window.event; 62 e.preventDefault(); 63 // get the mouse cursor position at startup: 64 pos3 = e.clientX; 65 pos4 = e.clientY; 66 document.onmouseup = closeDragElement; 67 // call a function whenever the cursor moves: 68 document.onmousemove = elementDrag; 69 } 70 71 function elementDrag(e) { 72 e = e || window.event; 73 e.preventDefault(); 74 // calculate the new cursor position: 75 pos1 = pos3 - e.clientX; 76 pos2 = pos4 - e.clientY; 77 pos3 = e.clientX; 78 pos4 = e.clientY; 79 // set the element's new position: 80 elmnt.style.top = (elmnt.offsetTop - pos2) + "px"; 81 elmnt.style.left = (elmnt.offsetLeft - pos1) + "px"; 82 } 83 84 function closeDragElement() { 85 // stop moving when mouse button is released: 86 document.onmouseup = null; 87 document.onmousemove = null; 88 } 89 } 90 91 let resizeElem = document.querySelector('#resizeTranslateBox'); // element to make resizable 92 let mainBlock = document.querySelector('.trackingTranslateBlock'); // element to make resizable 93 resizeElem.addEventListener('mousedown', initDrag, false); 94 95 var startX, startY, startWidth, startHeight; 96 97 function initDrag(e) { 98 startX = e.clientX; 99 startY = e.clientY; 100 startWidth = parseInt(document.defaultView.getComputedStyle(mainBlock).width, 10); 101 startHeight = parseInt(document.defaultView.getComputedStyle(mainBlock).height, 10); 102 document.documentElement.addEventListener('mousemove', doDrag, false); 103 document.documentElement.addEventListener('mouseup', stopDrag, false); 104 } 105 106 function doDrag(e) { 107 mainBlock.style.width = (startWidth + e.clientX - startX) + 'px'; 108 mainBlock.style.height = (startHeight + e.clientY - startY) + 'px'; 109 } 110 111 function stopDrag(e) { 112 document.documentElement.removeEventListener('mousemove', doDrag, false); 113 document.documentElement.removeEventListener('mouseup', stopDrag, false); 114 } 115 addCss('/css/jquery.dataTables.min.css'); 116 addCss('/css/responsive.dataTables.min.css'); 117 dragElement(document.querySelector(".trackingTranslateBlock"));
118 loadDatatable(); 119 120 $('.closeTranslateBox').click(function() { 121 $('.trackingTranslateBlock').hide(); 122 }) 123}
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.