diff --git a/hoverzoom.js b/hoverzoom.js index 760bd2e..5c72bd2 100644 --- a/hoverzoom.js +++ b/hoverzoom.js @@ -312,7 +312,7 @@ var hoverZoom = { titledElement.parents('[title]').andSelf().add('[title]').removeAttr('title'); } else { var alt = link.attr('alt') || link.find('[alt]').attr('alt'); - if (alt && alt.length > 6 && !/^[0-9]+$/.test(alt)) { + if (alt && alt.length > 6 && !/^\d+$/.test(alt)) { link.data('hoverZoomCaption', alt); } } diff --git a/plugins/cnet.js b/plugins/cnet.js index 87f0e7c..7f5f347 100644 --- a/plugins/cnet.js +++ b/plugins/cnet.js @@ -7,8 +7,8 @@ hoverZoomPlugins.push( { version: '0.1', prepareImgLinks: function(callback) { var res = [], - filter1 = /^(.*)_[0-9]+x[0-9]+\.(jpg|png|gif).*$/i, - //filter2 = /^(.*\/cnwk\..*\/[0-9]+-[0-9]+)-[0-9]+-(.*)\.(jpg|png|gif).*$/i, + filter1 = /^(.*)_\d+x\d+\.(jpg|png|gif).*$/i, + //filter2 = /^(.*\/cnwk\..*\/\d+-\d+)-\d+-(.*)\.(jpg|png|gif).*$/i, imgs = $('a img[src*=i.com.com]'); imgs.each(function() { diff --git a/plugins/gawker.js b/plugins/gawker.js index 775e1d3..318e7cb 100644 --- a/plugins/gawker.js +++ b/plugins/gawker.js @@ -11,8 +11,8 @@ hoverZoomPlugins.push( { var img = $(this), url = hoverZoom.getThumbUrl(this); if (!url) { return; } - url = url.replace(/\/([0-9]+x[0-9]*|gallery)_/, '/'); - if (img.hasClass('avatar')) { url = url.replace(/_[0-9]+\./, '_160.'); } + url = url.replace(/\/(\d+x\d*|gallery)_/, '/'); + if (img.hasClass('avatar')) { url = url.replace(/_\d+\./, '_160.'); } url = url.substr(0, url.lastIndexOf('.')); img.data('hoverZoomSrc', [url + '.jpg', url + '.png', url + '.gif', url]); res.push(img); diff --git a/plugins/threadless.js b/plugins/threadless.js index a3e994e..6306087 100644 --- a/plugins/threadless.js +++ b/plugins/threadless.js @@ -10,12 +10,12 @@ hoverZoomPlugins.push( { hoverZoom.urlReplace(res, //'a[href*=/product/] img[src*=threadlesskids], a.thumblink img, a[href^=/gallery/] img, img.product', 'img[src*=-minizoom], img[src*=-view]', - /product\/[0-9]+x[0-9]+\/([0-9]+)-/, + /product\/\d+x\d+\/(\d+)-/, 'product/$1/' ); hoverZoom.urlReplace(res, 'a[href*=/product/] img', - /[0-9]+x[0-9]+/, + /\d+x\d+/, '636x460' ); $('td').filter(function() { @@ -31,7 +31,7 @@ hoverZoomPlugins.push( { $('img[src*=/profiles/]:not([src*=noimage]), img[src*=teeriffic], .product_image').each(function() { var _this = $(this), url = hoverZoom.getThumbUrl(this); - url = url.replace(/\/[0-9]+x[0-9]+/, ''); + url = url.replace(/\/\d+x\d+/, ''); url = url.substr(0, url.lastIndexOf('.')); _this.data('hoverZoomSrc', [url + '.jpg', url + '.gif', url + '.png']); res.push(_this); diff --git a/plugins/wikipedia.js b/plugins/wikipedia.js index 743698c..2be4c9f 100644 --- a/plugins/wikipedia.js +++ b/plugins/wikipedia.js @@ -21,10 +21,7 @@ hoverZoomPlugins.push( { } var srcs = []; if (!options.showHighRes) { - srcs.push(src.replace(/\/[0-9]+px-/, '/800px-')); - srcs.push(src.replace(/\/[0-9]+px-/, '/600px-')); - srcs.push(src.replace(/\/[0-9]+px-/, '/400px-')); - srcs.push(src.replace(/\/[0-9]+px-/, '/200px-')); + srcs.push(src.replace(/\/\d+px-/, '/800px-')); } srcs.push(src.substring(0, src.indexOf(ext) + ext.length).replace(/thumb\//, '')); $(this).data('hoverZoomSrc', srcs);