From 4befeed427141537f70f0574302f70e292a04112 Mon Sep 17 00:00:00 2001 From: Curry141 <135717077+Daniongithub@users.noreply.github.com> Date: Sat, 17 May 2025 16:48:59 +0200 Subject: [PATCH] Add files via upload Updated linkgen tool. --- admin/dani/linkgen.html | 24 +++++++++++ admin/dani/linkgen.js | 91 +++++++++++++++++++++++++++++++++++++++++ admin/dani/notrue.html | 22 ++++++++++ admin/dani/style.css | 4 ++ 4 files changed, 141 insertions(+) create mode 100644 admin/dani/linkgen.html create mode 100644 admin/dani/linkgen.js create mode 100644 admin/dani/notrue.html create mode 100644 admin/dani/style.css diff --git a/admin/dani/linkgen.html b/admin/dani/linkgen.html new file mode 100644 index 0000000..576ab13 --- /dev/null +++ b/admin/dani/linkgen.html @@ -0,0 +1,24 @@ + + + + + + Generatore <td> + + + + +

Generatore di <td> per ER-TPL

+ Generatore <img> +

Inserisci matricola:

+ +

Inserisci numero se hai altre foto con stessa matricola (default: 1):

+ +

Inserisci link share:

+ + + + +
+ + \ No newline at end of file diff --git a/admin/dani/linkgen.js b/admin/dani/linkgen.js new file mode 100644 index 0000000..0e943a0 --- /dev/null +++ b/admin/dani/linkgen.js @@ -0,0 +1,91 @@ +function generatd() { + const matricola = document.getElementById("matricola").value.trim(); + var numero = document.getElementById("numero").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; + } + + if (numero === "") { + numero = 1; + } + + 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 generaimg() { + const mezzo = document.getElementById("mezzo").value.trim(); + const link = document.getElementById("link").value.trim(); + + if (!mezzo || !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 puliscitd() { + document.getElementById("matricola").value = ""; + document.getElementById("link").value = ""; + document.getElementById("output").innerHTML = ""; +} + +function pulisciimg() { + document.getElementById("mezzo").value = ""; + document.getElementById("link").value = ""; + document.getElementById("output").innerHTML = ""; +} \ No newline at end of file diff --git a/admin/dani/notrue.html b/admin/dani/notrue.html new file mode 100644 index 0000000..f58ca2d --- /dev/null +++ b/admin/dani/notrue.html @@ -0,0 +1,22 @@ + + + + + + Generatore <td> + + + + +

Generatore di <img> per ER-TPL

+ Generatore <td> +

Inserisci nome mezzo html:

+ +

Inserisci link share:

+ + + + +
+ + \ No newline at end of file diff --git a/admin/dani/style.css b/admin/dani/style.css new file mode 100644 index 0000000..a418fa9 --- /dev/null +++ b/admin/dani/style.css @@ -0,0 +1,4 @@ +body{ + text-align: center; + font-family: Consolas; +} \ No newline at end of file