Added build script

This commit is contained in:
naielv
2025-06-27 20:23:33 +02:00
parent 6c29ee0276
commit 5efd9078f7
91 changed files with 3071 additions and 3126 deletions

86
_assets.json Normal file
View File

@@ -0,0 +1,86 @@
[
"icon512_maskable.png",
"icon512_rounded.png",
"index.html",
"manifest.json",
"static/axe.js",
"static/doublescroll.js",
"static/gun.js",
"static/jquery.js",
"static/load.js",
"static/open.js",
"static/path.js",
"static/radisk.js",
"static/radix.js",
"static/rindexed.js",
"static/sea.js",
"static/showdown.min.js",
"static/simplemde.min.css",
"static/simplemde.min.js",
"static/store.js",
"static/synchronous.js",
"static/TeleSec.jpg",
"static/toastr.min.css",
"static/toastr.min.js",
"static/webrtc.js",
"static/yson.js",
"static/ico/add.png",
"static/ico/azucar-moreno.png",
"static/ico/azucar-blanco.jpg",
"static/ico/stevia.jpg",
"static/ico/stevia-gotas.webp",
"static/ico/sacarina.jpg",
"static/ico/arrow_down_blue.png",
"static/ico/arrow_left_green.png",
"static/ico/arrow_up_red.png",
"static/ico/camera2.png",
"static/ico/cereales.png",
"static/ico/checkbox.png",
"static/ico/checkbox_unchecked.png",
"static/ico/connect_ok.svg",
"static/ico/connect_ko.svg",
"static/ico/coffee_bean.png",
"static/ico/colacao.jpg",
"static/ico/cookies.png",
"static/ico/cow.png",
"static/ico/delete.png",
"static/ico/fire.png",
"static/ico/keyboard_key_g.png",
"static/ico/keyboard_key_p.png",
"static/ico/lollipop.png",
"static/ico/milk.png",
"static/ico/preferences.png",
"static/ico/sizes.png",
"static/ico/statusok.png",
"static/ico/snowflake.png",
"static/ico/tea_bag.png",
"static/ico/thermometer2.png",
"static/ico/user.png",
"static/ico/user_generic.png",
"static/ico/water_tap.png",
"static/ico/wheat.png",
"static/ico/layered1/Azucar-Az. Blanco.png",
"static/ico/layered1/Azucar-Az. Moreno.png",
"static/ico/layered1/Azucar-Edulcorante.png",
"static/ico/layered1/Azucar-Sacarina.png",
"static/ico/layered1/Azucar-Sin.png",
"static/ico/layered1/Azucar-Stevia (Gotas).png",
"static/ico/layered1/Azucar-Stevia (Pastillas).png",
"static/ico/layered1/Background.png",
"static/ico/layered1/Cafeina-Con.png",
"static/ico/layered1/Cafeina-Sin.png",
"static/ico/layered1/Leche-Agua.png",
"static/ico/layered1/Leche-Sin lactosa.png",
"static/ico/layered1/Leche-Vegetal.png",
"static/ico/layered1/Leche-de Vaca.png",
"static/ico/layered1/Selección-CafeSolo.png",
"static/ico/layered1/Selección-CaféLeche.png",
"static/ico/layered1/Selección-ColaCao.png",
"static/ico/layered1/Selección-Infusion.png",
"static/ico/layered1/Selección-Leche.png",
"static/ico/layered1/Tamaño-Grande.png",
"static/ico/layered1/Tamaño-Pequeño.png",
"static/ico/layered1/Temperatura-Caliente.png",
"static/ico/layered1/Temperatura-Frio.png",
"static/ico/layered1/Temperatura-Templado.png"
]

20
build.py Normal file
View File

@@ -0,0 +1,20 @@
import json
ASSETS = json.load(open("_assets.json", "r"))
PREFETCH = ""
VERSIONCO = "2025-06-27_1"
HANDLEPARSE = ["index.html", "sw.js"]
for asset in ASSETS:
PREFETCH += f'<link rel="prefetch" href="{asset}" />\n'
def replace_handles(string):
string = string.replace("%%PREFETCH%%", PREFETCH)
string = string.replace("%%VERSIONCO%%", VERSIONCO)
string = string.replace("%%ASSETSJSON%%", json.dumps(ASSETS, ensure_ascii=False))
return string
for file in HANDLEPARSE:
with open("src/" + file, "r") as f:
out = replace_handles(f.read())
with open("dist/" + file, "w") as f:
f.write(out)

View File

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 210 KiB

View File

Before

Width:  |  Height:  |  Size: 378 KiB

After

Width:  |  Height:  |  Size: 378 KiB

View File

Before

Width:  |  Height:  |  Size: 300 KiB

After

Width:  |  Height:  |  Size: 300 KiB

View File

View File

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 185 KiB

View File

View File

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 210 KiB

View File

Before

Width:  |  Height:  |  Size: 884 B

After

Width:  |  Height:  |  Size: 884 B

View File

Before

Width:  |  Height:  |  Size: 653 B

After

Width:  |  Height:  |  Size: 653 B

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 246 B

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

3015
index.html

File diff suppressed because it is too large Load Diff

2927
src/index.html Normal file

File diff suppressed because it is too large Load Diff

26
src/sw.js Normal file
View File

@@ -0,0 +1,26 @@
var cacheName = 'telesec_%%VERSIONCO%%';
self.addEventListener('install', event => {
event.waitUntil(
caches.open(cacheName)
.then(cache => cache.addAll(%%ASSETSJSON%%))
);
});
self.addEventListener('message', function (event) {
if (event.data.action === 'skipWaiting') {
self.skipWaiting();
}
});
self.addEventListener('fetch', function (event) {
event.respondWith(
caches.match(event.request)
.then(function (response) {
if (response) {
return response;
}
return fetch(event.request);
})
);
});

111
sw.js
View File

@@ -1,111 +0,0 @@
var cacheName = 'telesec_2025-06-19_2';
self.addEventListener('install', event => {
event.waitUntil(
caches.open(cacheName)
.then(cache => cache.addAll([
"icon512_maskable.png",
"icon512_rounded.png",
"index.html",
"manifest.json",
"static/axe.js",
"static/doublescroll.js",
"static/gun.js",
"static/jquery.js",
"static/load.js",
"static/open.js",
"static/path.js",
"static/radisk.js",
"static/radix.js",
"static/rindexed.js",
"static/sea.js",
"static/showdown.min.js",
"static/simplemde.min.css",
"static/simplemde.min.js",
"static/store.js",
"static/synchronous.js",
"static/TeleSec.jpg",
"static/toastr.min.css",
"static/toastr.min.js",
"static/webrtc.js",
"static/yson.js",
"static/ico/add.png",
"static/ico/azucar-moreno.png",
"static/ico/azucar-blanco.jpg",
"static/ico/stevia.jpg",
"static/ico/stevia-gotas.webp",
"static/ico/sacarina.jpg",
"static/ico/arrow_down_blue.png",
"static/ico/arrow_left_green.png",
"static/ico/arrow_up_red.png",
"static/ico/camera2.png",
"static/ico/cereales.png",
"static/ico/checkbox.png",
"static/ico/checkbox_unchecked.png",
"static/ico/connect_ok.svg",
"static/ico/connect_ko.svg",
"static/ico/coffee_bean.png",
"static/ico/colacao.jpg",
"static/ico/cookies.png",
"static/ico/cow.png",
"static/ico/delete.png",
"static/ico/fire.png",
"static/ico/keyboard_key_g.png",
"static/ico/keyboard_key_p.png",
"static/ico/lollipop.png",
"static/ico/milk.png",
"static/ico/preferences.png",
"static/ico/sizes.png",
"static/ico/statusok.png",
"static/ico/snowflake.png",
"static/ico/tea_bag.png",
"static/ico/thermometer2.png",
"static/ico/user.png",
"static/ico/user_generic.png",
"static/ico/water_tap.png",
"static/ico/wheat.png",
"static/ico/layered1/Azucar-Az. Blanco.png",
"static/ico/layered1/Azucar-Az. Moreno.png",
"static/ico/layered1/Azucar-Edulcorante.png",
"static/ico/layered1/Azucar-Sacarina.png",
"static/ico/layered1/Azucar-Sin.png",
"static/ico/layered1/Azucar-Stevia (Gotas).png",
"static/ico/layered1/Azucar-Stevia (Pastillas).png",
"static/ico/layered1/Background.png",
"static/ico/layered1/Cafeina-Con.png",
"static/ico/layered1/Cafeina-Sin.png",
"static/ico/layered1/Leche-Agua.png",
"static/ico/layered1/Leche-Sin lactosa.png",
"static/ico/layered1/Leche-Vegetal.png",
"static/ico/layered1/Leche-de Vaca.png",
"static/ico/layered1/Selección-CafeSolo.png",
"static/ico/layered1/Selección-CaféLeche.png",
"static/ico/layered1/Selección-ColaCao.png",
"static/ico/layered1/Selección-Infusion.png",
"static/ico/layered1/Selección-Leche.png",
"static/ico/layered1/Tamaño-Grande.png",
"static/ico/layered1/Tamaño-Pequeño.png",
"static/ico/layered1/Temperatura-Caliente.png",
"static/ico/layered1/Temperatura-Frio.png",
"static/ico/layered1/Temperatura-Templado.png",
]))
);
});
self.addEventListener('message', function (event) {
if (event.data.action === 'skipWaiting') {
self.skipWaiting();
}
});
self.addEventListener('fetch', function (event) {
event.respondWith(
caches.match(event.request)
.then(function (response) {
if (response) {
return response;
}
return fetch(event.request);
})
);
});