mirror of
https://github.com/Daniongithub/ER-TPL.git
synced 2025-10-02 21:30:48 +00:00
Generator atcm
This commit is contained in:
42
admin/setalinkgen/linkgen.js
Normal file
42
admin/setalinkgen/linkgen.js
Normal file
@@ -0,0 +1,42 @@
|
||||
function generatd() {
|
||||
const matricola = document.getElementById("matricola").value.trim();
|
||||
var link = document.getElementById("link").value.trim();
|
||||
|
||||
if (!matricola || !link) {
|
||||
alert("Compila entrambi i campi.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
link = "https://drive.serverissimo.freeddns.org/apps/files_sharing/publicpreview/ffdqobqRg2ezKXt?file=/Leo/SETA/"+link+"/"+matricola;
|
||||
|
||||
const linkFinaleNoTrue = link+".jpg&x=1920&y=1080"
|
||||
const linkFinaleTrue = link+".jpg&x=1920&y=1080&a=true"
|
||||
const htmlString = "<td><a href=\""+linkFinaleTrue+"\"><img src=\""+linkFinaleNoTrue+"\"alt=\"Server foto non raggiungibile.\"></a></td>";
|
||||
|
||||
const escapedOutput = htmlString
|
||||
.replace(/&/g, "&")
|
||||
.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 pulisciimg() {
|
||||
document.getElementById("mezzo").value = "";
|
||||
document.getElementById("link").value = "";
|
||||
document.getElementById("output").innerHTML = "";
|
||||
}
|
Reference in New Issue
Block a user