Fixed misc. problems with pull request.

This commit is contained in:
Brian McSweeney 2012-06-15 14:20:20 -04:00
parent 6c26e7dd53
commit 8b07e65eb4
3 changed files with 15 additions and 13 deletions

View File

@ -65,6 +65,7 @@
* Seiba - chrome quick reply focusing
* herpaderpderp - recaptcha fixes
* WakiMiko - recaptcha tab order http://userscripts.org/scripts/show/82657
* btmcsweeney - allow users to specify text for sauce links
*
* All the people who've taken the time to write bug reports.
*
@ -151,7 +152,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;show:Upload to imgur', '#http://omploader.org/upload?url1=$2;show:Upload to omploader', '# "View Same" in archives:', '#http://archive.foolz.us/search/image/$3/;show:View same on foolz', '#http://archive.foolz.us/$4/search/image/$3/;show:View same on foolz /$4/', '#https://archive.installgentoo.net/$4/image/$3;show:View same on installgentoo /$4/'].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;text:Upload to imgur', '#http://omploader.org/upload?url1=$2;text:Upload to omploader', '# "View Same" in archives:', '#http://archive.foolz.us/search/image/$3/;text:View same on foolz', '#http://archive.foolz.us/$4/search/image/$3/;text:View same on foolz /$4/', '#https://archive.installgentoo.net/$4/image/$3;text:View same on installgentoo /$4/'].join('\n'),
time: '%m/%d/%y(%a)%H:%M',
backlink: '>>%id',
fileInfo: '%l (%p%s, %r)',
@ -2239,7 +2240,7 @@
<div>\
<div class=warning><code>Sauce</code> is disabled.</div>\
Lines starting with a <code>#</code> will be ignored.<br>\
You can specify a certain display text by appending ";show:[text]" to the url.\
You can specify a certain display text by appending ";text:[text]" to the url.\
<ul>These parameters will be replaced by their corresponding values:\
<li>$1: Thumbnail url.</li>\
<li>$2: Full image url.</li>\
@ -2768,7 +2769,7 @@
return Main.callbacks.push(this.node);
},
createSauceLink: function(link) {
var domain, el, href;
var domain, el, href, m;
link = link.replace(/(\$\d)/g, function(parameter) {
switch (parameter) {
case '$1':
@ -2781,8 +2782,8 @@
return g.BOARD;
}
});
domain = link.match(/;show:(.+)$/) ? link.match(/;show:(.+)$/)[1] : link.match(/(\w+)\.\w+\//)[1];
href = link.match(/;show:(.+)$/) ? link.match(/^(.+);show:.+$/)[1] : link;
domain = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1];
href = link.replace(/;text:.+$/, '');
href = Function('img', "return '" + href + "'");
el = $.el('a', {
target: '_blank',

View File

@ -72,6 +72,7 @@ HEADER = """
* Seiba - chrome quick reply focusing
* herpaderpderp - recaptcha fixes
* WakiMiko - recaptcha tab order http://userscripts.org/scripts/show/82657
* btmcsweeney - allow users to specify text for sauce links
*
* All the people who've taken the time to write bug reports.
*

View File

@ -107,12 +107,12 @@ Config =
'#http://3d.iqdb.org/?url=$1'
'#http://regex.info/exif.cgi?imgurl=$2'
'# uploaders:'
'#http://imgur.com/upload?url=$2;show:Upload to imgur'
'#http://omploader.org/upload?url1=$2;show:Upload to omploader'
'#http://imgur.com/upload?url=$2;text:Upload to imgur'
'#http://omploader.org/upload?url1=$2;text:Upload to omploader'
'# "View Same" in archives:'
'#http://archive.foolz.us/search/image/$3/;show:View same on foolz'
'#http://archive.foolz.us/$4/search/image/$3/;show:View same on foolz /$4/'
'#https://archive.installgentoo.net/$4/image/$3;show:View same on installgentoo /$4/'
'#http://archive.foolz.us/search/image/$3/;text:View same on foolz'
'#http://archive.foolz.us/$4/search/image/$3/;text:View same on foolz /$4/'
'#https://archive.installgentoo.net/$4/image/$3;text:View same on installgentoo /$4/'
].join '\n'
time: '%m/%d/%y(%a)%H:%M'
backlink: '>>%id'
@ -1708,7 +1708,7 @@ Options =
<div>
<div class=warning><code>Sauce</code> is disabled.</div>
Lines starting with a <code>#</code> will be ignored.<br>
You can specify a certain display text by appending ";show:[text]" to the url.
You can specify a certain display text by appending ";text:[text]" to the url.
<ul>These parameters will be replaced by their corresponding values:
<li>$1: Thumbnail url.</li>
<li>$2: Full image url.</li>
@ -2166,8 +2166,8 @@ Sauce =
"' + encodeURIComponent(img.firstChild.dataset.md5) + '"
when '$4'
g.BOARD
domain = if link.match(/;show:(.+)$/) then link.match(/;show:(.+)$/)[1] else link.match(/(\w+)\.\w+\//)[1]
href = if link.match(/;show:(.+)$/) then link.match(/^(.+);show:.+$/)[1] else link
domain = if m = link.match(/;text:(.+)$/) then m[1] else link.match(/(\w+)\.\w+\//)[1]
href = link.replace /;text:.+$/, ''
href = Function 'img', "return '#{href}'"
el = $.el 'a',
target: '_blank'