We most likely will only use the anchor of the thumbnail, not the thumbnail itself. This should be quite faster.

This commit is contained in:
Nicolas Stepien 2012-02-12 19:12:53 +01:00
parent b9e02c73de
commit f2a673eef1
2 changed files with 8 additions and 8 deletions

View File

@ -2652,11 +2652,11 @@
href = link.replace(/(\$\d)/, function(fragment) {
switch (fragment) {
case '$1':
return "http://thumbs.4chan.org' + img.parentNode.pathname.replace(/src(\\/\\d+).+$/, 'thumb$1s.jpg') + '";
return "http://thumbs.4chan.org' + img.pathname.replace(/src(\\/\\d+).+$/, 'thumb$1s.jpg') + '";
case '$2':
return "' + img.parentNode.href + '";
return "' + img.href + '";
case '$3':
return "' + img.getAttribute('md5').replace(/\=*$/, '') + '";
return "' + img.firstChild.getAttribute('md5').replace(/\=*$/, '') + '";
}
});
href = Function('img', "return '" + href + "'");
@ -2671,7 +2671,7 @@
node: function(root) {
var img, link, span, _i, _len, _ref;
if (root.className === 'inline' || !(span = $('.filesize', root))) return;
img = $('img', root);
img = span.nextElementSibling.nextElementSibling;
_ref = sauce.links;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
link = _ref[_i];

View File

@ -2102,11 +2102,11 @@ sauce =
href = link.replace /(\$\d)/, (fragment) ->
switch fragment
when '$1'
"http://thumbs.4chan.org' + img.parentNode.pathname.replace(/src(\\/\\d+).+$/, 'thumb$1s.jpg') + '"
"http://thumbs.4chan.org' + img.pathname.replace(/src(\\/\\d+).+$/, 'thumb$1s.jpg') + '"
when '$2'
"' + img.parentNode.href + '"
"' + img.href + '"
when '$3'
"' + img.getAttribute('md5').replace(/\=*$/, '') + '"
"' + img.firstChild.getAttribute('md5').replace(/\=*$/, '') + '"
href = Function 'img', "return '#{href}'"
(img) ->
$.el 'a',
@ -2116,7 +2116,7 @@ sauce =
node: (root) ->
return if root.className is 'inline' or not span = $ '.filesize', root
img = $ 'img', root
img = span.nextElementSibling.nextElementSibling
for link in sauce.links
$.add span, $.tn(' '), link img
return