Redirect changes.

I am not going to lie. The very idea of wrapping a switch in a
function to make it return a value just so you can do
`var = switch` irritates the living hell out of me.
This commit is contained in:
Zixaphir 2013-05-02 01:18:25 -07:00
parent 6cba0802aa
commit 1151591472
5 changed files with 116 additions and 170 deletions

View File

@ -1,5 +1,5 @@
/*
* 4chan X - Version 1.1.8 - 2013-05-01
* 4chan X - Version 1.1.8 - 2013-05-02
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

View File

@ -18,7 +18,7 @@
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
// ==/UserScript==
/*
* 4chan X - Version 1.1.8 - 2013-05-01
* 4chan X - Version 1.1.8 - 2013-05-02
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -7546,52 +7546,33 @@
return Conf['archivers'] = archivers;
});
},
imageArchives: (function() {
var o;
o = {
a: "//archive.foolz.us/",
ck: "//fuuka.warosu.org/",
an: "http://archive.heinessen.com/",
cgl: "//rbt.asia/",
c: "//archive.nyafuu.org/",
d: "//loveisover.me/",
hr: "http://archive.4plebs.org/",
u: "//nsfw.foolz.us/",
po: "//archive.thedarkcave.org/",
vg: "http://nth.pensivenonsen.se/",
c: "//archive.nyafuu.org/"
};
o.gd = o.jp = o.m = o.q = o.tg = o.vp = o.vr = o.wsg = o.a;
o.fa = o.lit = o.s4s = o.ck;
o.k = o.toy = o.x = o.an;
o.g = o.mu = o.cgl;
o.w = o.wg = o.c;
o.h = o.v = o.d;
o.tv = o.hr;
return o;
})(),
image: function(boardID, filename) {
switch (boardID) {
case 'a':
case 'gd':
case 'jp':
case 'm':
case 'q':
case 'tg':
case 'vp':
case 'vr':
case 'wsg':
return "//archive.foolz.us/" + boardID + "/full_image/" + filename;
case 'u':
return "//nsfw.foolz.us/" + boardID + "/full_image/" + filename;
case 'po':
return "//archive.thedarkcave.org/" + boardID + "/full_image/" + filename;
case 'hr':
case 'tv':
return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename;
case 'c':
case 'w':
case 'wg':
return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename;
case 'd':
case 'h':
case 'v':
return "//loveisover.me/" + boardID + "/full_image/" + filename;
case 'vg':
return "http://nth.pensivenonsen.se/" + boardID + "/full_image/" + filename;
case 'ck':
case 'fa':
case 'lit':
case 's4s':
return "//fuuka.warosu.org/" + boardID + "/full_image/" + filename;
case 'cgl':
case 'g':
case 'mu':
return "//rbt.asia/" + boardID + "/full_image/" + filename;
case 'an':
case 'k':
case 'toy':
case 'x':
return "http://archive.heinessen.com/" + boardID + "/full_image/" + filename;
case 'c':
return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename;
}
return "" + Redirect.imageArchives[boardID] + boardID + "/full_image/" + filename;
},
post: function(boardID, postID) {
var archive, name, _base, _ref;
@ -7678,7 +7659,7 @@
},
'Warosu': {
base: '//fuuka.warosu.org',
boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'],
boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg', 'vr'],
type: 'fuuka'
},
'InstallGentoo': {
@ -7688,7 +7669,7 @@
},
'RebeccaBlackTech': {
base: '//rbt.asia',
boards: ['an', 'cgl', 'g', 'mu', 'w'],
boards: ['cgl', 'g', 'mu', 'w'],
type: 'fuuka_mail'
},
'Heinessen': {

View File

@ -18,7 +18,7 @@
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
// ==/UserScript==
/*
* 4chan X - Version 1.1.8 - 2013-05-01
* 4chan X - Version 1.1.8 - 2013-05-02
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -7567,52 +7567,33 @@
return Conf['archivers'] = archivers;
});
},
imageArchives: (function() {
var o;
o = {
a: "//archive.foolz.us/",
ck: "//fuuka.warosu.org/",
an: "http://archive.heinessen.com/",
cgl: "//rbt.asia/",
c: "//archive.nyafuu.org/",
d: "//loveisover.me/",
hr: "http://archive.4plebs.org/",
u: "//nsfw.foolz.us/",
po: "//archive.thedarkcave.org/",
vg: "http://nth.pensivenonsen.se/",
c: "//archive.nyafuu.org/"
};
o.gd = o.jp = o.m = o.q = o.tg = o.vp = o.vr = o.wsg = o.a;
o.fa = o.lit = o.s4s = o.ck;
o.k = o.toy = o.x = o.an;
o.g = o.mu = o.cgl;
o.w = o.wg = o.c;
o.h = o.v = o.d;
o.tv = o.hr;
return o;
})(),
image: function(boardID, filename) {
switch (boardID) {
case 'a':
case 'gd':
case 'jp':
case 'm':
case 'q':
case 'tg':
case 'vp':
case 'vr':
case 'wsg':
return "//archive.foolz.us/" + boardID + "/full_image/" + filename;
case 'u':
return "//nsfw.foolz.us/" + boardID + "/full_image/" + filename;
case 'po':
return "//archive.thedarkcave.org/" + boardID + "/full_image/" + filename;
case 'hr':
case 'tv':
return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename;
case 'c':
case 'w':
case 'wg':
return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename;
case 'd':
case 'h':
case 'v':
return "//loveisover.me/" + boardID + "/full_image/" + filename;
case 'vg':
return "http://nth.pensivenonsen.se/" + boardID + "/full_image/" + filename;
case 'ck':
case 'fa':
case 'lit':
case 's4s':
return "//fuuka.warosu.org/" + boardID + "/full_image/" + filename;
case 'cgl':
case 'g':
case 'mu':
return "//rbt.asia/" + boardID + "/full_image/" + filename;
case 'an':
case 'k':
case 'toy':
case 'x':
return "http://archive.heinessen.com/" + boardID + "/full_image/" + filename;
case 'c':
return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename;
}
return "" + Redirect.imageArchives[boardID] + boardID + "/full_image/" + filename;
},
post: function(boardID, postID) {
var archive, name, _base, _ref;
@ -7699,7 +7680,7 @@
},
'Warosu': {
base: '//fuuka.warosu.org',
boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'],
boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg', 'vr'],
type: 'fuuka'
},
'InstallGentoo': {
@ -7709,7 +7690,7 @@
},
'RebeccaBlackTech': {
base: '//rbt.asia',
boards: ['an', 'cgl', 'g', 'mu', 'w'],
boards: ['cgl', 'g', 'mu', 'w'],
type: 'fuuka_mail'
},
'Heinessen': {

View File

@ -1,5 +1,5 @@
/*
* 4chan X - Version 1.1.8 - 2013-05-01
* 4chan X - Version 1.1.8 - 2013-05-02
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -7550,52 +7550,33 @@
return Conf['archivers'] = archivers;
});
},
imageArchives: (function() {
var o;
o = {
a: "//archive.foolz.us/",
ck: "//fuuka.warosu.org/",
an: "http://archive.heinessen.com/",
cgl: "//rbt.asia/",
c: "//archive.nyafuu.org/",
d: "//loveisover.me/",
hr: "http://archive.4plebs.org/",
u: "//nsfw.foolz.us/",
po: "//archive.thedarkcave.org/",
vg: "http://nth.pensivenonsen.se/",
c: "//archive.nyafuu.org/"
};
o.gd = o.jp = o.m = o.q = o.tg = o.vp = o.vr = o.wsg = o.a;
o.fa = o.lit = o.s4s = o.ck;
o.k = o.toy = o.x = o.an;
o.g = o.mu = o.cgl;
o.w = o.wg = o.c;
o.h = o.v = o.d;
o.tv = o.hr;
return o;
})(),
image: function(boardID, filename) {
switch (boardID) {
case 'a':
case 'gd':
case 'jp':
case 'm':
case 'q':
case 'tg':
case 'vp':
case 'vr':
case 'wsg':
return "//archive.foolz.us/" + boardID + "/full_image/" + filename;
case 'u':
return "//nsfw.foolz.us/" + boardID + "/full_image/" + filename;
case 'po':
return "//archive.thedarkcave.org/" + boardID + "/full_image/" + filename;
case 'hr':
case 'tv':
return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename;
case 'c':
case 'w':
case 'wg':
return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename;
case 'd':
case 'h':
case 'v':
return "//loveisover.me/" + boardID + "/full_image/" + filename;
case 'vg':
return "http://nth.pensivenonsen.se/" + boardID + "/full_image/" + filename;
case 'ck':
case 'fa':
case 'lit':
case 's4s':
return "//fuuka.warosu.org/" + boardID + "/full_image/" + filename;
case 'cgl':
case 'g':
case 'mu':
return "//rbt.asia/" + boardID + "/full_image/" + filename;
case 'an':
case 'k':
case 'toy':
case 'x':
return "http://archive.heinessen.com/" + boardID + "/full_image/" + filename;
case 'c':
return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename;
}
return "" + Redirect.imageArchives[boardID] + boardID + "/full_image/" + filename;
},
post: function(boardID, postID) {
var archive, name, _base, _ref;
@ -7682,7 +7663,7 @@
},
'Warosu': {
base: '//fuuka.warosu.org',
boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'],
boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg', 'vr'],
type: 'fuuka'
},
'InstallGentoo': {
@ -7692,7 +7673,7 @@
},
'RebeccaBlackTech': {
base: '//rbt.asia',
boards: ['an', 'cgl', 'g', 'mu', 'w'],
boards: ['cgl', 'g', 'mu', 'w'],
type: 'fuuka_mail'
},
'Heinessen': {

View File

@ -6,31 +6,34 @@ Redirect =
$.get 'archivers', {}, ({archivers}) ->
Conf['archivers'] = archivers
imageArchives: do ->
o =
a: "//archive.foolz.us/"
ck: "//fuuka.warosu.org/"
an: "http://archive.heinessen.com/"
cgl: "//rbt.asia/"
c: "//archive.nyafuu.org/"
d: "//loveisover.me/"
hr: "http://archive.4plebs.org/"
u: "//nsfw.foolz.us/"
po: "//archive.thedarkcave.org/"
vg: "http://nth.pensivenonsen.se/"
c: "//archive.nyafuu.org/"
o.gd = o.jp = o.m = o.q = o.tg = o.vp = o.vr = o.wsg = o.a
o.fa = o.lit = o.s4s = o.ck
o.k = o.toy = o.x = o.an
o.g = o.mu = o.cgl
o.w = o.wg = o.c
o.h = o.v = o.d
o.tv = o.hr
return o
image: (boardID, filename) ->
# Do not use g.BOARD, the image url can originate from a cross-quote.
switch boardID
when 'a', 'gd', 'jp', 'm', 'q', 'tg', 'vp', 'vr', 'wsg'
"//archive.foolz.us/#{boardID}/full_image/#{filename}"
when 'u'
"//nsfw.foolz.us/#{boardID}/full_image/#{filename}"
when 'po'
"//archive.thedarkcave.org/#{boardID}/full_image/#{filename}"
when 'hr', 'tv'
"http://archive.4plebs.org/#{boardID}/full_image/#{filename}"
when 'c', 'w', 'wg'
"//archive.nyafuu.org/#{boardID}/full_image/#{filename}"
when 'd', 'h', 'v'
"//loveisover.me/#{boardID}/full_image/#{filename}"
when 'vg'
"http://nth.pensivenonsen.se/#{boardID}/full_image/#{filename}"
when 'ck', 'fa', 'lit', 's4s'
"//fuuka.warosu.org/#{boardID}/full_image/#{filename}"
when 'cgl', 'g', 'mu'
"//rbt.asia/#{boardID}/full_image/#{filename}"
when 'an', 'k', 'toy', 'x'
"http://archive.heinessen.com/#{boardID}/full_image/#{filename}"
when 'c'
"//archive.nyafuu.org/#{boardID}/full_image/#{filename}"
# Fuck. Your. Shit.
"#{Redirect.imageArchives[boardID]}#{boardID}/full_image/#{filename}"
post: (boardID, postID) ->
unless Redirect.post[boardID]?
@ -98,7 +101,7 @@ Redirect =
type: 'foolfuuka'
'Warosu':
base: '//fuuka.warosu.org'
boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg']
boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg', 'vr']
type: 'fuuka'
'InstallGentoo':
base: '//archive.installgentoo.net'
@ -106,7 +109,7 @@ Redirect =
type: 'fuuka'
'RebeccaBlackTech':
base: '//rbt.asia'
boards: ['an', 'cgl', 'g', 'mu', 'w']
boards: ['cgl', 'g', 'mu', 'w']
type: 'fuuka_mail'
'Heinessen':
base: 'http://archive.heinessen.com'