Aggiungi il changelog per la versione 1.1.0 e aggiorna la versione nel file GAIA-Swissknife.user.js
This commit is contained in:
parent
54466f6e38
commit
407b23fbd2
2 changed files with 170 additions and 97 deletions
15
CHANGELOG.md
Normal file
15
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
# 🧰 GAIA Swissknife – Changelog
|
||||||
|
|
||||||
|
## v1.1.0 – 2025-04-09
|
||||||
|
- Refactoring in funzioni modulari
|
||||||
|
- Ricostruzione celle curriculum estratta in funzione esterna
|
||||||
|
- Sidebar autorizzazioni: aggregazione e deduplicazione
|
||||||
|
- Modale "richieste iscrizione": input → select automatica + riepilogo corsi
|
||||||
|
- Correzione troncamento nomi file PDF nella prima riga
|
||||||
|
- Link changelog previsto, ma disattivato per coerenza multi-pagina
|
||||||
|
|
||||||
|
## v1.0.0 – 2025-04-04
|
||||||
|
- Versione stabile iniziale
|
||||||
|
- Trasformazione tabella curriculum in DataTable
|
||||||
|
- Evidenziazione "Respinto"
|
||||||
|
- Funzioni operative: ammissioni, apertura schede, messaggi...
|
||||||
|
|
@ -3,8 +3,9 @@
|
||||||
// @namespace https://gitlab.luigidacunto.com/consultant/gaia-swissknife
|
// @namespace https://gitlab.luigidacunto.com/consultant/gaia-swissknife
|
||||||
// @updateURL https://luigidacunto.com/scripts/gaia-swissknife/tampermonkey-script/GAIA-Swissknife.user.js
|
// @updateURL https://luigidacunto.com/scripts/gaia-swissknife/tampermonkey-script/GAIA-Swissknife.user.js
|
||||||
// @downloadURL https://luigidacunto.com/scripts/gaia-swissknife/tampermonkey-script/GAIA-Swissknife.user.js
|
// @downloadURL https://luigidacunto.com/scripts/gaia-swissknife/tampermonkey-script/GAIA-Swissknife.user.js
|
||||||
|
// @changelogURL https://luigidacunto.com/scripts/gaia-swissknife/tampermonkey-script/CHANGELOG.md
|
||||||
// @author Luigi D'Acunto
|
// @author Luigi D'Acunto
|
||||||
// @version 1.0.0
|
// @version 1.1.0
|
||||||
// @description Aggiunge funzionalità alle pagine di GAIA
|
// @description Aggiunge funzionalità alle pagine di GAIA
|
||||||
// @match https://gaia.cri.it/*
|
// @match https://gaia.cri.it/*
|
||||||
// @require https://code.jquery.com/jquery-3.6.0.min.js
|
// @require https://code.jquery.com/jquery-3.6.0.min.js
|
||||||
|
|
@ -30,6 +31,7 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
|
|
||||||
// Funzione per aggiungere il blocco di intestazione
|
// Funzione per aggiungere il blocco di intestazione
|
||||||
function ensureSwissknifeHeader() {
|
function ensureSwissknifeHeader() {
|
||||||
|
console.log("GAIA Swissknife: Aggiungo intestazione GAIA Swissknife...");
|
||||||
if ($('#sezione').length > 0 && $('#gaia-swissknife-header').length === 0) {
|
if ($('#sezione').length > 0 && $('#gaia-swissknife-header').length === 0) {
|
||||||
const headerHTML = `
|
const headerHTML = `
|
||||||
<hr>
|
<hr>
|
||||||
|
|
@ -41,21 +43,55 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Funzione per applicare le correzioni di stile alle celle del curriculum
|
// Funzione per correggere i filtri della sidebar delle autorizzazioni
|
||||||
function applyStyleFixes() {
|
function fixAutorizzazioniSidebarFilters() {
|
||||||
const url = window.location.href;
|
const $ul = $("#sezione-2");
|
||||||
|
if (!$ul.length) return;
|
||||||
|
|
||||||
if (url.match(/\/profilo\/\d+\/curriculum\//)) {
|
const voci = {};
|
||||||
console.log("GAIA Swissknife: Ricostruzione celle curriculum (versione pulita)...");
|
|
||||||
|
|
||||||
|
// Scansiona tutti i link
|
||||||
|
$ul.find("li[role='presentation'] a").each(function () {
|
||||||
|
const $a = $(this);
|
||||||
|
const text = $a.clone().children().remove().end().text().trim();
|
||||||
|
const badge = parseInt($a.find(".badge").text().trim(), 10);
|
||||||
|
const href = $a.attr("href");
|
||||||
|
|
||||||
|
if (!text || isNaN(badge)) return;
|
||||||
|
|
||||||
|
if (!voci[text]) {
|
||||||
|
voci[text] = {
|
||||||
|
count: 0,
|
||||||
|
href: href
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
voci[text].count += badge;
|
||||||
|
});
|
||||||
|
|
||||||
|
$ul.find("li[role='presentation']").remove();
|
||||||
|
|
||||||
|
Object.entries(voci).forEach(([tipo, info]) => {
|
||||||
|
const $li = $(`
|
||||||
|
<li role="presentation">
|
||||||
|
<a href="${info.href}">
|
||||||
|
${tipo}
|
||||||
|
<span class="badge pull-right">${info.count}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
`);
|
||||||
|
$ul.append($li);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Funzione per ricostruire le celle con i dettagli delle qualifiche nel curriculum in modo pulito
|
||||||
|
function rebuildCurriculumDetailCells() {
|
||||||
$("td.piu-piccolo").each(function (cellIndex) {
|
$("td.piu-piccolo").each(function (cellIndex) {
|
||||||
const $td = $(this);
|
const $td = $(this);
|
||||||
const rawNodes = Array.from(this.childNodes);
|
const rawNodes = Array.from(this.childNodes);
|
||||||
|
|
||||||
// 🔍 Filtro nodi significativi: elimina tutti i nodi vuoti o whitespace
|
|
||||||
const nodes = rawNodes.filter(n => {
|
const nodes = rawNodes.filter(n => {
|
||||||
if (n.nodeType === 3) return n.nodeValue.trim() !== "";
|
if (n.nodeType === 3) return n.nodeValue.trim() !== "";
|
||||||
return true; // elementi HTML validi
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`\n📦 [Cella ${cellIndex + 1}] Analizzo ${nodes.length} nodi validi...`);
|
console.log(`\n📦 [Cella ${cellIndex + 1}] Analizzo ${nodes.length} nodi validi...`);
|
||||||
|
|
@ -64,7 +100,6 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
for (let i = 0; i < nodes.length; i++) {
|
for (let i = 0; i < nodes.length; i++) {
|
||||||
const node = nodes[i];
|
const node = nodes[i];
|
||||||
|
|
||||||
// Se è un'icona <i>, cerca il contenuto associato
|
|
||||||
if (node.nodeType === 1 && node.tagName === "I") {
|
if (node.nodeType === 1 && node.tagName === "I") {
|
||||||
const $icon = $(node).clone();
|
const $icon = $(node).clone();
|
||||||
const $row = $('<div class="gaia-line"></div>').css({
|
const $row = $('<div class="gaia-line"></div>').css({
|
||||||
|
|
@ -82,7 +117,6 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
|
|
||||||
$row.append($icon);
|
$row.append($icon);
|
||||||
|
|
||||||
// 🔄 Trova il prossimo nodo utile: testo o <a>
|
|
||||||
let content = null;
|
let content = null;
|
||||||
let nextIndex = i + 1;
|
let nextIndex = i + 1;
|
||||||
|
|
||||||
|
|
@ -109,7 +143,6 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
const $el = $(nextNode);
|
const $el = $(nextNode);
|
||||||
|
|
||||||
if (nextNode.tagName === "A") {
|
if (nextNode.tagName === "A") {
|
||||||
// Gestione <a> (link)
|
|
||||||
let text = $el.text().trim();
|
let text = $el.text().trim();
|
||||||
|
|
||||||
if (!text) {
|
if (!text) {
|
||||||
|
|
@ -133,7 +166,6 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ Gestione <span> (es. .monospace o altro)
|
|
||||||
else if (nextNode.tagName === "SPAN") {
|
else if (nextNode.tagName === "SPAN") {
|
||||||
const text = $el.text().trim();
|
const text = $el.text().trim();
|
||||||
if (text) {
|
if (text) {
|
||||||
|
|
@ -155,7 +187,7 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
nextIndex++;
|
nextIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = nextIndex - 1; // Salta i nodi già processati
|
i = nextIndex - 1;
|
||||||
|
|
||||||
if (content) {
|
if (content) {
|
||||||
$row.append(content);
|
$row.append(content);
|
||||||
|
|
@ -170,6 +202,24 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
$td.empty().append(newContent);
|
$td.empty().append(newContent);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Funzione per applicare le correzioni di stile alle celle del curriculum
|
||||||
|
function applyStyleFixes() {
|
||||||
|
const url = window.location.href;
|
||||||
|
|
||||||
|
// Correzione per le celle del curriculum
|
||||||
|
if (url.match(/\/profilo\/\d+\/curriculum\//)) {
|
||||||
|
console.log("GAIA Swissknife: Ricostruzione celle curriculum in modo ordinato...");
|
||||||
|
rebuildCurriculumDetailCells();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Correzione per menu laterale autorizzazioni
|
||||||
|
if (url.includes("/autorizzazioni")) {
|
||||||
|
console.log("GAIA Swissknife: Correzione menu laterale autorizzazioni...");
|
||||||
|
fixAutorizzazioniSidebarFilters();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Funzione per aggiungere i pulsanti per settare gli esiti degli esami
|
// Funzione per aggiungere i pulsanti per settare gli esiti degli esami
|
||||||
|
|
@ -393,6 +443,14 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
<button id="gaia-auth-toggle" title="Riduci/Espandi" style="background: transparent; border: none; color: white; font-weight: bold; font-size: 16px; cursor: pointer; padding: 0; margin-left: 10px;">−</button>
|
<button id="gaia-auth-toggle" title="Riduci/Espandi" style="background: transparent; border: none; color: white; font-weight: bold; font-size: 16px; cursor: pointer; padding: 0; margin-left: 10px;">−</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="gaia-auth-body" style="padding: 15px;">
|
<div id="gaia-auth-body" style="padding: 15px;">
|
||||||
|
<div id="gaia-auth-summary" style="margin-bottom: 10px; font-size: 13px;">
|
||||||
|
<strong>📋 Richieste trovate:</strong><br>
|
||||||
|
${corsiUnici.map(c => {
|
||||||
|
const count = richieste.filter(r => r.codice === c).length;
|
||||||
|
const plural = count === 1 ? "richiesta" : "richieste";
|
||||||
|
return `• ${c} – ${count} ${plural}`;
|
||||||
|
}).join("<br>")}
|
||||||
|
</div>
|
||||||
<label for="gaia-auth-select">Seleziona un corso:</label>
|
<label for="gaia-auth-select">Seleziona un corso:</label>
|
||||||
<select id="gaia-auth-select" style="width: 100%; padding: 5px; margin-bottom: 10px;">
|
<select id="gaia-auth-select" style="width: 100%; padding: 5px; margin-bottom: 10px;">
|
||||||
<option value="">-- Seleziona --</option>
|
<option value="">-- Seleziona --</option>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue