PageSourceSearch

http://aeplug.ru/forum/ext/vse/lightbox/styles/all/template/js/resizer.js?assets_version=506

js aeplug.ru collected 2026-10-02 15:08:12 UTC 2,042 bytes, 66 lines download raw bytes

1(function($) { // Avoid conflicts with other libraries
2
3	'use strict';
4
5	$.fn.extend({
6		borderHover: function() {
7			return this.each(function() {
8				$(this).css({
9					'border': 'solid 3px transparent',
10					'transition': 'border-color 0.1s ease-out',
11					'border-radius': '6px',
12					'cursor': 'pointer'
13				}).hover(function() {
14					$(this).css('border-color', '#4ae');
15				}, function() {
16					$(this).css('border-color', 'transparent');
17				});
18			});
19		}
20	});
21
22	$(function() {
23		var $targetImage = $('.postimage'),
24			galleryName = 'post-gallery',
25			mobileWidth = 900;
26		if (!vseLightbox.lightboxSig) {
27			$targetImage = $targetImage.not(function() {
28				return $(this).closest('.signature').length > 0;
29			});
30		}
31		if (vseLightbox.resizeWidth > 0 && $(window).width() > mobileWidth) {
32			$targetImage.css('max-width', vseLightbox.resizeWidth + 'px');
33		} else {
34			return;
35		}
36		// enclosing the following in a setTimeout seems to solve issues with
37		// images not being ready and causing $(this).width() to return 0.
38		setTimeout(function() {
39			$targetImage.one('load', function() {
40				if ($(this).closest('.postlink').length > 0) return;
41				var imgIndex = (vseLightbox.lightboxGal) ? '' : $targetImage.index(this);
42				if ($(this).parent('a').length > 0) {
43					if ($(this).outerWidth() >= vseLightbox.resizeWidth) {
44						$(this).parent('a').attr({
45							'data-lightbox': galleryName + imgIndex,
46							'data-title': (vseLightbox.imageTitles) ? $(this).attr('alt') : ''
47						}).end().borderHover();
48					}
49				}
50				else if ($(this).outerWidth() >= vseLightbox.resizeWidth) {
51					$(this).wrap(function() {
52						var url = $(this).attr('src');
53						return $('<a/>').attr({
54							'href': url,
55							'data-lightbox': galleryName + imgIndex,
56							'data-title': (vseLightbox.imageTitles) ? ((url.indexOf('download/file.php') !== -1) ? $(this).attr('alt') : url.split('/').pop()) : ''
57						});
58					}).borderHover();
59				}
60			}).each(function() {
61				if (this.complete) $(this).load();
62			});
63		}, 0);
64	});
65
66})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.