aa
This commit is contained in:
@@ -1,10 +1,37 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Link Page</title>
|
<title>Link Page</title>
|
||||||
|
<style>
|
||||||
|
#loading {
|
||||||
|
display: none;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
border: 5px solid #f3f3f3;
|
||||||
|
border-top: 5px solid #3498db;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Links</h1>
|
<h1>Links</h1>
|
||||||
<form id="articleForm">
|
<form id="articleForm">
|
||||||
@@ -12,14 +39,16 @@
|
|||||||
<input type="text" id="article_id" name="id" />
|
<input type="text" id="article_id" name="id" />
|
||||||
<br>
|
<br>
|
||||||
<button type="button" data-action="search">Cerca Articolo</button>
|
<button type="button" data-action="search">Cerca Articolo</button>
|
||||||
<button type="button" data-action="checkPrevendita">E' in PreVendita?</button><br>
|
<button type="button" data-action="checkPreOrder">E' in PreVendita?</button><br>
|
||||||
<button type="button" data-action="inprevendita">Libri in Prevendita</button>
|
<button type="button" data-action="inprevendita">Libri in Prevendita</button>
|
||||||
</form>
|
</form>
|
||||||
<div id="result"></div>
|
<div id="result"></div>
|
||||||
|
<div id="loading"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const form = document.getElementById('articleForm');
|
const form = document.getElementById('articleForm');
|
||||||
const result = document.getElementById('result');
|
const result = document.getElementById('result');
|
||||||
|
const loading = document.getElementById('loading');
|
||||||
|
|
||||||
const buttons = form.querySelectorAll('button');
|
const buttons = form.querySelectorAll('button');
|
||||||
buttons.forEach(button => button.addEventListener('click', handleButtonClick));
|
buttons.forEach(button => button.addEventListener('click', handleButtonClick));
|
||||||
@@ -27,15 +56,19 @@
|
|||||||
function handleButtonClick(event) {
|
function handleButtonClick(event) {
|
||||||
const action = event.target.dataset.action;
|
const action = event.target.dataset.action;
|
||||||
const id = form.querySelector('input[name="id"]').value;
|
const id = form.querySelector('input[name="id"]').value;
|
||||||
|
|
||||||
|
loading.style.display = 'block'; // Mostra la clessidra
|
||||||
|
|
||||||
let baseUrl = window.location.href;
|
let baseUrl = window.location.href;
|
||||||
baseUrl = baseUrl.slice(0, baseUrl.lastIndexOf('/'));
|
baseUrl = baseUrl.slice(0, baseUrl.lastIndexOf('/'));
|
||||||
|
|
||||||
fetch(`${baseUrl}/handle-article-action-pao/${id}/${action}`)
|
fetch(`${baseUrl}/handle-article-action-pao/${id}/${action}`)
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(data => result.innerHTML = data);
|
.then(data => {
|
||||||
|
result.innerHTML = data;
|
||||||
|
loading.style.display = 'none'; // Nasconde la clessidra una volta completato
|
||||||
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user