Update linkgen tool
This commit is contained in:
parent
f3ea8aa0d0
commit
040b3d932e
|
@ -12,11 +12,13 @@
|
||||||
<a href="notrue.html">Generatore <img></a>
|
<a href="notrue.html">Generatore <img></a>
|
||||||
<p>Inserisci matricola:</p>
|
<p>Inserisci matricola:</p>
|
||||||
<input type="number" id="matricola" required="required">
|
<input type="number" id="matricola" required="required">
|
||||||
|
<p>Inserisci numero se hai altre foto con stessa matricola (default: 1):</p>
|
||||||
|
<input type="number" id="numero">
|
||||||
<p>Inserisci link share:</p>
|
<p>Inserisci link share:</p>
|
||||||
<input type="url" id="link" required="required">
|
<input type="url" id="link" required="required">
|
||||||
<button onclick="generatd()">Conferma</button>
|
<button onclick="generatd()">Conferma</button>
|
||||||
<button onclick="copiaOutput()">Copia negli appunti</button>
|
<button onclick="copiaOutput()">Copia negli appunti</button>
|
||||||
<button onclick="pulisci()">Pulisci</button>
|
<button onclick="puliscitd()">Pulisci</button>
|
||||||
<pre><code id="output"></code></pre>
|
<pre><code id="output"></code></pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1,5 +1,6 @@
|
||||||
function generatd() {
|
function generatd() {
|
||||||
const matricola = document.getElementById("matricola").value.trim();
|
const matricola = document.getElementById("matricola").value.trim();
|
||||||
|
var numero = document.getElementById("numero").value.trim();
|
||||||
const link = document.getElementById("link").value.trim();
|
const link = document.getElementById("link").value.trim();
|
||||||
|
|
||||||
if (!matricola || !link) {
|
if (!matricola || !link) {
|
||||||
|
@ -17,7 +18,11 @@ function generatd() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const htmlString = `<td><a id="${matricola}-link1" href="${link}"><img id="${matricola}-img1" src="${link}" onerror='this.onerror=null; changeUrlToFallback("${matricola}-link1","${matricola}-img1","${path}");' alt="Server foto non raggiungibile."></a></td>`;
|
if (numero === "") {
|
||||||
|
numero = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const htmlString = `<td><a id="${matricola}-link${numero}" href="${link}"><img id="${matricola}-img${numero}" src="${link}" onerror='this.onerror=null; changeUrlToFallback("${matricola}-link${numero}","${matricola}-img${numero}","${path}");' alt="Server foto non raggiungibile."></a></td>`;
|
||||||
|
|
||||||
const escapedOutput = htmlString
|
const escapedOutput = htmlString
|
||||||
.replace(/&/g, "&")
|
.replace(/&/g, "&")
|
||||||
|
@ -73,8 +78,14 @@ function copiaOutput() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function pulisci() {
|
function puliscitd() {
|
||||||
document.getElementById("matricola").value = "";
|
document.getElementById("matricola").value = "";
|
||||||
document.getElementById("link").value = "";
|
document.getElementById("link").value = "";
|
||||||
document.getElementById("output").innerHTML = "";
|
document.getElementById("output").innerHTML = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pulisciimg() {
|
||||||
|
document.getElementById("mezzo").value = "";
|
||||||
|
document.getElementById("link").value = "";
|
||||||
|
document.getElementById("output").innerHTML = "";
|
||||||
|
}
|
|
@ -9,14 +9,14 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Generatore di <img> per ER-TPL</h1>
|
<h1>Generatore di <img> per ER-TPL</h1>
|
||||||
<a href="linkgen.html">Generatore <td></a>
|
<a href="index.html">Generatore <td></a>
|
||||||
<p>Inserisci nome mezzo html:</p>
|
<p>Inserisci nome mezzo html:</p>
|
||||||
<input type="text" id="mezzo" required="required">
|
<input type="text" id="mezzo" required="required">
|
||||||
<p>Inserisci link share:</p>
|
<p>Inserisci link share:</p>
|
||||||
<input type="url" id="link" required="required">
|
<input type="url" id="link" required="required">
|
||||||
<button onclick="generaimg()">Conferma</button>
|
<button onclick="generaimg()">Conferma</button>
|
||||||
<button onclick="copiaOutput()">Copia negli appunti</button>
|
<button onclick="copiaOutput()">Copia negli appunti</button>
|
||||||
<button onclick="pulisci()">Pulisci</button>
|
<button onclick="pulisciimg()">Pulisci</button>
|
||||||
<pre><code id="output"></code></pre>
|
<pre><code id="output"></code></pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue