From 044ba5d8892ee3c51e27abf01d63fc4e9dafa518 Mon Sep 17 00:00:00 2001 From: Curry141 <135717077+Daniongithub@users.noreply.github.com> Date: Thu, 8 May 2025 17:55:04 +0200 Subject: [PATCH] New stuff --- admin/dani/servizi.html | 17 +++++++++++ admin/dani/tdgenerator/index.html | 21 ++++++++++++++ admin/dani/tdgenerator/linkgen.js | 47 +++++++++++++++++++++++++++++++ admin/dani/tdgenerator/style.css | 4 +++ 4 files changed, 89 insertions(+) create mode 100644 admin/dani/servizi.html create mode 100644 admin/dani/tdgenerator/index.html create mode 100644 admin/dani/tdgenerator/linkgen.js create mode 100644 admin/dani/tdgenerator/style.css diff --git a/admin/dani/servizi.html b/admin/dani/servizi.html new file mode 100644 index 0000000..db844a9 --- /dev/null +++ b/admin/dani/servizi.html @@ -0,0 +1,17 @@ + + + + + + Admin Space + + + + + + +

Pagina dei servizi del Dani

+

Complimenti! Se hai trovato questa pagina sei davvero un grande smanettone.
Tranquillo, qui non troverai segreti statali e mai ci saranno.

+ Generatore <td> + + \ No newline at end of file diff --git a/admin/dani/tdgenerator/index.html b/admin/dani/tdgenerator/index.html new file mode 100644 index 0000000..85a65a6 --- /dev/null +++ b/admin/dani/tdgenerator/index.html @@ -0,0 +1,21 @@ + + + + + + Generatore <td> + + + + +

Generatore di <td> per ER-TPL

+

Inserisci matricola:

+ +

Inserisci link share:

+ + + + +
+ + \ No newline at end of file diff --git a/admin/dani/tdgenerator/linkgen.js b/admin/dani/tdgenerator/linkgen.js new file mode 100644 index 0000000..011b58c --- /dev/null +++ b/admin/dani/tdgenerator/linkgen.js @@ -0,0 +1,47 @@ +function genera() { + const matricola = document.getElementById("matricola").value.trim(); + const link = document.getElementById("link").value.trim(); + + if (!matricola || !link) { + alert("Compila entrambi i campi."); + return; + } + + try { + const urlObj = new URL(link); + const params = new URLSearchParams(urlObj.search); + const path = params.get("file"); + + if (!path) { + alert("Parametro ?file= mancante nell'URL."); + return; + } + + const htmlString = `Server foto non raggiungibile.`; + + const escapedOutput = htmlString + .replace(/&/g, "&") + .replace(//g, ">"); + + document.getElementById("output").innerHTML = escapedOutput; + + } catch (error) { + alert("URL non valido."); + } +} + +function copiaOutput() { + const code = document.getElementById("output").innerText; + navigator.clipboard.writeText(code).then(() => { + //alert("Codice copiato negli appunti!"); + }).catch(() => { + alert("Errore durante la copia."); + }); +} + +function pulisci() { + document.getElementById("matricola").value = ""; + document.getElementById("link").value = ""; + document.getElementById("output").innerHTML = ""; +} diff --git a/admin/dani/tdgenerator/style.css b/admin/dani/tdgenerator/style.css new file mode 100644 index 0000000..a418fa9 --- /dev/null +++ b/admin/dani/tdgenerator/style.css @@ -0,0 +1,4 @@ +body{ + text-align: center; + font-family: Consolas; +} \ No newline at end of file