Spaces:
Running
Running
feat: remove duplicate VTV channels section
Browse files- static/app_v2.js +0 -48
static/app_v2.js
CHANGED
|
@@ -24,10 +24,8 @@ async function loadHome(){
|
|
| 24 |
+'<div id="hashtag-box"></div>'
|
| 25 |
+'<div class="ls-section"><div class="ls-header"><h3>⚽ Livescore</h3></div><div class="ls-tabs"><span class="ls-tab active" data-tab="today" onclick="loadLivescore(\'today\')">📅 Hôm nay</span><span class="ls-tab" data-tab="live" onclick="loadLivescore(\'live\')">🔴 Live</span><span class="ls-tab" data-tab="incoming" onclick="loadLivescore(\'incoming\')">⏰ Sắp tới</span><span class="ls-tab" data-tab="results" onclick="loadLivescore(\'results\')">✅ Kết quả</span><span class="ls-tab" data-tab="bxh_nha" onclick="loadLivescore(\'bxh_nha\')">🏆 NHA</span><span class="ls-tab" data-tab="bxh_laliga" onclick="loadLivescore(\'bxh_laliga\')">🏆 La Liga</span></div><div class="ls-content" id="ls-content"><div class="loading">Đang tải...</div></div></div>'
|
| 26 |
+'<div id="wc2026-live-section" class="wc2026-section"><div class="wc-header"><h2>🏆 World Cup 2026</h2><span class="wc-live-badge">● LIVE</span></div><div class="wc-tabs"><span class="wc-tab active" onclick="switchWCTab(\'news\')">📰 Tin tức</span><span class="wc-tab" onclick="switchWCTab(\'fixtures\')">📅 Lịch thi đấu</span><span class="wc-tab" onclick="switchWCTab(\'standings\')">🏆 BXH</span><span class="wc-tab" onclick="switchWCTab(\'highlights\')">🎬 Highlight</span><span class="wc-tab" onclick="switchWCTab(\'stats\')">📊 Thống kê</span></div><div class="wc-content" id="wc-content"><div class="loading">Đang tải World Cup 2026...</div></div></div>'
|
| 27 |
-
+'<div class="vtv-section"><div class="ls-header"><h3>📺 VTV Channels</h3></div><div class="vtv-channels" id="vtv-channels"><div class="loading">Đang tải...</div></div></div>'
|
| 28 |
+'<div id="home-after-wc"></div>';
|
| 29 |
|
| 30 |
-
const afterEl = homeEl.querySelector('#home-after-wc');
|
| 31 |
|
| 32 |
// Start critical loads immediately
|
| 33 |
loadLivescore('today');
|
|
@@ -60,9 +58,6 @@ async function loadHome(){
|
|
| 60 |
// Render WC if data arrived
|
| 61 |
if(wcData) switchWCTab('news');
|
| 62 |
|
| 63 |
-
// Load VTV channels
|
| 64 |
-
loadVTVChannels();
|
| 65 |
-
|
| 66 |
// Render sections into the after-wc area
|
| 67 |
_renderShortsIn(afterEl);
|
| 68 |
_renderWallIn(afterEl);
|
|
@@ -133,49 +128,6 @@ function _renderHLIn(afterEl){
|
|
| 133 |
}
|
| 134 |
}
|
| 135 |
|
| 136 |
-
// === VTV CHANNELS RENDER ===
|
| 137 |
-
async function loadVTVChannels(){
|
| 138 |
-
const el=document.getElementById('vtv-channels');
|
| 139 |
-
if(!el) return;
|
| 140 |
-
try{
|
| 141 |
-
const r=await fetch('/api/vtv/streams');
|
| 142 |
-
const data=await r.json();
|
| 143 |
-
let h='';
|
| 144 |
-
const order=['vtv1','vtv2','vtv3','vtv4','vtv5','vtv6','vtv7','vtv8','vtv9','vtv10','vtvprime'];
|
| 145 |
-
order.forEach(ch=>{
|
| 146 |
-
if(data[ch]){
|
| 147 |
-
const sta=data[ch].status;
|
| 148 |
-
const replay=data[ch].replay_url;
|
| 149 |
-
h+=`<div class="vtv-channel-item" data-ch="${ch}"><div class="vtv-ch-name">${esc(data[ch].name)}</div><div class="vtv-ch-status ${sta}">${sta==='ok'?'🟢 LIVE':'🔴 Offline'}</div><div class="vtv-ch-actions"><button onclick="openVTVStream('${ch}')">📺 Xem LIVE</button><button onclick="openVTVReplay('${esc(replay)}')">⏮ Xem lại</button></div></div>`;
|
| 150 |
-
}
|
| 151 |
-
});
|
| 152 |
-
el.innerHTML=h||'<div style="color:#777;padding:20px">Không có dữ liệu</div>';
|
| 153 |
-
loadVTVChannels(); // Call after render
|
| 154 |
-
}catch(e){
|
| 155 |
-
el.innerHTML='<div style="color:#e74c3c;padding:20px">Lỗi tải kênh VTV</div>';
|
| 156 |
-
}
|
| 157 |
-
}
|
| 158 |
-
|
| 159 |
-
async function openVTVStream(ch){
|
| 160 |
-
try{
|
| 161 |
-
const r=await fetch('/api/vtv/stream/'+ch);
|
| 162 |
-
const d=await r.json();
|
| 163 |
-
if(d.stream_url){
|
| 164 |
-
window.open('/api/proxy/page?url='+encodeURIComponent(d.stream_url),' _blank');
|
| 165 |
-
}else{
|
| 166 |
-
toast('Kênh chưa có stream');
|
| 167 |
-
}
|
| 168 |
-
}catch(e){
|
| 169 |
-
toast('Lỗi: '+e.message);
|
| 170 |
-
}
|
| 171 |
-
}
|
| 172 |
-
|
| 173 |
-
function openVTVReplay(url){
|
| 174 |
-
if(url){
|
| 175 |
-
window.open(url,'_blank');
|
| 176 |
-
}
|
| 177 |
-
}
|
| 178 |
-
|
| 179 |
// === WALL POST HELPERS ===
|
| 180 |
function makeWallItem(p,i){
|
| 181 |
const hasVideo = p.video && p.video.length > 0;
|
|
|
|
| 24 |
+'<div id="hashtag-box"></div>'
|
| 25 |
+'<div class="ls-section"><div class="ls-header"><h3>⚽ Livescore</h3></div><div class="ls-tabs"><span class="ls-tab active" data-tab="today" onclick="loadLivescore(\'today\')">📅 Hôm nay</span><span class="ls-tab" data-tab="live" onclick="loadLivescore(\'live\')">🔴 Live</span><span class="ls-tab" data-tab="incoming" onclick="loadLivescore(\'incoming\')">⏰ Sắp tới</span><span class="ls-tab" data-tab="results" onclick="loadLivescore(\'results\')">✅ Kết quả</span><span class="ls-tab" data-tab="bxh_nha" onclick="loadLivescore(\'bxh_nha\')">🏆 NHA</span><span class="ls-tab" data-tab="bxh_laliga" onclick="loadLivescore(\'bxh_laliga\')">🏆 La Liga</span></div><div class="ls-content" id="ls-content"><div class="loading">Đang tải...</div></div></div>'
|
| 26 |
+'<div id="wc2026-live-section" class="wc2026-section"><div class="wc-header"><h2>🏆 World Cup 2026</h2><span class="wc-live-badge">● LIVE</span></div><div class="wc-tabs"><span class="wc-tab active" onclick="switchWCTab(\'news\')">📰 Tin tức</span><span class="wc-tab" onclick="switchWCTab(\'fixtures\')">📅 Lịch thi đấu</span><span class="wc-tab" onclick="switchWCTab(\'standings\')">🏆 BXH</span><span class="wc-tab" onclick="switchWCTab(\'highlights\')">🎬 Highlight</span><span class="wc-tab" onclick="switchWCTab(\'stats\')">📊 Thống kê</span></div><div class="wc-content" id="wc-content"><div class="loading">Đang tải World Cup 2026...</div></div></div>'
|
|
|
|
| 27 |
+'<div id="home-after-wc"></div>';
|
| 28 |
|
|
|
|
| 29 |
|
| 30 |
// Start critical loads immediately
|
| 31 |
loadLivescore('today');
|
|
|
|
| 58 |
// Render WC if data arrived
|
| 59 |
if(wcData) switchWCTab('news');
|
| 60 |
|
|
|
|
|
|
|
|
|
|
| 61 |
// Render sections into the after-wc area
|
| 62 |
_renderShortsIn(afterEl);
|
| 63 |
_renderWallIn(afterEl);
|
|
|
|
| 128 |
}
|
| 129 |
}
|
| 130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
// === WALL POST HELPERS ===
|
| 132 |
function makeWallItem(p,i){
|
| 133 |
const hasVideo = p.video && p.video.length > 0;
|