From d0ec997182baacff8efc7b13a6c8568259cfd197 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 11 Jul 2012 16:01:05 +0200 Subject: [PATCH] Add /wsg/ archive redirection for threads and images. --- 4chan_x.user.js | 4 +++- changelog | 2 ++ script.coffee | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index c0b494d22..a2d812795 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2882,7 +2882,6 @@ if (state !== 'visible') { return; } - $.log(state); Updater.unsuccessfulFetchCount = 0; if (Updater.timer.textContent < -Conf['Interval']) { return Updater.timer.textContent = -Updater.getInterval(); @@ -4376,6 +4375,7 @@ case 'sp': case 'tg': case 'vg': + case 'wsg': return "//archive.foolz.us/" + board + "/full_image/" + filename; case 'u': return "//nsfw.foolz.us/" + board + "/full_image/" + filename; @@ -4392,6 +4392,7 @@ case 'tv': case 'v': case 'vg': + case 'wsg': case 'dev': case 'foolz': return "//archive.foolz.us/api/chan/post/board/" + board + "/num/" + postID + "/format/json"; @@ -4416,6 +4417,7 @@ case 'tv': case 'v': case 'vg': + case 'wsg': case 'dev': case 'foolz': url = "//archive.foolz.us/" + path + "/"; diff --git a/changelog b/changelog index b53d23a3c..cd4a949d4 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + Add /wsg/ archive redirection. 2.34.0 - Mayhem diff --git a/script.coffee b/script.coffee index 254c92f04..d7bf4a74c 100644 --- a/script.coffee +++ b/script.coffee @@ -3479,7 +3479,7 @@ Redirect = image: (board, filename) -> # Do not use g.BOARD, the image url can originate from a cross-quote. switch board - when 'a', 'jp', 'm', 'sp', 'tg', 'vg' + when 'a', 'jp', 'm', 'sp', 'tg', 'vg', 'wsg' "//archive.foolz.us/#{board}/full_image/#{filename}" when 'u' "//nsfw.foolz.us/#{board}/full_image/#{filename}" @@ -3492,7 +3492,7 @@ Redirect = # "https://md401.homelinux.net/4chan/cgi-board.pl/#{board}/full_image/#{filename}" post: (board, postID) -> switch board - when 'a', 'co', 'jp', 'm', 'sp', 'tg', 'tv', 'v', 'vg', 'dev', 'foolz' + when 'a', 'co', 'jp', 'm', 'sp', 'tg', 'tv', 'v', 'vg', 'wsg', 'dev', 'foolz' "//archive.foolz.us/api/chan/post/board/#{board}/num/#{postID}/format/json" when 'u', 'kuku' "//nsfw.foolz.us/api/chan/post/board/#{board}/num/#{postID}/format/json" @@ -3505,7 +3505,7 @@ Redirect = else "#{board}/post/#{postID}" switch board - when 'a', 'co', 'jp', 'm', 'sp', 'tg', 'tv', 'v', 'vg', 'dev', 'foolz' + when 'a', 'co', 'jp', 'm', 'sp', 'tg', 'tv', 'v', 'vg', 'wsg', 'dev', 'foolz' url = "//archive.foolz.us/#{path}/" if threadID and postID url += "##{postID}"