optimization image check.

GitlabVersion
yanxd 11 years ago
parent 2b57e170ef
commit 2ff24841fd

@ -625,15 +625,11 @@ $(document).ready(addFormObserversForDoubleSubmit);
function img_thumbnails() {
$('.thumbnails a').colorbox({rel:'nofollow'});
$('.attachments').find('a').each(function(index, element) {
if($(element).attr('href').indexOf('.jpg') > 0) {
var href_value = $(element).attr('href');
if (/\.(jpg|png|gif|bmp)$/.test(href_value)) {
$(element).colorbox({rel:'nofollow'});
}
if($(element).attr('href').indexOf('.png') > 0) {
$(element).colorbox({rel:'nofollow'});
}
if($(element).attr('href').indexOf('.gif') > 0) {
$(element).colorbox({rel:'nofollow'});
}
})
});
}
$(document).ready(img_thumbnails);

Loading…
Cancel
Save