From: Michael Orlitzky Date: Thu, 2 Nov 2023 02:33:17 +0000 (-0400) Subject: index.html.in: return the empty string for unknown MARC zones X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=4bada97941c29af38c9b2b6b89dde71f24bae54f;p=charm-bypass.git index.html.in: return the empty string for unknown MARC zones --- diff --git a/index.html.in b/index.html.in index f6094fa..b09f59a 100644 --- a/index.html.in +++ b/index.html.in @@ -545,10 +545,10 @@ BWI_WBL: 1 }; - /* The default. Obviously wrong for when we don't - * have the necessary data. */ - let zone = 0; - + /* Compute the zone (string) for the given origin/destination pair. + * If we don't know it or if you chose in invalid pair (destination + * not on the same line as your origin?) then the empty string is + * returned. */ function compute_marc_zone(src, dest) { /* Forward direction key for zone_map */ const fwd = src + "_" + dest; @@ -558,6 +558,10 @@ * directions here. */ const rev = dest + "_" + src; + /* The default. Obviously wrong for when we don't + * have the necessary data. */ + let zone = -1; + if (zone_map[fwd]) { zone = zone_map[fwd]; } @@ -576,7 +580,7 @@ case 4: return "Four Zone"; default: - return "??? Zone"; + return ""; } }