diff --git a/4chan_x.user.js b/4chan_x.user.js index 1b67152e6..f8396b813 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan x -// @version 2.33.4 +// @version 2.33.5 // @namespace aeosynth // @description Adds various features. // @copyright 2009-2011 James Campos @@ -23,7 +23,7 @@ * Copyright (c) 2009-2011 James Campos * Copyright (c) 2012 Nicolas Stepien * http://mayhemydg.github.com/4chan-x/ - * 4chan X 2.33.4 + * 4chan X 2.33.5 * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -4216,10 +4216,12 @@ case 'a': case 'jp': case 'm': + case 'sp': case 'tg': - case 'u': case 'vg': return "//archive.foolz.us/" + board + "/full_image/" + filename; + case 'u': + return "//nsfw.foolz.us/" + board + "/full_image/" + filename; } }, post: function(board, postID) { @@ -4228,15 +4230,17 @@ case 'co': case 'jp': case 'm': + case 'sp': case 'tg': case 'tv': - case 'u': case 'v': case 'vg': case 'dev': case 'foolz': - case 'kuku': return "//archive.foolz.us/api/chan/post/board/" + board + "/num/" + postID + "/format/json"; + case 'u': + case 'kuku': + return "//nsfw.foolz.us/api/chan/post/board/" + board + "/num/" + postID + "/format/json"; } }, thread: function(board, threadID, postID) { @@ -4250,19 +4254,25 @@ case 'co': case 'jp': case 'm': + case 'sp': case 'tg': case 'tv': - case 'u': case 'v': case 'vg': case 'dev': case 'foolz': - case 'kuku': url = "//archive.foolz.us/" + path + "/"; if (threadID && postID) { url += "#" + postID; } break; + case 'u': + case 'kuku': + url = "//nsfw.foolz.us/" + path + "/"; + if (threadID && postID) { + url += "#" + postID; + } + break; case 'lit': url = "//fuuka.warosu.org/" + path; if (threadID && postID) { @@ -4936,7 +4946,7 @@ return $.globalEval(("(" + code + ")()").replace('_id_', bq.id)); }, namespace: '4chan_x.', - version: '2.33.4', + version: '2.33.5', callbacks: [], css: '\ /* dialog styling */\ diff --git a/Cakefile b/Cakefile index b5fb8a767..92703dfe7 100644 --- a/Cakefile +++ b/Cakefile @@ -2,7 +2,7 @@ {exec} = require 'child_process' fs = require 'fs' -VERSION = '2.33.4' +VERSION = '2.33.5' HEADER = """ // ==UserScript== diff --git a/changelog b/changelog index 1723e3b25..3b0e81854 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,9 @@ master +2.33.5 +- Mayhem + Add /sp/ archive redirection. + 2.33.4 - Mayhem Fix QR with the new captcha loading method. diff --git a/latest.js b/latest.js index d8e552e0c..59d319320 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'2.33.4'},'*') \ No newline at end of file +postMessage({version:'2.33.5'},'*') \ No newline at end of file diff --git a/script.coffee b/script.coffee index 8ed4fff4a..ad4c7f120 100644 --- a/script.coffee +++ b/script.coffee @@ -3317,8 +3317,10 @@ Redirect = image: (board, filename) -> # Do not use g.BOARD, the image url can originate from a cross-quote. switch board - when 'a', 'jp', 'm', 'tg', 'u', 'vg' + when 'a', 'jp', 'm', 'sp', 'tg', 'vg' "//archive.foolz.us/#{board}/full_image/#{filename}" + when 'u' + "//nsfw.foolz.us/#{board}/full_image/#{filename}" # these will work whenever https://github.com/eksopl/fuuka/issues/23 is done # when 'cgl', 'g', 'w' # "//archive.rebeccablacktech.com/#{board}/full_image/#{filename}" @@ -3328,8 +3330,10 @@ Redirect = # "https://md401.homelinux.net/4chan/cgi-board.pl/#{board}/full_image/#{filename}" post: (board, postID) -> switch board - when 'a', 'co', 'jp', 'm', 'tg', 'tv', 'u', 'v', 'vg', 'dev', 'foolz', 'kuku' + when 'a', 'co', 'jp', 'm', 'sp', 'tg', 'tv', 'v', 'vg', '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" thread: (board, threadID, postID) -> # keep the number only if the location.hash was sent f.e. postID = postID.match(/\d+/)[0] if postID @@ -3339,10 +3343,14 @@ Redirect = else "#{board}/post/#{postID}" switch board - when 'a', 'co', 'jp', 'm', 'tg', 'tv', 'u', 'v', 'vg', 'dev', 'foolz', 'kuku' + when 'a', 'co', 'jp', 'm', 'sp', 'tg', 'tv', 'v', 'vg', 'dev', 'foolz' url = "//archive.foolz.us/#{path}/" if threadID and postID url += "##{postID}" + when 'u', 'kuku' + url = "//nsfw.foolz.us/#{path}/" + if threadID and postID + url += "##{postID}" when 'lit' url = "//fuuka.warosu.org/#{path}" if threadID and postID @@ -3831,7 +3839,7 @@ Main = $.globalEval "(#{code})()".replace '_id_', bq.id namespace: '4chan_x.' - version: '2.33.4' + version: '2.33.5' callbacks: [] css: ' /* dialog styling */