From 5672f468862951837f54c792bddd9758f64a4738 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Mon, 1 Jul 2024 01:28:27 +1200 Subject: [PATCH 01/10] Add new independent wikis --- src/application-globals.rkt | 2 +- src/extwiki-data.rkt | 68 +++++++++++++++++++++++++++++++++++-- 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/src/application-globals.rkt b/src/application-globals.rkt index e574707..6d940ac 100644 --- a/src/application-globals.rkt +++ b/src/application-globals.rkt @@ -108,8 +108,8 @@ (a (@ (class "niwa__go") (href ,go)) "Read " ,title " on " ,(extwiki^-name xt) " →") (div (@ (class "niwa__cols")) (div (@ (class "niwa__left")) - (p ,((extwiki-group^-description group) props)) (p ,((extwiki^-description xt) props)) + (p ,((extwiki-group^-description group) props)) (p "This wiki's core community has largely migrated away from Fandom. You should " (a (@ (href ,go)) "go to " ,(extwiki^-name xt) " now!")) (p (@ (class "niwa__feedback")) diff --git a/src/extwiki-data.rkt b/src/extwiki-data.rkt index 77aa27a..29997c4 100644 --- a/src/extwiki-data.rkt +++ b/src/extwiki-data.rkt @@ -27,6 +27,13 @@ (λ (props) `(p "The Square Enix Indpendent Wiki Alliance, or SEIWA, is a network of independent wikis established in 2011 and focused on providing high-quality coverage of Square Enix and its content. We work together, along with our affiliates and others, to co-operate and support one another while providing the best-quality content on the various Square Enix video games and media."))) + 'GWN + (extwiki-group^ + "GWN" + '(("Gaming Wiki Network" . "https://gamingwikinetwork.org/")) + (λ (props) + `(p "This wiki is part of the Gaming Wiki Network, a network of independently-hosted wikis about video game franchises. The GWN was founded on October 21, 2022. It aims to support all gaming communities in building independently-hosted wikis."))) + 'Terraria (extwiki-group^ "Terraria" @@ -316,11 +323,11 @@ (extwiki^ '("zelda" "zelda-archive") 'default 'NIWA - "Zeldapedia" - "https://zeldapedia.wiki/wiki/Main_Page" + "Zelda Wiki" + "https://zeldawiki.wiki/wiki/Main_Page" "https://niwanetwork.org/images/logos/zeldapedia.png" (λ (props) - `((p "Founded on April 23, 2005 as Zelda Wiki, today's Zeldapedia is your definitive source for encyclopedic information on The Legend of Zelda series, as well as all of the latest Zelda news. Zeldapedia went independent from Fandom in October 2022, citing Fandom's recent buyouts and staffing decisions among their reasons.")))) + `((p "Founded on April 23, 2005, Zelda Wiki is your definitive source for encyclopedic information on The Legend of Zelda series, as well as all of the latest Zelda news. Zelda Wiki went independent from Fandom in October 2022, citing Fandom's recent buyouts and staffing decisions among their reasons.")))) (extwiki^ '("chrono") 'default @@ -435,6 +442,61 @@ (λ (props) `())) + (extwiki^ + '("wizardry") 'default + 'GWN + "Wizardry Wiki" + "https://wizardry.wiki.gg/wiki/Wizardry_Wiki" + "https://wizardry.wiki.gg/images/e/e6/Site-logo.png" + (λ (props) + `((p "On March 21, 2023, the wiki has decided to leave and abandoning from Fandom due to numerous of issues such as intrusive advertising, long-lasting bugs, restrictions on customization, etcetera. Wizardry Wiki was officially inducted into the wiki.gg wikifarm, with all contents forked over.") + (p "The wiki has partnered with " (a (@ (href "https://fallout.wiki/")) "Independent Fallout Wiki") " as of June 14, 2024.")))) + + (extwiki^ + '("jackryan") 'default + 'GWN + "Tom Clancy Wiki" + "https://tomclancy.wiki.gg/wiki/Tom_Clancy_Wiki" + "https://tomclancy.wiki.gg/images/thumb/c/c5/Jack_Ryan_Logo_Dark.png/600px-Jack_Ryan_Logo_Dark.png" + (λ (props) + `((p "The Tom Clancy Wiki is a collaborative encyclopedia dedicated to Tom Clancy’s franchises. The Tom Clancy franchise is a 40-year old expansive franchise founded by Tom Clancy, telling several unique sagas through books, video games, and films, as well as a TV show.")))) + + (extwiki^ + '("hollowknight") 'default + 'GWN + "Hollow Knight Wiki" + "https://hollowknight.wiki/wiki/Main_Page" + "https://gamingwikinetwork.org/images/logos/hollowknight.png" + (λ (props) + `((p "We are an independently hosted wiki for the games Hollow Knight and Hollow Knight: Silksong, created by fans, for fans. The wiki is a fork of the FANDOM Hollow Knight Wiki and was officially unveiled on October 31, 2023.")))) + + (extwiki^ + '("hellokitty" "sanrio") 'default + 'GWN + "Sanrio Wiki" + "https://sanriowiki.com/wiki/Sanrio_Wiki" + "https://cdn.sanriowiki.com/wiki.png" + (λ (props) + `((p "Sanrio Wiki is a project that was started on April 14, 2015 by EvieMelody. It was hosted on the wiki-farm ShoutWiki and has since become independent.")))) + + (extwiki^ + '("sto") 'default + 'GWN + "Star Trek Online Wiki" + "https://stowiki.net/wiki/Main_Page" + "https://gamingwikinetwork.org/images/logos/stowiki.png" + (λ (props) + `())) + + (extwiki^ + '("rayman-game" "ubisoftrayman") 'default + 'GWN + "Rayman Wiki" + "https://raymanpc.com/wiki/en/Main_Page" + "https://raymanpc.com/wiki/script-en/resources/assets/logo-en.png?5c608" + (λ (props) + `())) + ;; fandom wikinames * empty * empty * Name * Home Page (extwiki^ '("aether") 'empty 'empty "Aether Wiki" "https://aether.wiki.gg/wiki/Aether_Wiki" #f #f) (extwiki^ '("before-darkness-falls") 'empty 'empty "Before Darkness Falls Wiki" "https://beforedarknessfalls.wiki.gg/wiki/Before_Darkness_Falls_Wiki" #f #f) From 1ef184547b2be6715318c3d749d3114fe61866ec Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Mon, 1 Jul 2024 02:28:17 +1200 Subject: [PATCH 02/10] Allow minimising independent wiki notice --- src/application-globals.rkt | 18 ++++++++++-------- src/data.rkt | 25 ++++++++++++++++++++----- static/main.css | 17 +++++++++++++++++ 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/src/application-globals.rkt b/src/application-globals.rkt index 6d940ac..26cd6ae 100644 --- a/src/application-globals.rkt +++ b/src/application-globals.rkt @@ -68,9 +68,6 @@ `(p ,(format "This instance is run by the ~a developer, " (config-get 'application_name)) (a (@ (href "https://cadence.moe/contact")) "Cadence") - ". Proudly hosted by " - (a (@ (href "http://alphamethyl.barr0w.net")) - "Barrow Network Solutions" (sup "XD")) ".") `(p ,(format "This unofficial instance is based off the ~a source code, but is not controlled by the code developer." (config-get 'application_name))))) @@ -88,11 +85,13 @@ ;; generate a notice with a link if a fandom wiki has a replacement as part of NIWA or similar ;; if the wiki has no replacement, display nothing -(define (extwiki-notice wikiname title) +(define (extwiki-notice wikiname title req user-cookies) (define xt (findf (λ (item) (member wikiname (extwiki^-wikinames item))) extwikis)) (cond/var [xt - (let* ([group (hash-ref extwiki-groups (extwiki^-group xt))] + (let* ([seen? (member wikiname (user-cookies^-notices user-cookies))] + [aside-class (if seen? "niwa__notice niwa--seen" "niwa__notice")] + [group (hash-ref extwiki-groups (extwiki^-group xt))] [search-page (format "/Special:Search?~a" (params->query `(("search" . ,title) ("go" . "Go"))))] @@ -103,7 +102,7 @@ [props (extwiki-props^ go)]) (cond [(eq? (extwiki^-banner xt) 'default) - `(aside (@ (class "niwa__notice")) + `(aside (@ (class ,aside-class)) (h1 (@ (class "niwa__header")) ,(extwiki^-name xt) " has its own website separate from Fandom.") (a (@ (class "niwa__go") (href ,go)) "Read " ,title " on " ,(extwiki^-name xt) " →") (div (@ (class "niwa__cols")) @@ -117,7 +116,10 @@ `(,@(for/list ([link (extwiki-group^-links group)]) `(a (@ (href ,(cdr link))) ,(car link))) "This notice is from BreezeWiki" - (a (@ (href "https://docs.breezewiki.com/Reporting_Bugs.html")) "Feedback?")) + (a (@ (rel "nofollow") + (class "niwa__got-it") + (href ,(user-cookies-setter-url/add-notice req user-cookies wikiname))) + "OK, got it")) " / "))) (div (@ (class "niwa__right")) (img (@ (class "niwa__logo") (src ,(extwiki^-logo xt)))))))] @@ -225,7 +227,7 @@ (div (@ (class "fandom-community-header__background tileHorizontally header"))) (div (@ (class "page")) (main (@ (class "page__main")) - ,(extwiki-notice wikiname title) + ,(extwiki-notice wikiname title req user-cookies) (div (@ (class "custom-top")) (h1 (@ (class "page-title")) ,title) (nav (@ (class "sitesearch")) diff --git a/src/data.rkt b/src/data.rkt index 5aba2c2..63c7f03 100644 --- a/src/data.rkt +++ b/src/data.rkt @@ -1,6 +1,7 @@ #lang racket/base (require racket/list racket/match + racket/string web-server/http/request-structs net/url-string (only-in net/cookies/server cookie-header->alist cookie->set-cookie-header make-cookie) @@ -27,7 +28,8 @@ user-cookies-getter user-cookies-default user-cookies-setter - user-cookies-setter-url) + user-cookies-setter-url + user-cookies-setter-url/add-notice) (struct siteinfo^ (sitename basepage license) #:transparent) (struct license^ (text url) #:transparent) @@ -90,8 +92,8 @@ ;; then no matter what, return the best information we have so far this-data)) -(struct user-cookies^ (theme) #:prefab) -(define user-cookies-default (user-cookies^ 'default)) +(struct user-cookies^ (theme notices) #:prefab) +(define user-cookies-default (user-cookies^ 'default '())) (define (user-cookies-getter req) (define cookie-header (headers-assq* #"cookie" (request-headers/raw req))) (define cookies-alist (if cookie-header (cookie-header->alist (header-value cookie-header) bytes->string/utf-8) null)) @@ -100,16 +102,29 @@ (match pair [(cons "theme" (and theme (or "light" "dark" "default"))) (values 'theme (string->symbol theme))] + [(cons "notices" notices) + (values 'notices (string-split notices "|"))] [_ (values #f #f)]))) (user-cookies^ - (hash-ref cookies-hash 'theme (user-cookies^-theme user-cookies-default)))) + (hash-ref cookies-hash 'theme (user-cookies^-theme user-cookies-default)) + (hash-ref cookies-hash 'notices (user-cookies^-notices user-cookies-default)))) (define (user-cookies-setter user-cookies) (map (λ (c) (header #"Set-Cookie" (cookie->set-cookie-header c))) (list (make-cookie "theme" (symbol->string (user-cookies^-theme user-cookies)) + #:path "/" + #:max-age (* 60 60 24 365 10)) + (make-cookie "notices" (string-join (user-cookies^-notices user-cookies) "|") + #:path "/" #:max-age (* 60 60 24 365 10))))) (define (user-cookies-setter-url req new-settings) (format "/set-user-settings?~a" (params->query `(("next_location" . ,(url->string (request-uri req))) - ("new_settings" . ,(format "~a" new-settings)))))) + ("new_settings" . ,(format "~s" new-settings)))))) + +(define (user-cookies-setter-url/add-notice req user-cookies notice-name) + (user-cookies-setter-url + req + (struct-copy user-cookies^ user-cookies + [notices (cons notice-name (user-cookies^-notices user-cookies))]))) diff --git a/static/main.css b/static/main.css index bcd612b..a8e9703 100644 --- a/static/main.css +++ b/static/main.css @@ -431,6 +431,23 @@ a.ext-audiobutton { /* see hearthstone/wiki/Diablo_(Duels_hero) */ font-size: 14px; text-align: right; } +/* more compact notice after it's been seen the first time */ +.niwa--seen { + padding: 1.5vw 2vw 2vw; + overflow-y: auto; + max-height: min(280px, 33vh); + font-size: 17px; +} +.niwa--seen .niwa__header { + font-size: 26px; +} +.niwa--seen .niwa__go { + padding: 10px 18px; + font-size: 20px; +} +.niwa--seen .niwa__got-it { + display: none; +} /* media queries */ From 14930f18dc73457f1cb6ef677285333a112a048e Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Mon, 1 Jul 2024 02:32:39 +1200 Subject: [PATCH 03/10] Save even more vertical space --- static/main.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/main.css b/static/main.css index a8e9703..5b3e7e2 100644 --- a/static/main.css +++ b/static/main.css @@ -437,6 +437,8 @@ a.ext-audiobutton { /* see hearthstone/wiki/Diablo_(Duels_hero) */ overflow-y: auto; max-height: min(280px, 33vh); font-size: 17px; + margin-top: -2vw; + margin-bottom: 12px; } .niwa--seen .niwa__header { font-size: 26px; From 8f0caa913240df0e797c587d460ab460f75528f3 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Mon, 1 Jul 2024 02:45:51 +1200 Subject: [PATCH 04/10] Add Enter the Gungeon wiki.gg redirect --- src/extwiki-data.rkt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extwiki-data.rkt b/src/extwiki-data.rkt index 29997c4..f190e5f 100644 --- a/src/extwiki-data.rkt +++ b/src/extwiki-data.rkt @@ -512,6 +512,7 @@ (extwiki^ '("doom") 'empty 'empty "DoomWiki.org" "https://doomwiki.org/wiki/Entryway" #f #f) (extwiki^ '("dreamscaper") 'empty 'empty "Official Dreamscaper Wiki" "https://dreamscaper.wiki.gg/wiki/Dreamscaper_Wiki" #f #f) (extwiki^ '("elderscrolls") 'empty 'empty "UESP" "https://en.uesp.net/wiki/Main_Page" #f #f) + (extwiki^ '("enterthegungeon" "exit-the-gungeon" "enter-the-gungeon-archive") 'empty 'empty "Official Enter The Gungeon Wiki" "https://enterthegungeon.wiki.gg/wiki/Enter_the_Gungeon_Wiki" "https://enterthegungeon.wiki.gg/images/e/e6/Site-logo.png" #f) (extwiki^ '("fiend-folio") 'empty 'empty "Official Fiend Folio Wiki" "https://fiendfolio.wiki.gg/wiki/Fiend_Folio_Wiki" #f #f) (extwiki^ '("foxhole") 'empty 'empty "Foxhole Wiki" "https://foxhole.wiki.gg/wiki/Foxhole_Wiki" #f #f) (extwiki^ '("have-a-nice-death") 'empty 'empty "Have a Nice Death Wiki" "https://haveanicedeath.wiki.gg/wiki/Have_a_Nice_Death_Wiki" #f #f) From 49682b23207443a7766853f4afd90e0dbd4520c8 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 3 Jul 2024 23:37:44 +1200 Subject: [PATCH 05/10] Fix for Racket 8.13 --- src/config.rkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.rkt b/src/config.rkt index fec546b..b1afe0a 100644 --- a/src/config.rkt +++ b/src/config.rkt @@ -104,7 +104,7 @@ ; all values here are optimised for maximum prettiness (parameterize ([pretty-print-columns 80]) (display "config: ") - (pretty-write ((inst sort (Pairof Symbol String)) + (pretty-write ((inst sort (Pairof Symbol String) Symbol) (hash->list (make-immutable-hasheq combined-alist)) symbol Date: Thu, 4 Jul 2024 19:21:17 +1200 Subject: [PATCH 06/10] Add Granblue redirect --- src/extwiki-data.rkt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/extwiki-data.rkt b/src/extwiki-data.rkt index f190e5f..8971640 100644 --- a/src/extwiki-data.rkt +++ b/src/extwiki-data.rkt @@ -89,7 +89,7 @@ (extwiki-group^ "Misc" '(("This wiki doesn't have a description yet. Add one?" . "https://docs.breezewiki.com/Reporting_Bugs.html")) - #f))) + (λ (props) '())))) ;; wikiname, niwa-name, url, logo-url (struct extwiki^ (wikinames banner group name home logo description) #:transparent) @@ -497,6 +497,15 @@ (λ (props) `())) + (extwiki^ + '("granblue") 'empty + 'empty + "Granblue Fantasy Wiki" + "https://gbf.wiki/" + "https://gbf.wiki/images/1/18/Vyrnball.png?0704c" + (λ (props) + `())) + ;; fandom wikinames * empty * empty * Name * Home Page (extwiki^ '("aether") 'empty 'empty "Aether Wiki" "https://aether.wiki.gg/wiki/Aether_Wiki" #f #f) (extwiki^ '("before-darkness-falls") 'empty 'empty "Before Darkness Falls Wiki" "https://beforedarknessfalls.wiki.gg/wiki/Before_Darkness_Falls_Wiki" #f #f) From 1e3451a990e64fc75b76ee51bd626ccd57e28127 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Sun, 14 Jul 2024 23:25:52 +1200 Subject: [PATCH 07/10] Add HELLMET wiki --- src/extwiki-data.rkt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/extwiki-data.rkt b/src/extwiki-data.rkt index 8971640..4a2cca2 100644 --- a/src/extwiki-data.rkt +++ b/src/extwiki-data.rkt @@ -506,6 +506,15 @@ (λ (props) `())) + (extwiki^ + '("hellmet-roblox") 'empty + 'empty + "HELLMET Wiki" + "https://hellmet.miraheze.org/wiki/Main_Page" + "https://static.miraheze.org/hellmetwiki/thumb/c/ce/Hellmet_Wiki_Logo.png/135px-Hellmet_Wiki_Logo.png" + (λ (props) + `())) + ;; fandom wikinames * empty * empty * Name * Home Page (extwiki^ '("aether") 'empty 'empty "Aether Wiki" "https://aether.wiki.gg/wiki/Aether_Wiki" #f #f) (extwiki^ '("before-darkness-falls") 'empty 'empty "Before Darkness Falls Wiki" "https://beforedarknessfalls.wiki.gg/wiki/Before_Darkness_Falls_Wiki" #f #f) From 8db91d5e32c1a8671d4d7537e381611e5732e8f9 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Sun, 14 Jul 2024 23:38:30 +1200 Subject: [PATCH 08/10] Add Rainverse wiki redirect --- src/extwiki-data.rkt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/extwiki-data.rkt b/src/extwiki-data.rkt index 4a2cca2..e283dfb 100644 --- a/src/extwiki-data.rkt +++ b/src/extwiki-data.rkt @@ -85,6 +85,13 @@ ("Discussion on Reddit" . "https://old.reddit.com/r/doctorwho/comments/1azxmrl/tardis_wiki_has_regenerated/")) (λ (props) '())) + 'Rainverse + (extwiki-group^ + "Rainverse" + '(("Forking announcement" . "https://transfem.social/notes/9qsqdkmqi78e01bh")) + (λ (props) + '())) + 'empty (extwiki-group^ "Misc" @@ -515,6 +522,17 @@ (λ (props) `())) + (extwiki^ + '("rain-web-comic") 'default + 'empty + "Rainverse Wiki" + "https://rainverse.wiki/wiki/Main_Page" + "https://static.miraheze.org/rainversewiki/2/2c/Rain_comic_cover.png" + (λ (props) + `((p "We have a newly-migrated Rainverse Wiki which escaped from Fandom! Rain is the comic that helped me figure out my gender, so I am really glad to have a wiki on a non-evil host.") + (p "Please stop using the abandoned copy of Rain Wiki on Fandom. Fandom is still \"training\" a generator which adds procedurally-generated bullshit to articles, with no way for users to remove or correct it, and they're demanding volunteer wiki admins waste time \"vetting\" the procedurally-generated BS for accuracy. As Jocelyn herself said, \"fuck Fandom forever.\"") + (p "If you are interested, please add more articles related to other Rainverse stories.")))) + ;; fandom wikinames * empty * empty * Name * Home Page (extwiki^ '("aether") 'empty 'empty "Aether Wiki" "https://aether.wiki.gg/wiki/Aether_Wiki" #f #f) (extwiki^ '("before-darkness-falls") 'empty 'empty "Before Darkness Falls Wiki" "https://beforedarknessfalls.wiki.gg/wiki/Before_Darkness_Falls_Wiki" #f #f) From 97c4e54f38558f67abb1a1cc5baec23fa9cc0b21 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Sat, 10 Aug 2024 15:04:13 +1200 Subject: [PATCH 09/10] Fix Tardis Wiki metadata --- src/extwiki-data.rkt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extwiki-data.rkt b/src/extwiki-data.rkt index e283dfb..a8ee159 100644 --- a/src/extwiki-data.rkt +++ b/src/extwiki-data.rkt @@ -443,9 +443,9 @@ (extwiki^ '("tardis") 'default 'Tardis - "Tardis Data Core" + "TARDIS Wiki" "https://tardis.wiki/wiki/Doctor_Who_Wiki" - "https://tardis.wiki/images/Tardis_images/e/e6/Site-logo.png" + "https://tardis.wiki/w/images/Tardis_Images/e/e6/Site-logo.png" (λ (props) `())) From 0c0b970a957b24b605f6871ee59457d1cd069db5 Mon Sep 17 00:00:00 2001 From: blankie Date: Mon, 6 Nov 2023 20:20:00 +1100 Subject: [PATCH 10/10] Hide slideshows --- static/main.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/main.css b/static/main.css index 5b3e7e2..f8ef78d 100644 --- a/static/main.css +++ b/static/main.css @@ -218,6 +218,13 @@ a.ext-audiobutton { /* see hearthstone/wiki/Diablo_(Duels_hero) */ display: inline !important; } +/* hide slideshows since they're broken + * example: ben10/wiki/Celestialsapien_(Classic)#Powers_and_Abilities + */ +.wikia-slideshow { + display: none; +} + /* animated slots */ #mw-content-text .animated > :not(.animated-active), #mw-content-text .animated > .animated-subframe > :not(.animated-active) { display: inline-block;