@ywkrlerche/richardwho 1.0.25 → 1.0.26
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/app.js +5 -2
- package/config.js +5 -0
- package/games.json +1 -1
- package/index.html +2 -2
- package/package.json +1 -1
- package/logos/gm-test-game.png +0 -0
package/app.js
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
const CFG = window.RUG_CONFIG || {};
|
|
5
5
|
const SITE_NAME = "Richards Unblocked Games";
|
|
6
|
+
// The tab/history shows this instead of the real names (set in config.js)
|
|
7
|
+
const TAB_TITLE = CFG.tabTitle || null;
|
|
8
|
+
const tabTitle = (gameName) => TAB_TITLE || (gameName ? `${gameName} · ${SITE_NAME}` : SITE_NAME);
|
|
6
9
|
const RECENT_KEY = "rug-recent";
|
|
7
10
|
const CLOCK_KEY = "rug-clock24";
|
|
8
11
|
const THEME_KEY = "rug-theme";
|
|
@@ -202,7 +205,7 @@
|
|
|
202
205
|
els.retryBtn.hidden = true;
|
|
203
206
|
els.barFill.style.width = "0%";
|
|
204
207
|
els.loaderStatus.textContent = "Connecting…";
|
|
205
|
-
document.title =
|
|
208
|
+
document.title = tabTitle(game.name);
|
|
206
209
|
|
|
207
210
|
const urls = gameUrls(game);
|
|
208
211
|
const loaded = new Array(urls.length).fill(0);
|
|
@@ -342,7 +345,7 @@
|
|
|
342
345
|
stopGame();
|
|
343
346
|
els.player.hidden = true;
|
|
344
347
|
document.body.classList.remove("playing");
|
|
345
|
-
document.title =
|
|
348
|
+
document.title = tabTitle();
|
|
346
349
|
const view = location.hash === "#games" || location.hash === "#recent" ? "games" : "home";
|
|
347
350
|
els.homeView.hidden = view !== "home";
|
|
348
351
|
els.gamesView.hidden = view !== "games";
|
package/config.js
CHANGED
|
@@ -14,6 +14,11 @@ window.RUG_CONFIG = {
|
|
|
14
14
|
// Keys that trigger panic (KeyboardEvent.key values)
|
|
15
15
|
panicKeys: ["`", "]"],
|
|
16
16
|
|
|
17
|
+
// What the browser tab and history show instead of the site/game name.
|
|
18
|
+
// Set tabTitle to null to show the real names again.
|
|
19
|
+
tabTitle: "Google Classroom",
|
|
20
|
+
tabIcon: "https://ssl.gstatic.com/classroom/favicon.png",
|
|
21
|
+
|
|
17
22
|
// For local testing only: load games from a folder on a local server
|
|
18
23
|
// instead of jsDelivr, e.g. "/repos". Leave null when published.
|
|
19
24
|
localBase: null,
|