1jQuery(document).ready(function($) { 2 // Gestione del testo del file selezionato 3 $('input[type="file"]').change(function(e){ 4 var fileName = e.target.files[0].name; 5 $('.file-input-text').text(fileName); 6 }); 7 8 $('#audd-form').on('submit', function(e) { 9 e.preventDefault(); 10 var formData = new FormData(this); 11 formData.append('action', 'audd_recognize'); 12 13 // Resetta i risultati precedenti 14 $('#audd-result').empty(); 15 16 // Mostra lo stato di caricamento 17 $('#audd-status').text('Caricamento del file...'); 18 $('#audd-loader').show(); 19 20 $.ajax({ 21 url: audd_ajax.ajax_url, 22 type: 'POST', 23 data: formData, 24 contentType: false, 25 processData: false, 26 success: function(response) { 27 $('#audd-loader').hide(); 28 if (response.success) { 29 $('#audd-status').text('Analisi completata!'); 30 var result = response.data.result; 31 if (result) { 32 var copyright = result.deezer && result.deezer.copyright ? 'Protetto da copyright' : 'Informazione non disponibile'; 33 $('#audd-result').html( 34 '<p><strong>Artista:</strong> ' + result.artist + '</p>' + 35 '<p><strong>Titolo:</strong> ' + result.title + '</p>' + 36 '<p><strong>Album:</strong> ' + result.album + '</p>' + 37 '<p><strong>Data di rilascio:</strong> ' + result.release_date + '</p>' + 38 '<p><strong>Etichetta:</strong> ' + (result.label || 'Non disponibile') + '</p>' + 39 '<p><strong>Copyright:</strong> ' + copyright + '</p>' 40 ); 41 42 // Aggiungi link alle piattaforme di streaming se disponibili 43 var streamingLinks = ''; 44 if (result.spotify && result.spotify.external_urls && result.spotify.external_urls.spotify) { 45 streamingLinks += '<a href="' + result.spotify.external_urls.spotify + '" target="_blank">Spotify</a> '; 46 } 47 if (result.apple_music && result.apple_music.url) { 48 streamingLinks += '<a href="' + result.apple_music.url + '" target="_blank">Apple Music</a> '; 49 } 50 if (streamingLinks) { 51 $('#audd-result').append('<p><strong>Ascolta su:</strong> ' + streamingLinks + '</p>'); 52 } 53 } else { 54 $('#audd-result').html('<p>Nessuna corrispondenza trovata</p>'); 55 } 56 } else { 57 $('#audd-status').text('Si è verificato un errore'); 58 $('#audd-result').html('<p>Errore: ' + response.data + '</p>'); 59 } 60 }, 61 error: function() { 62 $('#audd-loader').hide(); 63 $('#audd-status').text('Si è verificato un errore durante la richiesta'); 64 $('#audd-result').html('<p>Si è verificato un errore durante la richiesta</p>'); 65 }, 66 xhr: function() { 67 var xhr = new window.XMLHttpRequest(); 68 xhr.upload.addEventListener("progress", function(evt) { 69 if (evt.lengthComputable) { 70 var percentComplete = evt.loaded / evt.total; 71 percentComplete = parseInt(percentComplete * 100); 72 $('#audd-status').text('Caricamento: ' + percentComplete + '%'); 73 } 74 }, false); 75 return xhr; 76 } 77 }); 78 }); 79});
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.