diff --git a/4chan_x.user.js b/4chan_x.user.js
index 7612e9c4b..9ff5fe3be 100644
--- a/4chan_x.user.js
+++ b/4chan_x.user.js
@@ -148,7 +148,7 @@
filesize: [''].join('\n'),
md5: [''].join('\n')
},
- sauces: ['http://iqdb.org/?url=$1', 'http://www.google.com/searchbyimage?image_url=$1', '#http://tineye.com/search?url=$1', '#http://saucenao.com/search.php?db=999&url=$1', '#http://3d.iqdb.org/?url=$1', '#http://regex.info/exif.cgi?imgurl=$2', '# uploaders:', '#http://imgur.com/upload?url=$2', '#http://omploader.org/upload?url1=$2', '# "View Same" in archives:', '#http://archive.foolz.us/a/image/$3/', '#http://archive.installgentoo.net/g/image/$3'].join('\n'),
+ sauces: ['http://iqdb.org/?url=$1', 'http://www.google.com/searchbyimage?image_url=$1', '#http://tineye.com/search?url=$1', '#http://saucenao.com/search.php?db=999&url=$1', '#http://3d.iqdb.org/?url=$1', '#http://regex.info/exif.cgi?imgurl=$2', '# uploaders:', '#http://imgur.com/upload?url=$2', '#http://omploader.org/upload?url1=$2', '# "View Same" in archives:', '#http://archive.foolz.us/$4/image/$3/', '#http://archive.installgentoo.net/$4/image/$3'].join('\n'),
time: '%m/%d/%y(%a)%H:%M',
backlink: '>>%id',
fileInfoR: '%l, %s, %r',
@@ -2125,10 +2125,11 @@
\
Sauce is disabled.
\
Lines starting with a
# will be ignored.\
-
These variables will be replaced by the corresponding url:\
- - $1: Thumbnail.
\
- - $2: Full image.
\
+ These parameters will be replaced by their corresponding values:\
+ - $1: Thumbnail url.
\
+ - $2: Full image url.
\
- $3: MD5 hash.
\
+ - $4: Current board.
\
\
\
\
@@ -2771,14 +2772,16 @@
funk: function(link) {
var domain, href;
domain = link.match(/(\w+)\.\w+\//)[1];
- href = link.replace(/(\$\d)/, function(fragment) {
- switch (fragment) {
+ href = link.replace(/(\$\d)/g, function(parameter) {
+ switch (parameter) {
case '$1':
return "http://thumbs.4chan.org' + img.pathname.replace(/src(\\/\\d+).+$/, 'thumb$1s.jpg') + '";
case '$2':
return "' + img.href + '";
case '$3':
return "' + img.firstChild.getAttribute('md5').replace(/\=*$/, '') + '";
+ case '$4':
+ return g.BOARD;
}
});
href = Function('img', "return '" + href + "'");
diff --git a/changelog b/changelog
index 8e8bf2bff..9cf7de130 100644
--- a/changelog
+++ b/changelog
@@ -10,6 +10,7 @@ master
Fix stubs if poster has unique ID.
- Mayhem
You can now filter or highlight admin/mod posts.
+ New sauce parameter. $4: Current board.
2.27.1
- Mayhem
diff --git a/script.coffee b/script.coffee
index 01547fd3f..f5a6d48ea 100644
--- a/script.coffee
+++ b/script.coffee
@@ -104,8 +104,8 @@ config =
'#http://imgur.com/upload?url=$2'
'#http://omploader.org/upload?url1=$2'
'# "View Same" in archives:'
- '#http://archive.foolz.us/a/image/$3/'
- '#http://archive.installgentoo.net/g/image/$3'
+ '#http://archive.foolz.us/$4/image/$3/'
+ '#http://archive.installgentoo.net/$4/image/$3'
].join '\n'
time: '%m/%d/%y(%a)%H:%M'
backlink: '>>%id'
@@ -1723,10 +1723,11 @@ options =
Sauce is disabled.
Lines starting with a
# will be ignored.
-
These variables will be replaced by the corresponding url:
- - $1: Thumbnail.
- - $2: Full image.
+ These parameters will be replaced by their corresponding values:
+ - $1: Thumbnail url.
+ - $2: Full image url.
- $3: MD5 hash.
+ - $4: Current board.
@@ -2282,14 +2283,16 @@ sauce =
funk: (link) ->
domain = link.match(/(\w+)\.\w+\//)[1]
- href = link.replace /(\$\d)/, (fragment) ->
- switch fragment
+ href = link.replace /(\$\d)/g, (parameter) ->
+ switch parameter
when '$1'
"http://thumbs.4chan.org' + img.pathname.replace(/src(\\/\\d+).+$/, 'thumb$1s.jpg') + '"
when '$2'
"' + img.href + '"
when '$3'
"' + img.firstChild.getAttribute('md5').replace(/\=*$/, '') + '"
+ when '$4'
+ g.BOARD
href = Function 'img', "return '#{href}'"
(img) ->
$.el 'a',