Compare commits
No commits in common. "ed69942c192aaeafc675f7fc15ea16ae4729570a" and "54346041ab3dcc572b97c146fad49b98f3064131" have entirely different histories.
ed69942c19
...
54346041ab
2 changed files with 11 additions and 52 deletions
23
.gitignore
vendored
23
.gitignore
vendored
|
|
@ -1,21 +1,2 @@
|
||||||
# Exclude files and directories from version control
|
_ignored
|
||||||
*.log
|
/.*/
|
||||||
/.*/
|
|
||||||
/.*/
|
|
||||||
/*auth*
|
|
||||||
/node_modules
|
|
||||||
/public/build
|
|
||||||
/public/hot
|
|
||||||
/public/storage
|
|
||||||
/storage/*.key
|
|
||||||
/storage/pail
|
|
||||||
/vendor
|
|
||||||
Thumbs.db
|
|
||||||
/*.md
|
|
||||||
/.env*
|
|
||||||
|
|
||||||
# Exceptions
|
|
||||||
!README.md
|
|
||||||
!CHANGELOG.md
|
|
||||||
!.gitattributes
|
|
||||||
!.env.example
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
// @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
|
// @changelogURL https://luigidacunto.com/scripts/gaia-swissknife/tampermonkey-script/CHANGELOG.md
|
||||||
// @author Luigi D'Acunto
|
// @author Luigi D'Acunto
|
||||||
// @version 1.1.011
|
// @version 1.1.010
|
||||||
// @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
|
||||||
|
|
@ -208,7 +208,6 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Funzione per applicare le correzioni di stile alle celle del curriculum
|
// Funzione per applicare le correzioni di stile alle celle del curriculum
|
||||||
function applyStyleFixes() {
|
function applyStyleFixes() {
|
||||||
const url = window.location.href;
|
const url = window.location.href;
|
||||||
|
|
@ -814,17 +813,6 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Converte una data in italiano (es. "Domenica 27 Settembre 2026 09:00") in formato ISO 8601 ("2026-09-27T09:00:00")
|
|
||||||
function parseDataItaliana(testo) {
|
|
||||||
const mesi = { gennaio: 1, febbraio: 2, marzo: 3, aprile: 4, maggio: 5, giugno: 6, luglio: 7, agosto: 8, settembre: 9, ottobre: 10, novembre: 11, dicembre: 12 };
|
|
||||||
const m = (testo || '').match(/(\d{1,2})\s+([a-zA-Zàèìòù]+)\s+(\d{4})\s+(\d{2}):(\d{2})/i);
|
|
||||||
if (!m) return null;
|
|
||||||
const mese = mesi[m[2].toLowerCase()];
|
|
||||||
if (!mese) return null;
|
|
||||||
const giorno = m[1].padStart(2, '0');
|
|
||||||
return `${m[3]}-${String(mese).padStart(2, '0')}-${giorno}T${m[4]}:${m[5]}:00`;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Funzione per copiare i dati del corso per LURCH in clipboard come JSON
|
// Funzione per copiare i dati del corso per LURCH in clipboard come JSON
|
||||||
function addCopyForLurchButton() {
|
function addCopyForLurchButton() {
|
||||||
if (!window.location.href.match(/\/aspirante\/corso-base\/\d+\//)) return;
|
if (!window.location.href.match(/\/aspirante\/corso-base\/\d+\//)) return;
|
||||||
|
|
@ -832,30 +820,21 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
|
|
||||||
console.log("GAIA Swissknife: Aggiungo pulsante Copia per LURCH...");
|
console.log("GAIA Swissknife: Aggiungo pulsante Copia per LURCH...");
|
||||||
|
|
||||||
function getPanel(labelSubstr) {
|
|
||||||
return [...document.querySelectorAll('.panel.panel-info')].find(el => el.querySelector('.panel-title')?.innerText.includes(labelSubstr));
|
|
||||||
}
|
|
||||||
function getPanelText(labelSubstr) {
|
|
||||||
return getPanel(labelSubstr)?.querySelector('.panel-body')?.innerText?.trim() || '';
|
|
||||||
}
|
|
||||||
|
|
||||||
function extractLurchData() {
|
function extractLurchData() {
|
||||||
const corso = document.querySelector('h1, h2')?.innerText?.trim() || '';
|
const corso = document.querySelector('h1, h2')?.innerText?.trim() || '';
|
||||||
|
|
||||||
const titleMatch = document.title.match(/([A-Z]{2,}\/\d{4}\/[A-Z0-9\-]+(?: [A-Z0-9\-]+)?\/\d+)/);
|
const titleMatch = document.title.match(/([A-Z]{2,}\/\d{4}\/[A-Z0-9\-]+(?: [A-Z0-9\-]+)?\/\d+)/);
|
||||||
const protocollo = titleMatch ? titleMatch[1] : '';
|
const protocollo = titleMatch ? titleMatch[1] : '';
|
||||||
|
|
||||||
const direttore = getPanel('Direttore')?.querySelector('.panel-body a')?.innerText?.trim() || '';
|
const direttorePanel = [...document.querySelectorAll('.panel.panel-info')].find(el => el.querySelector('.panel-title')?.innerText.includes('Direttore'));
|
||||||
|
const direttore = direttorePanel?.querySelector('.panel-body a')?.innerText?.trim() || '';
|
||||||
|
|
||||||
const quotaText = getPanelText('Quota') || '0';
|
const quotaPanel = [...document.querySelectorAll('.panel.panel-info')].find(el => el.querySelector('.panel-title')?.innerText.includes('Quota'));
|
||||||
|
const quotaText = quotaPanel?.querySelector('.panel-body')?.innerText?.trim() || '0';
|
||||||
const quotaValore = parseFloat(quotaText.replace(/[^\d,]/g, '').replace(',', '.')) || 0;
|
const quotaValore = parseFloat(quotaText.replace(/[^\d,]/g, '').replace(',', '.')) || 0;
|
||||||
const quota = quotaValore !== 0;
|
const quota = quotaValore !== 0;
|
||||||
|
|
||||||
const dataInizio = parseDataItaliana(getPanelText('Data di inizio'));
|
return { direttore, quota, quotaValore, corso, protocollo, linkGaia: window.location.href };
|
||||||
const dataEsame = parseDataItaliana(getPanelText('Data di esame'));
|
|
||||||
const scadenzaDomande = parseDataItaliana(getPanelText('Termine di scadenza per le domande di ammissione'));
|
|
||||||
|
|
||||||
return { direttore, quota, quotaValore, corso, protocollo, linkGaia: window.location.href, dataInizio, dataEsame, scadenzaDomande };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const $btn = $('<button type="button" style="margin: 5px; padding: 8px; width: 97%; background-color: #1a6b8a; color: #FFF; border: none; border-radius: 4px; cursor: pointer;">Copia per LURCH (JSON)</button>');
|
const $btn = $('<button type="button" style="margin: 5px; padding: 8px; width: 97%; background-color: #1a6b8a; color: #FFF; border: none; border-radius: 4px; cursor: pointer;">Copia per LURCH (JSON)</button>');
|
||||||
|
|
@ -893,11 +872,10 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
|
||||||
})(jQuery.noConflict(true));
|
})(jQuery.noConflict(true));
|
||||||
|
|
||||||
// ==CHANGELOG==
|
// ==CHANGELOG==
|
||||||
// v1.1.011 - Nuovi campi nel JSON "Copia per LURCH":
|
// v1.1.010 - Nuove funzioni:
|
||||||
// - Aggiunti dataInizio, dataEsame e scadenzaDomande (termine per le domande di ammissione), in formato ISO 8601
|
|
||||||
// v1.1.010 - Nuova funzione:
|
|
||||||
// - Aggiunto pulsante "Copia per LURCH (JSON)" nella sidebar delle pagine corso (/aspirante/corso-base/)
|
// - Aggiunto pulsante "Copia per LURCH (JSON)" nella sidebar delle pagine corso (/aspirante/corso-base/)
|
||||||
// - Estrae direttore, quota, corso, protocollo e link GAIA, e copia il JSON in clipboard
|
// - Estrae: Direttore, Quota (bool), QuotaValore (numerico), Corso (nome), Protocollo, Link GAIA
|
||||||
|
// - Copia il JSON in clipboard con feedback visivo
|
||||||
// v1.1.009 - Nuove funzioni:
|
// v1.1.009 - Nuove funzioni:
|
||||||
// - Aggiunto pulsante "Copia catalogo corsi (JSON)" nella sidebar di /courses/catalog/
|
// - Aggiunto pulsante "Copia catalogo corsi (JSON)" nella sidebar di /courses/catalog/
|
||||||
// - Estrae nome, codice, livello, tipo, obiettivo per ogni corso e copia il JSON in clipboard
|
// - Estrae nome, codice, livello, tipo, obiettivo per ogni corso e copia il JSON in clipboard
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue