From a07077ba1a20bfd0cf15764b3e317234a57c1176 Mon Sep 17 00:00:00 2001 From: Curry141 <135717077+Daniongithub@users.noreply.github.com> Date: Mon, 12 May 2025 20:48:03 +0200 Subject: [PATCH] Add files via upload Linkgen v2.0 --- admin/dani/tdgenerator/index.html | 3 ++- admin/dani/tdgenerator/linkgen.js | 35 +++++++++++++++++++++++++++++- admin/dani/tdgenerator/notrue.html | 22 +++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 admin/dani/tdgenerator/notrue.html diff --git a/admin/dani/tdgenerator/index.html b/admin/dani/tdgenerator/index.html index 85a65a6..407287b 100644 --- a/admin/dani/tdgenerator/index.html +++ b/admin/dani/tdgenerator/index.html @@ -9,11 +9,12 @@

Generatore di <td> per ER-TPL

+ Generatore <img>

Inserisci matricola:

Inserisci link share:

- +
diff --git a/admin/dani/tdgenerator/linkgen.js b/admin/dani/tdgenerator/linkgen.js index 011b58c..47c73a9 100644 --- a/admin/dani/tdgenerator/linkgen.js +++ b/admin/dani/tdgenerator/linkgen.js @@ -1,4 +1,4 @@ -function genera() { +function generatd() { const matricola = document.getElementById("matricola").value.trim(); const link = document.getElementById("link").value.trim(); @@ -31,6 +31,39 @@ function genera() { } } +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(() => { diff --git a/admin/dani/tdgenerator/notrue.html b/admin/dani/tdgenerator/notrue.html new file mode 100644 index 0000000..2667a64 --- /dev/null +++ b/admin/dani/tdgenerator/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