use thumbs for sauce, close #327

This commit is contained in:
James Campos 2011-11-13 09:22:24 -08:00
parent 80bf28e673
commit fdc0086958
2 changed files with 6 additions and 7 deletions

View File

@ -126,7 +126,7 @@
file: '',
md5: ''
},
flavors: ['http://iqdb.org/?url=', 'http://google.com/searchbyimage?image_url=', '#http://regex.info/exif.cgi?url=', '#http://tineye.com/search?url=', '#http://saucenao.com/search.php?db=999&url=', '#http://imgur.com/upload?url='].join('\n'),
flavors: ['http://iqdb.org/?url=', 'http://google.com/searchbyimage?image_url=', '#http://tineye.com/search?url=', '#http://saucenao.com/search.php?db=999&url=', '#http://imgur.com/upload?url='].join('\n'),
time: '%m/%d/%y(%a)%H:%M',
backlink: '>>%id',
hotkeys: {
@ -2170,11 +2170,11 @@
return prefix.match(/(\w+)\./)[1];
});
return g.callbacks.push(function(root) {
var i, link, prefix, span, suffix, _len, _ref, _results;
if (root.className === 'inline' || !(span = $('.filesize', root))) {
var i, link, prefix, suffix, thumb, _len, _ref, _results;
if (root.className === 'inline' || !(thumb = $('img[md5]', root))) {
return;
}
suffix = $('a', span).href;
suffix = thumb.src;
_ref = sauce.prefixes;
_results = [];
for (i = 0, _len = _ref.length; i < _len; i++) {

View File

@ -55,7 +55,6 @@ config =
flavors: [
'http://iqdb.org/?url='
'http://google.com/searchbyimage?image_url='
'#http://regex.info/exif.cgi?url='
'#http://tineye.com/search?url='
'#http://saucenao.com/search.php?db=999&url='
'#http://imgur.com/upload?url='
@ -1651,8 +1650,8 @@ sauce =
sauce.prefixes = conf['flavors'].match /^[^#].+$/gm
sauce.names = sauce.prefixes.map (prefix) -> prefix.match(/(\w+)\./)[1]
g.callbacks.push (root) ->
return if root.className is 'inline' or not span = $ '.filesize', root
suffix = $('a', span).href
return if root.className is 'inline' or not thumb = $ 'img[md5]', root
suffix = thumb.src
for prefix, i in sauce.prefixes
link = $.el 'a',
textContent: sauce.names[i]