Documenter release et demo

This commit is contained in:
Johnnybegood90
2026-03-15 04:51:06 +01:00
parent 68f65f84b2
commit ef374b2633
6 changed files with 46 additions and 4 deletions
+3
View File
@@ -29,6 +29,9 @@ if (isset($config['epg_url']) && !isset($config['epg_sources'])) {
$group_name = htmlspecialchars($config['group_name'] ?? 'GridTV');
$epg_sources = $config['epg_sources'] ?? [];
$allow_personal_epg = !empty($config['allow_personal_epg']);
$allow_personal_m3u = array_key_exists('allow_personal_m3u', $config)
? !empty($config['allow_personal_m3u'])
: $allow_personal_epg;
// Default to the first configured source to keep the rest of the app compatible.
$first_source = $epg_sources[0] ?? [];
+1
View File
@@ -1,6 +1,7 @@
const EPG_SOURCES = <?= json_encode(array_values($epg_sources)) ?>;
const L = <?= json_encode($L) ?>;
const ALLOW_PERSONAL_EPG = <?= $allow_personal_epg ? 'true' : 'false' ?>;
const ALLOW_PERSONAL_M3U = <?= $allow_personal_m3u ? 'true' : 'false' ?>;
// Index of the currently selected source.
let activeSourceIndex = 0;
+1 -1
View File
@@ -9,7 +9,7 @@ window.addEventListener('load', () => {
const savedSource = localStorage.getItem('gridtv-active-source');
if (savedSource === 'personal') {
const epg = localStorage.getItem('gridtv-personal-epg');
const m3u = localStorage.getItem('gridtv-personal-m3u') ?? '';
const m3u = ALLOW_PERSONAL_M3U ? (localStorage.getItem('gridtv-personal-m3u') ?? '') : '';
if (epg) {
currentEpgUrl = epg;
currentM3uUrl = m3u;
+15 -3
View File
@@ -28,8 +28,16 @@ function openPersonalEpgModal() {
const saved_epg = localStorage.getItem('gridtv-personal-epg') ?? '';
const saved_m3u = localStorage.getItem('gridtv-personal-m3u') ?? '';
const modal = document.getElementById('personalEpgModal');
const m3uInput = document.getElementById('personalM3uInput');
const m3uHint = document.getElementById('personalM3uHint');
document.getElementById('personalEpgInput').value = saved_epg;
document.getElementById('personalM3uInput').value = saved_m3u;
if (m3uInput) {
m3uInput.value = ALLOW_PERSONAL_M3U ? saved_m3u : '';
m3uInput.disabled = !ALLOW_PERSONAL_M3U;
}
if (m3uHint) {
m3uHint.style.display = ALLOW_PERSONAL_M3U ? '' : 'none';
}
modal.classList.add('visible');
}
@@ -44,10 +52,14 @@ function closePersonalEpgModal(applied) {
function applyPersonalEpg() {
const epg = document.getElementById('personalEpgInput').value.trim();
const m3u = document.getElementById('personalM3uInput').value.trim();
const m3u = ALLOW_PERSONAL_M3U ? document.getElementById('personalM3uInput').value.trim() : '';
if (!epg) { alert('URL EPG obligatoire'); return; }
localStorage.setItem('gridtv-personal-epg', epg);
localStorage.setItem('gridtv-personal-m3u', m3u);
if (ALLOW_PERSONAL_M3U) {
localStorage.setItem('gridtv-personal-m3u', m3u);
} else {
localStorage.removeItem('gridtv-personal-m3u');
}
localStorage.setItem('gridtv-active-source', 'personal');
updateSourceDropdownLabel('✏ Personal EPG');
currentEpgUrl = epg;
+1
View File
@@ -29,6 +29,7 @@
<div class="modal-field">
<label><?= htmlspecialchars($L["personal_epg_m3u_label"]) ?> <span style="opacity:.5;font-size:10px">(<?= htmlspecialchars($L["personal_epg_optional"]) ?>)</span></label>
<input type="url" id="personalM3uInput" placeholder="http://mon-serveur/channels.m3u">
<div id="personalM3uHint" style="margin-top:6px;font-size:11px;opacity:.7;">This instance allows a personal M3U playlist.</div>
</div>
<div class="modal-actions">
<button class="modal-btn-cancel" onclick="closePersonalEpgModal()"><?= htmlspecialchars($L["cancel"]) ?></button>