Aggiorna la versione a 1.1.006 e modifica la regex per il matching dei codici corso, supportando cifre finali variabili

This commit is contained in:
Luigi D'Acunto 2025-12-11 17:51:32 +01:00
parent 4157078105
commit d23bee3a33
3 changed files with 11 additions and 7 deletions

View file

@ -5,7 +5,7 @@
// @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
// @version 1.1.005
// @version 1.1.006
// @description Aggiunge funzionalità alle pagine di GAIA
// @match https://gaia.cri.it/*
// @require https://code.jquery.com/jquery-3.6.0.min.js
@ -413,7 +413,7 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
if ($corsoLink.length === 0) return; // blocco non relativo a richiesta corso
const corsoText = $corsoLink.text().trim();
const match = corsoText.match(/([A-Z]{2,}\/\d{4}\/[A-Z0-9\-]+(?: [A-Z0-9\-]+)?\/\d{4,})/);
const match = corsoText.match(/([A-Z]{2,}\/\d{4}\/[A-Z0-9\-]+(?: [A-Z0-9\-]+)?\/\d+)/);
if (!match) return;
const codiceCorso = match[1];