reaper-arcade-hub 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/app.js +48 -6
- package/main/js/app.js +48 -6
- package/package.json +2 -2
package/js/app.js
CHANGED
|
@@ -1654,20 +1654,20 @@ class ReaperHubApp {
|
|
|
1654
1654
|
const coverUrl = game.cover || `https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}`;
|
|
1655
1655
|
|
|
1656
1656
|
return `
|
|
1657
|
-
<div class="game-card" onclick="app.launchGame('${game.id}')">
|
|
1657
|
+
<div class="game-card" data-id="${game.id}" onclick="app.launchGame('${game.id}')">
|
|
1658
1658
|
<div class="game-thumb-container">
|
|
1659
|
-
<img class="game-thumb" src="${coverUrl}" alt="${game.name}" loading="lazy" onerror="this.onerror=null; this.src='https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}';" />
|
|
1659
|
+
<img class="game-thumb" src="${coverUrl}" alt="${this.escapeHtml(game.name)}" loading="lazy" onerror="this.onerror=null; this.src='https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}';" />
|
|
1660
1660
|
${game.featured ? '<span class="game-badge-featured">FEATURED</span>' : ''}
|
|
1661
1661
|
</div>
|
|
1662
1662
|
<div class="game-info">
|
|
1663
|
-
<div class="game-title" title="${game.name}">${game.name}</div>
|
|
1663
|
+
<div class="game-title" title="${this.escapeHtml(game.name)}">${this.escapeHtml(game.name)}</div>
|
|
1664
1664
|
<div class="game-meta">
|
|
1665
|
-
<span class="game-author">${game.author || 'GN-Math'}</span>
|
|
1666
|
-
<button class="btn-fav ${isFav ? 'active' : ''}" onclick="event.stopPropagation(); app.toggleFavorite('${game.id}')" title="${isFav ? 'Remove from favorites' : 'Add to favorites'}">
|
|
1665
|
+
<span class="game-author">${this.escapeHtml(game.author || 'GN-Math')}</span>
|
|
1666
|
+
<button class="btn-fav ${isFav ? 'active' : ''}" data-id="${game.id}" onclick="event.stopPropagation(); app.toggleFavorite('${game.id}')" title="${isFav ? 'Remove from favorites' : 'Add to favorites'}">
|
|
1667
1667
|
${isFav ? '★ SAVED' : '☆ FAV'}
|
|
1668
1668
|
</button>
|
|
1669
1669
|
</div>
|
|
1670
|
-
<button class="btn-card-play" onclick="event.stopPropagation(); app.launchGame('${game.id}')">PLAY GAME</button>
|
|
1670
|
+
<button class="btn-card-play" data-id="${game.id}" onclick="event.stopPropagation(); app.launchGame('${game.id}')">PLAY GAME</button>
|
|
1671
1671
|
</div>
|
|
1672
1672
|
</div>
|
|
1673
1673
|
`;
|
|
@@ -2509,6 +2509,48 @@ class ReaperHubApp {
|
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
2511
|
});
|
|
2512
|
+
|
|
2513
|
+
// Guaranteed Click Delegation for Games Grid & Recent Games Grid
|
|
2514
|
+
const gamesGrid = document.getElementById('games-grid');
|
|
2515
|
+
if (gamesGrid) {
|
|
2516
|
+
gamesGrid.addEventListener('click', (e) => {
|
|
2517
|
+
const favBtn = e.target.closest('.btn-fav');
|
|
2518
|
+
if (favBtn) {
|
|
2519
|
+
e.preventDefault();
|
|
2520
|
+
e.stopPropagation();
|
|
2521
|
+
const id = favBtn.getAttribute('data-id');
|
|
2522
|
+
if (id !== null) this.toggleFavorite(id);
|
|
2523
|
+
return;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
const card = e.target.closest('.game-card');
|
|
2527
|
+
const playBtn = e.target.closest('.btn-card-play');
|
|
2528
|
+
if (card || playBtn) {
|
|
2529
|
+
e.preventDefault();
|
|
2530
|
+
e.stopPropagation();
|
|
2531
|
+
const target = playBtn || card;
|
|
2532
|
+
const id = target.getAttribute('data-id') || (card ? card.getAttribute('data-id') : null);
|
|
2533
|
+
if (id !== null) {
|
|
2534
|
+
this.launchGame(id);
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
});
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
const recentGrid = document.getElementById('recent-games-grid');
|
|
2541
|
+
if (recentGrid) {
|
|
2542
|
+
recentGrid.addEventListener('click', (e) => {
|
|
2543
|
+
const card = e.target.closest('.recent-card');
|
|
2544
|
+
if (card) {
|
|
2545
|
+
e.preventDefault();
|
|
2546
|
+
e.stopPropagation();
|
|
2547
|
+
const id = card.getAttribute('data-id');
|
|
2548
|
+
if (id !== null) {
|
|
2549
|
+
this.launchGame(id);
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
});
|
|
2553
|
+
}
|
|
2512
2554
|
}
|
|
2513
2555
|
|
|
2514
2556
|
openSettingsModal() {
|
package/main/js/app.js
CHANGED
|
@@ -1654,20 +1654,20 @@ class ReaperHubApp {
|
|
|
1654
1654
|
const coverUrl = game.cover || `https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}`;
|
|
1655
1655
|
|
|
1656
1656
|
return `
|
|
1657
|
-
<div class="game-card" onclick="app.launchGame('${game.id}')">
|
|
1657
|
+
<div class="game-card" data-id="${game.id}" onclick="app.launchGame('${game.id}')">
|
|
1658
1658
|
<div class="game-thumb-container">
|
|
1659
|
-
<img class="game-thumb" src="${coverUrl}" alt="${game.name}" loading="lazy" onerror="this.onerror=null; this.src='https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}';" />
|
|
1659
|
+
<img class="game-thumb" src="${coverUrl}" alt="${this.escapeHtml(game.name)}" loading="lazy" onerror="this.onerror=null; this.src='https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}';" />
|
|
1660
1660
|
${game.featured ? '<span class="game-badge-featured">FEATURED</span>' : ''}
|
|
1661
1661
|
</div>
|
|
1662
1662
|
<div class="game-info">
|
|
1663
|
-
<div class="game-title" title="${game.name}">${game.name}</div>
|
|
1663
|
+
<div class="game-title" title="${this.escapeHtml(game.name)}">${this.escapeHtml(game.name)}</div>
|
|
1664
1664
|
<div class="game-meta">
|
|
1665
|
-
<span class="game-author">${game.author || 'GN-Math'}</span>
|
|
1666
|
-
<button class="btn-fav ${isFav ? 'active' : ''}" onclick="event.stopPropagation(); app.toggleFavorite('${game.id}')" title="${isFav ? 'Remove from favorites' : 'Add to favorites'}">
|
|
1665
|
+
<span class="game-author">${this.escapeHtml(game.author || 'GN-Math')}</span>
|
|
1666
|
+
<button class="btn-fav ${isFav ? 'active' : ''}" data-id="${game.id}" onclick="event.stopPropagation(); app.toggleFavorite('${game.id}')" title="${isFav ? 'Remove from favorites' : 'Add to favorites'}">
|
|
1667
1667
|
${isFav ? '★ SAVED' : '☆ FAV'}
|
|
1668
1668
|
</button>
|
|
1669
1669
|
</div>
|
|
1670
|
-
<button class="btn-card-play" onclick="event.stopPropagation(); app.launchGame('${game.id}')">PLAY GAME</button>
|
|
1670
|
+
<button class="btn-card-play" data-id="${game.id}" onclick="event.stopPropagation(); app.launchGame('${game.id}')">PLAY GAME</button>
|
|
1671
1671
|
</div>
|
|
1672
1672
|
</div>
|
|
1673
1673
|
`;
|
|
@@ -2509,6 +2509,48 @@ class ReaperHubApp {
|
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
2511
|
});
|
|
2512
|
+
|
|
2513
|
+
// Guaranteed Click Delegation for Games Grid & Recent Games Grid
|
|
2514
|
+
const gamesGrid = document.getElementById('games-grid');
|
|
2515
|
+
if (gamesGrid) {
|
|
2516
|
+
gamesGrid.addEventListener('click', (e) => {
|
|
2517
|
+
const favBtn = e.target.closest('.btn-fav');
|
|
2518
|
+
if (favBtn) {
|
|
2519
|
+
e.preventDefault();
|
|
2520
|
+
e.stopPropagation();
|
|
2521
|
+
const id = favBtn.getAttribute('data-id');
|
|
2522
|
+
if (id !== null) this.toggleFavorite(id);
|
|
2523
|
+
return;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
const card = e.target.closest('.game-card');
|
|
2527
|
+
const playBtn = e.target.closest('.btn-card-play');
|
|
2528
|
+
if (card || playBtn) {
|
|
2529
|
+
e.preventDefault();
|
|
2530
|
+
e.stopPropagation();
|
|
2531
|
+
const target = playBtn || card;
|
|
2532
|
+
const id = target.getAttribute('data-id') || (card ? card.getAttribute('data-id') : null);
|
|
2533
|
+
if (id !== null) {
|
|
2534
|
+
this.launchGame(id);
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
});
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
const recentGrid = document.getElementById('recent-games-grid');
|
|
2541
|
+
if (recentGrid) {
|
|
2542
|
+
recentGrid.addEventListener('click', (e) => {
|
|
2543
|
+
const card = e.target.closest('.recent-card');
|
|
2544
|
+
if (card) {
|
|
2545
|
+
e.preventDefault();
|
|
2546
|
+
e.stopPropagation();
|
|
2547
|
+
const id = card.getAttribute('data-id');
|
|
2548
|
+
if (id !== null) {
|
|
2549
|
+
this.launchGame(id);
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
});
|
|
2553
|
+
}
|
|
2512
2554
|
}
|
|
2513
2555
|
|
|
2514
2556
|
openSettingsModal() {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reaper-arcade-hub",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "Reaper Hub -
|
|
3
|
+
"version": "2.0.9",
|
|
4
|
+
"description": "Reaper Hub - Full Click Delegation & Recoded Games Tab, Direct 788-Game Loading (GitHub Pages CDN), Strict Key Gatekeeper, Security Shield & Realtime Chat",
|
|
5
5
|
"main": "main/index.html",
|
|
6
6
|
"unpkg": "main/index.html",
|
|
7
7
|
"jsdelivr": "main/index.html",
|