renommer le bouton automatiquement

This commit is contained in:
2026-03-27 08:00:29 +01:00
parent 95d5b1daa9
commit 9b7fa41819
3 changed files with 9 additions and 2 deletions

View File

@@ -16,7 +16,7 @@
<header> <header>
<div style="display: flex; gap: 10px; align-items: center;"> <div style="display: flex; gap: 10px; align-items: center;">
<button class="stop-all" onclick="stopAll()">🛑 STOP ALL</button> <button class="stop-all" onclick="stopAll()">🛑 STOP ALL</button>
<span id="app-version" style="color: #555; font-size: 0.8rem; margin-left: 10px;">v1.207</span> <span id="app-version" style="color: #555; font-size: 0.8rem; margin-left: 10px;">v1.208</span>
<button id="installBtn" style="display:none; ...">📥 INSTALLER</button> <button id="installBtn" style="display:none; ...">📥 INSTALLER</button>
</div> </div>

View File

@@ -207,6 +207,13 @@
document.getElementById('fileInput').onchange = (e) => { document.getElementById('fileInput').onchange = (e) => {
const file = e.target.files[0]; const file = e.target.files[0];
if (file) { if (file) {
// Extraction du nom sans l'extension
// .replace(/\.[^/.]+$/, "") retire tout ce qui suit le dernier point
const fileNameWithoutExtension = file.name.replace(/\.[^/.]+$/, "");
// On met à jour le champ texte du nom dans la modale
document.getElementById('inputName').value = fileNameWithoutExtension;
const reader = new FileReader(); const reader = new FileReader();
reader.onload = (ev) => { reader.onload = (ev) => {
tempFileData = ev.target.result; tempFileData = ev.target.result;

View File

@@ -1,4 +1,4 @@
const CACHE_NAME = 'sb-v1.207'; // Change ce numéro pour forcer une mise à jour globale const CACHE_NAME = 'sb-v1.208'; // Change ce numéro pour forcer une mise à jour globale
const ASSETS = [ const ASSETS = [
'./', // Racine './', // Racine
'./index.html', './index.html',