1export function displayPlaceholder(elem, divContent) { 2 const placeholder = document.getElementById(`${divContent}`); 3 4 if (!placeholder) { 5 console.warn(`Element with ID ${divContent}-placeholder not found.`); 6 return; 7 } 8 9 if (typeof elem.getNetUploads === 'function') { 10 if (elem.getNetUploads() > 0) { 11 placeholder.classList.add('d-none'); 12 } else { 13 placeholder.classList.remove('d-none'); 14 } 15 } else { 16 console.warn('elem.getNetUploads is not a function.'); 17 } 18} 19 20export function refreshCSRF(form_name, stationId, formTokenId) { 21 const url = Routing.generate('security_generate_token', {'station': stationId}); 22 let params = new URLSearchParams({"form_name": form_name}); 23 fetch(url + '?' + params.toString(), { 24 method: 'GET' 25 }) 26 .then(response => { 27 if (!response.ok) { 28 throw new Error("HTTP error " + response.status); 29 } 30 return response.json() 31 }) 32 .then(data => { 33 document.getElementById(formTokenId).value = data.token; 34 }).catch(error => { 35 console.log(error); 36 }) 37} 38
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.