From dd87788b9100b1a129afa75d20028bdbaeff9e91 Mon Sep 17 00:00:00 2001 From: Kevin McCurley Date: Wed, 11 Dec 2024 11:33:48 -0800 Subject: [PATCH 1/3] Make meta available in javascript. --- js/program.js | 3 +++ program.php | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/js/program.js b/js/program.js index 8c900eb..aa87b71 100644 --- a/js/program.js +++ b/js/program.js @@ -90,6 +90,9 @@ function scrollToSession() { function drawProgram() { /* Every timeslot gets a tabbedSessions variable when it is drawn, to detect which ones should use tabs. */ + if (!Object.hasOwn(currentProgram.config.timezone, 'shortName')) { + currentProgram.config.timezone.shortName = meta.city; + } let days = currentProgram['days']; for (var i = 0; i < days.length; i++) { var timeslots = days[i]['timeslots']; diff --git a/program.php b/program.php index 02d2a7d..bfe686f 100755 --- a/program.php +++ b/program.php @@ -35,6 +35,9 @@ font-size: 80%; } + @@ -251,4 +254,4 @@ - \ No newline at end of file + From 0092b1628dc56bb07e042342e1f37829f7e2b922 Mon Sep 17 00:00:00 2001 From: Kevin McCurley Date: Wed, 11 Dec 2024 11:39:15 -0800 Subject: [PATCH 2/3] Move to head.php instead of program.php. --- includes/head.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/head.php b/includes/head.php index d9754b3..86a50fb 100644 --- a/includes/head.php +++ b/includes/head.php @@ -97,4 +97,8 @@ function rootPath() - \ No newline at end of file + + From f5d8c1a59fe62e962db29f77629775f32edbcb30 Mon Sep 17 00:00:00 2001 From: Kevin McCurley Date: Wed, 11 Dec 2024 11:46:10 -0800 Subject: [PATCH 3/3] Remove from program.php --- js/program.js | 8 +++++++- program.php | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/program.js b/js/program.js index aa87b71..abbcae2 100644 --- a/js/program.js +++ b/js/program.js @@ -90,8 +90,14 @@ function scrollToSession() { function drawProgram() { /* Every timeslot gets a tabbedSessions variable when it is drawn, to detect which ones should use tabs. */ + // Populate the shortName in the program if it wasn't already set. if (!Object.hasOwn(currentProgram.config.timezone, 'shortName')) { - currentProgram.config.timezone.shortName = meta.city; + // If the metadata.json doesn't have a city set, we use 'Local' + if (meta.city) { + currentProgram.config.timezone.shortName = meta.city; + } else { + currentProgram.config.timezone.shortName = 'Local' + } } let days = currentProgram['days']; for (var i = 0; i < days.length; i++) { diff --git a/program.php b/program.php index bfe686f..1e9bfa4 100755 --- a/program.php +++ b/program.php @@ -35,9 +35,6 @@ font-size: 80%; } -