PageSourceSearch

https://www.ilpoliedrico.com/wp-content/plugins/co2-comparison-widget/assets/js/script.js?ver=1790422853

js ilpoliedrico.com collected 2026-09-26 11:41:08 UTC 1,775 bytes, 43 lines download raw bytes

1jQuery(document).ready(function($) {
2    $(document).on('click', '.export-co2-image', function(e) {
3        e.preventDefault();
4        
5        let button = $(this);
6        let targetId = button.data('target');
7        let targetElement = document.getElementById(targetId);
8
9        button.text('Generando...').prop('disabled', true);
10
11        // Configurazione per html2canvas
12        html2canvas(targetElement, {
13            backgroundColor: '#ffffff',
14            scale: 3, // Alta risoluzione
15            logging: false,
16            useCORS: true, // Permette di caricare immagini cross-origin
17            allowTaint: true,
18            onclone: function(clonedDoc) {
19                // Rimuovi il pulsante di export dalla clone
20                let cloneButton = clonedDoc.querySelector('.export-co2-image');
21                if (cloneButton) {
22                    cloneButton.style.display = 'none';
23                }
24            }
25        }).then(function(canvas) {
26            // Crea un link per il download
27            let link = document.createElement('a');
28            let date = new Date().toISOString().split('T')[0];
29            link.download = 'co2-levels-' + date + '.png';
30            link.href = canvas.toDataURL('image/png', 1.0);
31            document.body.appendChild(link);
32            link.click();
33            document.body.removeChild(link);
34
35            // Ripristina il bottone
36            button.text('📸 Esporta come Immagine').prop('disabled', false);
37        }).catch(function(error) {
38            console.error('Errore export:', error);
39            button.text('❌ Errore').prop('disabled', false);
40            alert('Errore durante la generazione dell\'immagine. Riprova.');
41        });
42    });
43});

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.