PageSourceSearch

https://www.muzeu.md/wp-content/plugins/slideshow-gallery/views/default/js/gallery.js?ver=1.0

js muzeu.md collected 2026-10-02 12:11:18 UTC 13,304 bytes, 424 lines download raw bytes

1var TINY={};
2
3function tid(i){ return document.getElementById(i); }
4function tag(e,p){ p=p||document; return p.getElementsByTagName(e); }
5
6TINY.slideshow=function(n){
7	this.infoSpeed=this.imgSpeed=this.speed=10;
8	this.thumbOpacity=this.navHover=70;
9	this.navOpacity=25;
10	this.scrollSpeed=5;
11	this.letterbox='#000';
12	this.n=n;
13	this.c=0;
14	this.a=[]
15};
16
17TINY.slideshow.prototype={
18	init:function(s,z,b,f,q){
19		this.s=s=tid(s);
20		var m= tag('li',s), i=0, w=0;
21		this.l=m.length;
22		this.q=tid(q);
23		this.f=tid(z);
24		this.r=tid(this.info);
25		this.o=parseInt(TINY.style.val(z,'width'));
26		
27		if(this.thumbs){
28			var u=tid(this.left), r=tid(this.right);
29			u.onmouseover=new Function('TINY.scroll.init("'+this.thumbs+'",-1,'+this.scrollSpeed+')');
30			u.onmouseout=r.onmouseout=new Function('TINY.scroll.cl("'+this.thumbs+'")');
31			r.onmouseover=new Function('TINY.scroll.init("'+this.thumbs+'",1,'+this.scrollSpeed+')');
32			this.p=tid(this.thumbs)
33		}
34		
35		for(i;i<this.l;i++){
36			this.a[i]={};
37			var h=m[i], a=this.a[i];			
38			a.t= tag('h3',h)[0].innerHTML;
39			a.io = tag('h3',h)[0].style.opacity;
40			a.d= tag('p',h)[0].innerHTML;
41			a.l= tag('a',h)[0]? tag('a',h)[0].href:'';
42			a.tg = tag('a',h)[0] != '' ? tag('a',h)[0].target:'_self';
43			a.p= tag('span',h)[0].innerHTML;
44			a.a = jQuery(tag('span',h)[0]).data('alt');
45			if(this.thumbs){
46				var g = tag('img',h)[0];
47				this.p.appendChild(g);
48				w+=parseInt(g.offsetWidth);
49				if(i!=this.l-1){
50					g.style.marginRight=this.spacing+'px';
51					w+=this.spacing
52				}
53				this.p.style.width=w+'px';				
54				g.style.opacity=this.thumbOpacity/100;
55				g.style.filter='alpha(opacity='+this.thumbOpacity+')';
56				g.onmouseover=new Function('TINY.alpha.set(this,100,5)');
57				g.onmouseout=new Function('TINY.alpha.set(this,'+this.thumbOpacity+',5)');
58				g.onclick=new Function(this.n+'.pr('+i+',1)');
59			}
60		}
61		if(b&&f){
62			b=tid(b);
63			f=tid(f);
64			b.style.display=f.style.display='block';
65			b.style.opacity=f.style.opacity=this.navOpacity/100;
66			b.style.filter=f.style.filter='alpha(opacity='+this.navOpacity+')';
67			b.onmouseover=f.onmouseover=new Function('TINY.alpha.set(this,'+this.navHover+',5)');
68			b.onmouseout=f.onmouseout=new Function('TINY.alpha.set(this,'+this.navOpacity+',5)');
69			b.onclick=new Function(this.n+'.mv(-1,1)');
70			f.onclick=new Function(this.n+'.mv(1,1)');
71		}
72		this.auto?this.is(0,0):this.is(0,1);
73	},
74	mv:function(d,c){
75		this.direction = (d == 1) ? 'f' : 'b';
76		var t=this.c+d;
77		this.c=t=t<0?this.l-1:t>this.l-1?0:t;
78		this.pr(t,c)
79	},
80	pr:function(t,c){		
81		clearTimeout(this.lt);
82		if(c){
83			clearTimeout(this.at)
84		}
85		this.c=t;
86		this.is(t,c)
87	},
88	is:function(s,c){	
89		if(this.info) {					
90			if (this.a[s].t.length > 0 || this.a[s].d.length > 0) {			
91				TINY.height.set(this.r,1,this.infoSpeed/2,-1);
92			} else {			
93				TINY.height.set(this.r,0,this.infoSpeed/2,-1);
94			}
95		}
96		
97		var i=new Image();
98		if (this.effect == "fade") {
99			i.style.display = 'none';
100		}
101		
102		this.i=i;
103		i.onload=new Function(this.n+'.le('+s+','+c+')');
104		string = this.a[s].p;
105		string = string.replace(/&amp;/g, '&');
106		i.src = string;
107		i.id = this.imagesid + 'img' + s;
108		jQuery(i).attr('alt', this.a[s].a);
109		
110		if(this.thumbs){
111			var a= tag('img',this.p), l=a.length, x=0;
112			for(x;x<l;x++){
113				a[x].style.borderColor=x!=s?'':this.active;
114				
115				if (x != s) {
116					jQuery(a[x]).addClass('active');
117				} else {
118					jQuery(a[x]).removeClass('active');
119				}
120			}
121		}
122	},
123	mi:function(oi, i) {		
124		opos = jQuery(oi).position();
125		oposl = opos.left;
126		opost = opos.top;
127		ow = jQuery(oi).width();
128		oh = jQuery(oi).height();
129		
130		pos = jQuery(i).position();
131		posl = pos.left;
132		post = pos.top;
133		w = jQuery(i).width();
134		h = jQuery(i).height();
135		
136		speed = (this.imgSpeed * 100);
137		fullw = jQuery(i).parent().width();
138			
139		if (jQuery(oi).attr('src') != jQuery(i).attr('src')) {
140			if (this.direction == "f" || typeof(this.direction) == "undefined") {	
141				if (this.slide_direction == "tb") {
142					jQuery(i).css('top', (h + opost)).animate({
143					"top": "0px"
144					}, {
145						duration: speed,
146						easing: this.easing,
147						step: function(now, fx) {
148							jQuery(oi).css('top', '-' + (oh - now) + 'px');
149						}
150					});
151				} else {															
152					jQuery(i).css('left', '+' + fullw + 'px').animate({'left':'0px'}, {
153						duration: speed,
154						easing: this.easing
155					});
156					
157					jQuery(oi).css('right', "auto").animate({'left':'-' + fullw + 'px'}, {
158						duration: speed,
159						easing: this.easing
160					});
161				}
162			} else if (this.direction == "b") {	
163				if (this.slide_direction == "tb") {
164					newpos = -(w - opost);							
165					jQuery(i).css('top', newpos).animate({"top": "0px"}, {
166						duration: speed,
167						easing: this.easing,
168						step: function(now, fx) {
169							jQuery(oi).css('top', '+' + (oh + now) + 'px');
170						}
171					});
172				} else {					
173					jQuery(i).css('left', '-' + fullw + 'px').animate({'left':'0px'}, {
174						duration: speed,
175						easing: this.easing
176					});
177					
178					jQuery(oi).animate({'left':'+' + fullw + 'px'}, {
179						duration: speed,
180						easing: this.easing
181					});
182				}
183			}
184		}
185	},
186	oi:function(oi, i) {
187		speed = (this.imgSpeed * 100);
188		
189		jQuery(oi).fadeOut({
190			duration: speed,
191			easing: this.easing
192		});
193		
194		jQuery(i).fadeIn({
195			duration: speed,
196			easing: this.easing
197		});
198	},
199	eff:function(oi, i) {
200		speed = (this.imgSpeed * 100);
201		
202		jQuery(oi).fadeOut({duration:speed, easing:this.easing});
203		
204		var options = {easing:this.easing};
205		jQuery(i).show(this.effect, options, speed);
206	},
207	le:function(s,c){		
208		this.f.appendChild(this.i);
209		var w=this.o-parseInt(this.i.offsetWidth);
210		if(w>0){
211			var l=Math.floor(w/2);
212		}
213		
214		var m= tag('img',this.f);
215		var oi = m[(m.length - 2)];
216		var oli = tag('li',this.s);
217		
218		if (typeof(oi) == "undefined" || oi.src != this.i.src) {
219			if (this.effect == "fade") {
220				this.oi(m[(m.length - 2)], this.i);
221			} else if (this.effect == "slide") {
222				if (m.length > 1) {
223					this.mi(m[(m.length - 2)], this.i);
224				}
225			} else {
226				this.i.style.display = 'none';
227				this.eff(m[(m.length - 2)], this.i);	
228			}
229		}	
230		
231		var n=new Function(this.n+'.nf('+s+')');
232		this.lt=setTimeout(n,this.imgSpeed*100);
233		if((!c || (this.auto == true && this.alwaysauto == true)) && oli.length > 1) {
234			this.at=setTimeout(new Function(this.n+'.mv(1,0)'),this.speed*1000)
235		}
236		
237		if (this.autoheight == true) {
238			var currentheight = jQuery(this.i).height();
239			var currentwidth = jQuery(this.i).width();
240			var originalheight = this.i.naturalHeight;
241			var originalwidth = this.i.naturalWidth;
242			
243			var fullw = jQuery(this.i).parent().width();
244			
245			if (originalwidth > fullw) {
246				var ratio = (originalwidth / fullw);				
247				var newautoheight = Math.round(originalheight / ratio);
248
249				if (typeof(this.autoheight_max) !== "undefined" && this.autoheight_max != false && newautoheight > this.autoheight_max) {
250					autoheight = this.autoheight_max;
251				} else {
252					autoheight = newautoheight;
253				}
254			} else {
255				if (typeof(this.autoheight_max) !== "undefined" && this.autoheight_max != false && originalheight > this.autoheight_max) {
256					autoheight = this.autoheight_max;
257				} else {
258					autoheight = originalheight;
259				}
260			}
261			
262			TINY.height.set(this.f.parentNode,(autoheight),this.infoSpeed/2,-1);
263		}
264		
265		if(this.a[s].l != ""){			
266			var baseURL = this.a[s].l;
267			var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
268	   		var urlType = baseURL.toLowerCase().match(urlString);
269	   		var unique = jQuery(this.s).attr('id');			
270
271			if (this.imagesthickbox == "true" && (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp')) {							
272				this.q.onmouseover = new Function('this.className="' + this.linkclass + '"; this.href = "' + this.a[s].l + '";');
273				var uniqueimglinkid = jQuery('a[href="' + this.a[s].l + '"]').attr('id');
274				this.q.onclick = new Function('jQuery(".colorbox' + unique + '").colorbox({rel:"' + jQuery(this).data('rel') + '", maxWidth:"90%", maxHeight:"90%"}); jQuery("#' + uniqueimglinkid + '").click(); return false;');
275			} else {
276				this.q.onmouseover = new Function('this.className="' + this.linkclass + '";');
277				this.q.onclick = new Function('window.open("' + this.a[s].l + '","' + this.a[s].tg + '"); return false;');
278			}
279			
280			this.q.onmouseout = new Function('this.className=""');
281			this.q.style.cursor = 'pointer';
282		}else{
283			this.q.onclick=this.q.onmouseover=null;
284			this.q.style.cursor='default';
285		}
286		var m= tag('img',this.f);
287		if(m.length > 10){
288			this.f.removeChild(m[0])
289		}
290		
291		jQuery(document).bind('cbox_closed', function(){
292			jQuery.colorbox.remove();
293		});
294	},
295	nf:function(s){
296		if(this.info){				
297			s=this.a[s];			
298			tag('h3',this.r)[0].innerHTML=s.t;
299			tag('p',this.r)[0].innerHTML=s.d;
300			this.r.style.height='auto';
301			var h=parseInt(this.r.offsetHeight);
302			this.r.style.height=0;
303			
304			if (s.t.length > 0 || s.d.length > 0) {	
305				var _this = this;
306				
307				if (_this.infoonhover) {
308					jQuery(_this.r).parent().hover(function() {
309						TINY.height.set(_this.r,h,_this.infoSpeed,0);
310						TINY.alpha.set(_this.r,s.io,5);
311					}, function() {
312						TINY.height.set(_this.r,0,_this.infoSpeed,0);
313					});
314					
315				} else {
316					setTimeout(function() {		
317						TINY.height.set(_this.r,h,_this.infoSpeed,0);
318						TINY.alpha.set(_this.r,s.io,5);
319						
320						if (_this.infofade) {
321							if (_this.infofadedelay > 0) {
322								setTimeout(function () {
323									TINY.height.set(_this.r,0,_this.infoSpeed,0);
324								}, (_this.infofadedelay * 1000));
325							}
326						}
327					}, (this.infodelay * 1000));
328				}
329			}
330		}
331	},
332	touch:function(touchsurface) {
333		
334		var startx, dist;
335		var _this = this;
336		
337		touchsurface.addEventListener('touchstart', function(e) {
338			var touchobj = e.changedTouches[0];
339			startx = parseInt(touchobj.clientX);
340		});
341		
342		touchsurface.addEventListener('touchmove', function(e) {
343			if (!startx) {
344				return;
345			}
346			
347			var touchobj = e.changedTouches[0];
348			var dist = parseInt(touchobj.clientX) - startx;
349			
350			if (dist > 0) {
351				_this.mv(-1,1);
352			} else {
353				_this.mv(1,1);
354			}
355			
356			startx = null;
357		});
358	},
359	touchslide:function(touchslidesurface) {
360		
361	    var startx = 0
362	    var dist = 0
363	    var thumbs = this.p;
364	    var thumbsleft;
365	 
366	    touchslidesurface.addEventListener('touchstart', function(e){
367	        var touchobj = e.changedTouches[0] // reference first touch point (ie: first finger)
368	        startx = parseInt(touchobj.clientX) // get x position of touch point relative to left edge of browser
369	        thumbsleft = parseInt(thumbs.style.left || 0, 10);
370	    }, false)
371	 
372	    touchslidesurface.addEventListener('touchmove', function(e){
373	        var touchobj = e.changedTouches[0] // reference first touch point for this event
374	        var dist = parseInt(touchobj.clientX) - startx	        
375	        thumbs.style.left = ((thumbsleft + dist > 0) ? 0 : (Math.abs(thumbsleft + dist) > parseInt(thumbs.offsetWidth)-parseInt(thumbs.parentNode.offsetWidth)) ? thumbsleft : thumbsleft + dist) + 'px';
376	    }, false)
377	}
378};
379
380TINY.scroll=function(){
381	return{
382		init:function(e,d,s){
383			e=typeof e=='object'?e: tid(e); var p=e.style.left||TINY.style.val(e,'left'); e.style.left=p;			
384			var l = (d==1) ? Math.abs(parseInt(e.offsetWidth)-parseInt(e.parentNode.offsetWidth)) : 0;
385			
386			if ((e.childNodes.length+1)*e.firstChild.width > e.parentNode.offsetWidth) {
387				e.si=setInterval(function(){
388					TINY.scroll.mv(e,l,d,s)},20);
389			}
390		},
391		mv:function(e,l,d,s){
392			var c=parseInt(e.style.left); if(c==l){TINY.scroll.cl(e)}else{var i=Math.abs(l+c); i=i<s?i:s; var n=c-i*d; e.style.left=n+'px'}
393		},
394		cl:function(e){e=typeof e=='object'?e: tid(e); clearInterval(e.si)}
395	}
396}();
397
398TINY.height=function(){
399	return{
400		set:function(e,h,s,d){
401			e=typeof e=='object'?e:tid(e); var oh=e.offsetHeight, ho=e.style.height||TINY.style.val(e,'height');
402			ho=oh-parseInt(ho); var hd=oh-ho>h?-1:1; clearInterval(e.si); e.si=setInterval(function(){TINY.height.tw(e,h,ho,hd,s)},20)
403		},
404		tw:function(e,h,ho,hd,s){
405			var oh=e.offsetHeight-ho;
406			if(oh == h){clearInterval(e.si)}else{if(oh!=h){e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px'}}
407		}
408	}
409}();
410
411TINY.alpha=function(){
412	return{
413		set:function(e,a,s){
414			e=typeof e=='object'?e:tid(e); var o=e.style.opacity||TINY.style.val(e,'opacity'),
415			d=a>o*100?1:-1; e.style.opacity=o; clearInterval(e.ai); e.ai=setInterval(function(){TINY.alpha.tw(e,a,d,s)},20)
416		},
417		tw:function(e,a,d,s){
418			var o=Math.round(e.style.opacity*100);
419			if(o==a){clearInterval(e.ai)}else{var n=o+Math.ceil(Math.abs(a-o)/s)*d; e.style.opacity=n/100; e.style.filter='alpha(opacity='+n+')'}
420		}
421	}
422}();
423
424TINY.style=function(){return{val:function(e,p){e=typeof e=='object'?e:tid(e); return e.currentStyle?e.currentStyle[p]:document.defaultView.getComputedStyle(e,null).getPropertyValue(p)}}}();

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.