From: Art Cancro Date: Sat, 1 Jan 2022 22:32:03 +0000 (-0500) Subject: Set up a proper favicon.ico in both webcit-classic and webcit-ng with a version of... X-Git-Tag: v944~22 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=03f8ea2b9c9ca63c0dfb47fb03b0a15c46e33294;p=citadel.git Set up a proper favicon.ico in both webcit-classic and webcit-ng with a version of the Citadel logo in it --- diff --git a/webcit-ng/request.c b/webcit-ng/request.c index a27a65ac2..349bae915 100644 --- a/webcit-ng/request.c +++ b/webcit-ng/request.c @@ -97,6 +97,11 @@ void perform_request(struct http_transaction *h) { return; } + if (!strcasecmp(h->url, "/favicon.ico")) { + output_static(h); + return; + } + // Everything below this line is strictly REST URL patterns. if (strncasecmp(h->url, HKEY("/ctdl/"))) { // Reject non-REST diff --git a/webcit-ng/static.c b/webcit-ng/static.c index f4aefa776..c34f12e3a 100644 --- a/webcit-ng/static.c +++ b/webcit-ng/static.c @@ -20,12 +20,17 @@ void output_static(struct http_transaction *h) { char filename[PATH_MAX]; struct stat statbuf; + syslog(LOG_DEBUG, "static: %s", h->url); + if (!strncasecmp(h->url, "/ctdl/s/", 8)) { snprintf(filename, sizeof filename, "static/%s", &h->url[8]); } else if (!strncasecmp(h->url, "/.well-known/", 13)) { snprintf(filename, sizeof filename, "static/.well-known/%s", &h->url[13]); } + else if (!strcasecmp(h->url, "/favicon.ico")) { + snprintf(filename, sizeof filename, "static/images/favicon.ico"); + } else { do_404(h); return; diff --git a/webcit-ng/static/citadel-logo.gif b/webcit-ng/static/citadel-logo.gif deleted file mode 100644 index 58611e843..000000000 Binary files a/webcit-ng/static/citadel-logo.gif and /dev/null differ diff --git a/webcit-ng/static/images/citadel-logo.gif b/webcit-ng/static/images/citadel-logo.gif new file mode 100644 index 000000000..58611e843 Binary files /dev/null and b/webcit-ng/static/images/citadel-logo.gif differ diff --git a/webcit-ng/static/images/favicon.ico b/webcit-ng/static/images/favicon.ico new file mode 100644 index 000000000..d8305d983 Binary files /dev/null and b/webcit-ng/static/images/favicon.ico differ diff --git a/webcit-ng/static/images/throbber.gif b/webcit-ng/static/images/throbber.gif new file mode 100644 index 000000000..772aa892d Binary files /dev/null and b/webcit-ng/static/images/throbber.gif differ diff --git a/webcit-ng/static/js/main.js b/webcit-ng/static/js/main.js index e76c9f44f..2ede01340 100644 --- a/webcit-ng/static/js/main.js +++ b/webcit-ng/static/js/main.js @@ -60,7 +60,7 @@ ctdl_startup = async() => { // Display a room list in the main div. // function display_room_list() { - document.getElementById("roomlist").innerHTML = ""; // show throbber while loading + document.getElementById("roomlist").innerHTML = ""; // show throbber while loading fetch_room_list = async() => { response = await fetch("/ctdl/r/"); diff --git a/webcit-ng/static/throbber.gif b/webcit-ng/static/throbber.gif deleted file mode 100644 index 772aa892d..000000000 Binary files a/webcit-ng/static/throbber.gif and /dev/null differ diff --git a/webcit/static/favicon.ico b/webcit/static/favicon.ico index d0c1741f9..d8305d983 100644 Binary files a/webcit/static/favicon.ico and b/webcit/static/favicon.ico differ