- Implemented a service worker (sw.js) to handle push notifications with dynamic options and notification click events. - Created a calendar layout in test.html with a grid system for displaying events across days and times. - Developed a visually engaging WLAN QR code page (wlan.html) with animated backgrounds, particle effects, and tips for connecting to the network.
48 lines
1.5 KiB
HTML
48 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
|
|
<script src="lib/pocketbase.umd.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<button onclick="addPic()">Uplaod</button>
|
|
<script>
|
|
const PB = new PocketBase();
|
|
|
|
PB.autoCancellation(false)
|
|
|
|
async function addPic() {
|
|
const fileInput = document.createElement('input');
|
|
fileInput.type = 'file';
|
|
fileInput.multiple = true;
|
|
fileInput.accept = 'image/*';
|
|
fileInput.click();
|
|
// listen to file input changes and add the selected files to the form data
|
|
fileInput.addEventListener('change', async function () {
|
|
|
|
for (let file of fileInput.files) {
|
|
const formData = new FormData();
|
|
// set regular text field
|
|
formData.append('alt', "demo_mass" || prompt("Bitte eine Bildbeschreibung eingeben:"));
|
|
formData.append('gewicht', 1);
|
|
|
|
formData.append('allowed', true);
|
|
formData.append('wallpaper', true);
|
|
|
|
formData.append('img', file);
|
|
console.log(file);
|
|
|
|
const createdRecord = await PB.collection('images').create(formData);
|
|
}
|
|
alert("Bild erfolgreich hochgeladen!");
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |