minori
This commit is contained in:
parent
ab7315340f
commit
0f59eccc5d
1 changed files with 13 additions and 15 deletions
|
|
@ -54,7 +54,7 @@
|
|||
// Cerca il menu laterale (ul#sezione) dove inserire il blocco
|
||||
if ($('#sezione').length > 0) {
|
||||
console.log("GAIA Swissknife: Elementi trovati, aggiungo i pulsanti nel menu laterale...");
|
||||
|
||||
|
||||
ensureSwissknifeHeader();
|
||||
// Aggiungi i pulsanti per settare gli esiti
|
||||
const buttonsHTML = `
|
||||
|
|
@ -108,16 +108,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Funzione per aggiungere il pulsante "Apri tutte le schede profilo"
|
||||
// Funzione per aggiungere il pulsante "Apri tutti i Curriculum"
|
||||
function addOpenAllProfilesButton() {
|
||||
if (!window.location.href.includes('/iscritti/')) return;
|
||||
|
||||
|
||||
const openButton = $(`
|
||||
<button id="open_all_profiles" style="margin: 5px; padding: 8px; width: 97%; background-color:rgba(234, 0, 255, 0.65); color: #FFF; border: none; border-radius: 4px; cursor: pointer;">
|
||||
Apri tutte le schede profilo
|
||||
Apri tutti i Curriculum
|
||||
</button>
|
||||
`);
|
||||
|
||||
|
||||
openButton.on('click', () => {
|
||||
const iframe = document.querySelector('iframe.embed-responsive-item');
|
||||
if (!iframe) {
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
console.log("GAIA Swissknife: iframe non trovato.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Verifica che il contenuto sia accessibile (same-origin)
|
||||
let iframeDoc;
|
||||
try {
|
||||
|
|
@ -135,14 +135,14 @@
|
|||
console.error("GAIA Swissknife: accesso iframe negato.", err);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const $iframeLinks = $(iframeDoc).find("a[href^='/profilo/'][href*='?fpc']");
|
||||
if ($iframeLinks.length === 0) {
|
||||
alert("Nessun profilo trovato all'interno dell'iframe.");
|
||||
console.log("GAIA Swissknife: Nessun link profilo nell'iframe.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const profileLinks = $iframeLinks.map(function() {
|
||||
const href = $(this).attr('href');
|
||||
const match = href.match(/\/profilo\/(\d+)\//);
|
||||
|
|
@ -152,21 +152,20 @@
|
|||
}
|
||||
return null;
|
||||
}).get().filter(Boolean);
|
||||
|
||||
|
||||
|
||||
// Mostra le URL in console sempre
|
||||
console.log("GAIA Swissknife: Profili trovati:");
|
||||
profileLinks.forEach(link => console.log(link));
|
||||
|
||||
|
||||
if (!confirm(`Vuoi aprire ${profileLinks.length} profili in nuove schede?`)) return;
|
||||
|
||||
|
||||
profileLinks.forEach(link => {
|
||||
window.open(link, '_blank');
|
||||
});
|
||||
|
||||
|
||||
console.log(`GAIA Swissknife: Aperte ${profileLinks.length} schede da iframe.`);
|
||||
});
|
||||
|
||||
|
||||
// Inserimento del pulsante nel menu laterale o in floating
|
||||
if ($('#sezione').length > 0) {
|
||||
ensureSwissknifeHeader();
|
||||
|
|
@ -183,7 +182,6 @@
|
|||
}).appendTo('body');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(document).ready(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue