Set up a proper favicon.ico in both webcit-classic and webcit-ng with a version of...
authorArt Cancro <ajc@citadel.org>
Sat, 1 Jan 2022 22:32:03 +0000 (17:32 -0500)
committerArt Cancro <ajc@citadel.org>
Sat, 1 Jan 2022 22:32:03 +0000 (17:32 -0500)
webcit-ng/request.c
webcit-ng/static.c
webcit-ng/static/citadel-logo.gif [deleted file]
webcit-ng/static/images/citadel-logo.gif [new file with mode: 0644]
webcit-ng/static/images/favicon.ico [new file with mode: 0644]
webcit-ng/static/images/throbber.gif [new file with mode: 0644]
webcit-ng/static/js/main.js
webcit-ng/static/throbber.gif [deleted file]
webcit/static/favicon.ico

index a27a65ac26dc2018cd9fd7fc4bcac66e739841e6..349bae91563e9a1e87d6018213a0b64fe3793496 100644 (file)
@@ -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
index f4aefa776a5879723937877c24e76a0e86304036..c34f12e3a74d0a0f9bd46d008b819edd467cbfe3 100644 (file)
@@ -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 (file)
index 58611e8..0000000
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 (file)
index 0000000..58611e8
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 (file)
index 0000000..d8305d9
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 (file)
index 0000000..772aa89
Binary files /dev/null and b/webcit-ng/static/images/throbber.gif differ
index e76c9f44f75aff393343d576fe0ca22e1ab78f1b..2ede01340c3a1ec0d7c2ffcc0dcc6eca592fd19c 100644 (file)
@@ -60,7 +60,7 @@ ctdl_startup = async() => {
 // Display a room list in the main div.
 //
 function display_room_list() {
-       document.getElementById("roomlist").innerHTML = "<img src=\"/ctdl/s/throbber.gif\" />"; // show throbber while loading
+       document.getElementById("roomlist").innerHTML = "<img src=\"/ctdl/s/static/throbber.gif\" />";  // 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 (file)
index 772aa89..0000000
Binary files a/webcit-ng/static/throbber.gif and /dev/null differ
index d0c1741f9226ee02df503d48e354a657121d84fc..d8305d983732c460e76cd0f5ec1626df0e44459b 100644 (file)
Binary files a/webcit/static/favicon.ico and b/webcit/static/favicon.ico differ