PageSourceSearch

https://e-prep.eu/modules/mod_rokgallery/templates/showcase/showcase.js

js e-prep.eu collected 2026-10-02 01:01:37 UTC 23,838 bytes, 1,052 lines download raw bytes

1
2(function(){
3
4	if (typeof this.RokGallery == 'undefined') this.RokGallery = {};
5
6	this.RokGallery.Showcase = new Class({
7
8		Implements: [Options, Events],
9
10		options: {
11			/*
12				onJump:		function(index){}
13			*/
14			onJump: function(index){
15				this.animation.index = this.current;
16				this.animation.setBackground(this.slices[index].getElement('img').get('src'));
17				this.animation.setAnimation(this.options.animation);
18				this.animation.play();
19
20				if (this.captions.length){
21					this.adjustHeight(index);
22
23					this.captionsAnimation.setAnimation(this.options.captions.animation);
24					this.captionsAnimation.setFromTo(this.current, index);
25					this.captionsAnimation.play();
26				}
27			},
28
29			animation: 'random',
30			duration: 500,
31			imgpadding: 0,
32
33			captions:{
34				fixedheight: false,
35				animated: true,
36				animation: 'crossfade'
37			},
38
39			autoplay: {
40				enabled: true,
41				delay: 5000,
42				complete: function(){
43					this.progress.reset();
44					this.next();
45				}
46			}
47		},
48
49		initialize: function(element, options){
50			this.setOptions(options);
51
52			this.element = document.id(element) || document.getElement(element) || null;
53			this.rtl = document.id(document.body).getStyle('direction') == 'rtl';
54
55			if (!this.element) return false;
56
57			this.current = 0;
58
59			this.container = this.element.getElement('.rg-sc-slice-container');
60			this.main = this.element.getElement('.rg-sc-main');
61			this.imglist = this.element.getElement('.rg-sc-img-list');
62			this.slices = this.element.getElements('.rg-sc-slice');
63			this.captions = this.element.getElements('.rg-sc-info');
64			this.arrows = this.element.getElements('.rg-sc-controls .next, .rg-sc-controls .prev');
65
66			this.loaderBar = this.element.getElement('.rg-sc-loader');
67			this.progressBar = this.element.getElement('.rg-sc-progress');
68
69
70			if (this.options.autoplay.enabled){
71				this.progress = new RokGallery.Showcase.Progress(this.progressBar, {
72					duration: this.options.autoplay.delay,
73					width: this.loaderBar ? this.loaderBar.getSize().x : 0,
74					onComplete: this.options.autoplay.complete.bind(this)
75				}).play();
76
77				this.bounds = {
78					progress: {
79						'mouseenter': this.progress.pause.bind(this.progress),
80						'mouseleave': this.progress.resume.bind(this.progress)
81					}
82				};
83
84				this.element.addEvents(this.bounds.progress);
85			} else {
86				if (this.loaderBar) this.loaderBar.setStyle('display', 'none');
87			}
88
89			this.setup();
90
91			if (this.arrows.length) this.setArrows();
92			//if (this.scrollerContainer) this.setNavigation();
93
94			this.jump(0, true);
95
96			if (Browser.Features.Touch){
97				this.element.addEvent('swipe', function(event){
98					event.preventDefault();
99					this[event.direction == 'right' ? 'previous' : 'next']();
100				}.bind(this));
101			}
102		},
103
104		setup: function(){
105			this.animation = new RokGallery.Showcase.Animations(this.element, {
106				container: this.imglist,
107				width: this.container.getSize().x,
108				height: this.container.getSize().y,
109				duration: this.options.duration,
110				transition: 'quad:in:out',
111				//imgpadding: 0,
112				onStart: function(){
113					if (this.options.autoplay.enabled) this.progress.pause();
114				}.bind(this),
115				onComplete: function(){
116					this.slices[this.current].setStyle('display', 'block');
117					if (this.current != this.animation.index) this.slices[this.animation.index].setStyle('display', 'none');
118
119					this.animation.clean();
120
121					if (this.options.autoplay.enabled) this.progress.play();
122				}.bind(this)
123			});
124
125			if (this.captions.length){
126				this.captions.setStyles({display: 'block', 'opacity': 0});
127				this.captionsAnimation = new RokGallery.Showcase.CaptionsAnimations(this.captions, {
128					duration: this.options.duration,
129					onStart: function(){
130						this.captions.setStyle('visibility', 'visible');
131					}.bind(this),
132					onComplete: function(){
133						this.captions.setStyle('visibility', 'hidden');
134						this.captions[this.current].setStyle('visibility', 'visible');
135					}.bind(this)
136				});
137
138				if (this.options.captions.fixedheight){
139					var max = 0;
140					this.captions.each(function(caption){
141						if (caption.offsetHeight > max) max = caption.offsetHeight;
142					});
143
144					this.main.setStyle('height', max);
145				}
146			}
147
148			this.fireEvent('setup');
149		},
150
151		setArrows: function(){
152			var action;
153			this.arrows.each(function(arrow){
154				action = arrow.className.contains('next') ? 'next' : 'previous';
155				arrow.addEvent('click', this[action].bind(this));
156			}, this);
157		},
158
159
160		adjustHeight: function(index){
161			if (this.options.captions.fixedheight) return;
162
163			var caption = this.captions[index].offsetHeight,
164				container = this.container.getSize().y,
165				main = this.main.offsetHeight,
166				max = Math.max(caption, container);
167
168			if (main != max){
169				if (this.options.captions.animated){
170					this.main.set('tween', {duration: this.options.duration}).get('tween').start('height', max);
171				} else {
172					this.main.setStyle('height', max);
173				}
174			}
175		},
176
177		next: function(){
178			var next = this.getNext();
179			this.jump(next);
180
181			if (this.options.autoplay.enabled && !this.progress.isPaused) this.progress.play();
182
183			return this;
184		},
185
186		previous: function(){
187			var previous = this.getPrevious();
188			this.jump(previous);
189
190			return this;
191		},
192
193		jump: function(index, force){
194			if (index == this.current && !force) return this;
195			if (this.animation.timer) return this;
196
197			if (typeof GantrySmartLoad != 'undefined') window.fireEvent('scroll');
198			this.fireEvent('jump', index);
199
200			this.current = index;
201
202			return this;
203		},
204
205		getNext: function(){
206			return (this.current + 1 >
206= this.slices.length) ? 0 : this.current + 1;
207		},
208
209		getPrevious: function(){
210			return (this.current - 1 < 0) ? this.slices.length - 1 : this.current - 1;
211		}
212
213	});
214
215	this.RokGallery.Showcase.Progress = new Class({
216
217		Extends: Fx,
218
219		options: {
220			transition: 'linear',
221			fps: 24,
222			width: 100
223		},
224
225		initialize: function(element, options){
226			this.element = document.id(element);
227			this.isPaused = false;
228
229			this.parent(options);
230		},
231
232		set: function(now){
233			if (this.element) this.element.setStyle('width', now);
234
235			return this;
236		},
237
238		reset: function(){
239			this.set(0);
240
241			return this;
242		},
243
244		play: function(){
245			this.start(0, this.options.width);
246
247			return this;
248		},
249
250		pause: function(){
251			this.isPaused = true;
252			return this.parent();
253		},
254
255		resume: function(){
256			this.isPaused = false;
257			return this.parent();
258		}
259
260	});
261
262	this.RokGallery.Showcase.Animations = new Class({
263
264		Extends: Fx.CSS,
265
266		options: {
267			duration: 1000,
268			transition: 'expo:in:out',
269
270			animation: 'crossfade',
271			container: '',
272			background: '',
273			imgpadding: 0,
274			width: 0,
275			height: 0,
276
277			blinds: 24,
278			boxes: {
279				rows: 10,
280				cols: 24
281			}
282		},
283
284		animations: {},
285		animationsKeys: [],
286
287		initialize: function(elements, options){
288			this.isPaused = false;
289
290			this.parent(options);
291
292			this.slides = [];
293
294			this.originalDuration = this.options.duration;
295			this.delay = 0;
296			this.type = 'blinds';
297			this.background = this.options.background;
298			this.blinds = 1;
299			this.boxes = {rows: 1, cols: 1};
300			this.properties = {};
301			this.direction = 'right';
302			this.reorder = false;
303
304			this.container = new Element('div', {
305				'class': 'rg-sc-slice-animations'
306			}).inject(this.options.container);
307
308			this.setAnimation(this.options.animation);
309		},
310
311		build: function(type){
312			this.container.empty();
313			this.slides.empty();
314
315			this['build' + type.capitalize()]();
316
317			this.elements = $$(this.slides);
318		},
319
320		addAnimation: function(name, props){
321			if (!this.animations[name]) this.animations[name] = props;
322			this.animationsKeys.include(name);
323		},
324
325		setAnimation: function(name){
326			if (name == 'random') name = this.animationsKeys.getRandom();
327			if (!this.animations[name]) this.setOptions({animation: 'crossfade'});
328
329			for (var prop in this.animations[name]){
330				this[prop] = this.animations[name][prop];
331			}
332
333			if (!this.animations[name]['blinds']) this.blinds = this.options.blinds;
334			if (!this.animations[name]['boxes']) this.boxes = this.options.boxes;
335			if (!this.animations[name]['reorder']) this.reorder = false;
336
337			this.build(this.type);
338		},
339
340		buildBlinds: function(){
341			var size = {
342					width: this.options.width,
343					height: this.options.height
344				},
345				background = this.background,
346				blinds = background && background.length ? this.blinds : 0,
347				width = Math.round(size.width / blinds);
348
349			this.sliceSize = {width: width, height: size.height};
350
351			(blinds).times(function(i){
352
353				var position = ((width + (i * width)) - width);
354				var blind = new Element('div', {
355					styles: {
356						opacity: 0,
357						position: 'absolute',
358						top: this.options.imgpadding,
359						left: (width * i) + this.options.imgpadding + 'px',
360						height: size.height + 'px',
361						width: (i == blinds - 1) ? size.width - (width * i) : width,
362						background: 'url(' + background + ') no-repeat -' + position + 'px 0%'
363					}
364				}).inject(this.container);
365
366				this.slides.push(blind);
367
368			}, this);
369		},
370
371		buildBoxes: function(){
372			var size = {width: this.options.width, height: this.options.height},
373				background = this.background,
374				boxes = background && background.length ? this.boxes : {rows: 0, cols: 0},
375				boxSize = {width: Math.round(size.width / boxes.cols), height: Math.round(size.height / boxes.rows)};
376
377			this.sliceSize = {width: boxSize.width, height: boxSize.height};
378
379			(boxes.rows).times(function(row){
380				(boxes.cols).times(function(col){
381					var position = {
382						x: (boxSize.width + (col * boxSize.width)) - boxSize.width,
383						y: (boxSize.height + (row * boxSize.height)) - boxSize.height
384					};
385
386					var box = new Element('div', {
387						styles: {
388							opacity: 0,
389							position: 'absolute',
390							top: (boxSize.height * row) + this.options.imgpadding + 'px',
391							left: (boxSize.width * col) + this.options.imgpadding + 'px',
392							width: (col == boxes.cols - 1) ? size.width - (boxSize.width * col) : boxSize.width,
393							height: boxSize.height,
394							background: 'url(' + background + ') no-repeat -' + position.x + 'px -' + position.y + 'px'
395						}
396					}).inject(this.container);
397
398					this.slides.push(box);
399
400				}, this);
401			}, this);
402		},
403
404		setBackground: function(background){
405			this.background = background;
406		},
407
408		compute: function(from, to, delta){
409			var now = {};
410
411			for (var i in from){
412				var iFrom = from[i], iTo = to[i], iNow = now[i] = {};
413				for (var p in iFrom){
414					iNow[p] = this.parent(iFrom[p], iTo[p], delta);
415				}
416			}
417
418			return now;
419		},
420
421		set: function(now, force){
422			var buffer = this.buffer = 0;
423			for (var i in now){
424				if (!this.elements[i]) continue;
425
426				var iNow = now[i];
427				for (var p in iNow) this.render.delay(force ? 0 : buffer, this, [this.elements[i], p, iNow[p], this.options.unit]);
428
429				buffer += this.delay;
430			}
431
432			this.buffer = buffer;
433
434			return this;
435		},
436
437		step: function(){
438			var time = Date.now();
439			var expected = (this.delay || 1) * this.slides.length + this.options.duration;
440
441			if (time < this.time + this.options.duration){
442				var delta = this.transition((time - this.time) / this.options.duration);
443				this.set(this.compute(this.from, this.to, delta));
444			} else {
445				if (time > this.time + expected){
446					this.set(this.compute(this.from, this.to, 1));
447					this.complete();
448				}
449			}
450		},
451
452		start: function(obj){
453			if (!this.check(obj)) return this;
454			var from = {}, to = {};
455
456			for (var i in obj){
457				if (!this.elements[i]) continue;
458
459				var iProps = obj[i], iFrom = from[i] = {}, iTo = to[i] = {};
460
461				for (var p in iProps){
462					var parsed = this.prepare(this.elements[i], p, iProps[p]);
463					iFrom[p] = parsed.from;
464					iTo[p] = parsed.to;
465				}
466			}
467
468			var duration = this.options.duration;
469			this.options.duration = Fx.Durations[duration] || duration.toInt();
470			this.from = from;
471			this.to = to;
472			this.time = 0;
473			this.transition = this.getTransition();
474			this.startTimer();
475			this.onStart();
476			return this;
477			//return this.parent(from, to);
478		},
479
480		reset: function(properties, force){
481			var obj = {};
482			(this.elements.length).times(function(index){
483				obj[index] = properties;
484			}, this);
485
486			this.set(obj, force);
487		},
488
489		play: function(properties){
490			var obj = {}; properties = properties || this.properties;
491
492			if (this.direction == 'left') this.elements.reverse();
493			if (this.reorder){
494				this.elements = this.reorder.bind(this, [this.elements])();
495			}
496
497			for (var prop in properties){
498				switch (typeof properties[prop]){
499					case 'object': case 'array':
500							var values = properties[prop];
501							values.each(function(value, i){
502								if (typeof value == 'string')
503								properties[prop][i] = value.replace('%height2%', this.sliceSize.height * 2).replace('%width2%', this.sliceSize.width * 2)
504													.replace('%height%', this.sliceSize.height).replace('%width%', this.sliceSize.width).toInt();
505								if (['top', 'right', 'bottom', 'left'].contains(prop) && !properties[prop][i]) properties[prop][i] += this.options.imgpadding;
506							}, this);
507						break;
508					case 'string':
509						properties[prop] = properties[prop].replace('%height2%', this.sliceSize.height * 2).replace('%width2%', this.sliceSize.width * 2)
510														.replace('%height%', this.sliceSize.height).replace('%width%', this.sliceSize.width).toInt();
511						if (['top', 'right', 'bottom', 'left'].contains(prop) && !properties[prop][i]) properties[prop][i] += this.options.imgpadding;
512						break;
513				}
514			}
515
516			(this.elements.length).times(function(index){
517				obj[index] = properties;
518			}, this);
519
520			this.start(obj);
521			return this;
522		},
523
524		complete: function(){
525			if (this.stopTimer()) this.onComplete();
526			return this;
527		},
528
529		cancel: function(){
530			if (this.stopTimer()) this.onCancel();
531			return this;
532		},
533
534		onStart: function(){
535			this.fireEvent('start', this.subject);
536		},
537
538		onComplete: function(){
539			this.fireEvent('complete', this.subject);
540			if (!this.callChain()) this.fireEvent('chainComplete', this.subject);
541		},
542
543		onCancel: function(){
544			this.fireEvent('cancel', this.subject).clearChain();
545		},
546
547		pause: function(){
548			this.isPaused = true;
549			this.stopTimer();
550			return this;
551		},
552
553		resume: function(){
554			this.isPaused = false;
555			this.startTimer();
556			return this;
557		},
558
559		clean: function(){
560			$$(this.slides).dispose();
561			this.slides.empty();
562
563			return this;
564		},
565
566		stopTimer: function(){
567			if (!this.timer) return false;
568			this.time = Date.now() - this.time;
569			this.timer = removeInstance(this);
570			return true;
571		},
572
573		startTimer: function(){
574			if (this.timer) return false;
575			this.time = Date.now() - this.time;
576			this.timer = addInstance(this);
577			return true;
578		}
579
580	});
581	// global timers
582
583	var instances = {}, timers = {};
584
585	var loop = function(){
586		for (var i = this.length; i--;){
587			if (this[i]) this[i].step();
588		}
589	};
590
591	var addInstance = function(instance){
592		var fps = instance.options.fps,
593			list = instances[fps] || (instances[fps] = []);
594		list.push(instance);
595		if (!timers[fps]) timers[fps] = loop.periodical(Math.round(1000 / fps), list);
596		return true;
597	};
598
599	var removeInstance = function(instance){
600		var fps = instance.options.fps,
601			list = instances[fps] || [];
602		list.erase(instance);
603		if (!list.length && timers[fps]) timers[fps] = clearInterval(timers[fps]);
604		return false;
605	};
606
607
608	// animations
609
610
611	this.RokGallery.Showcase.CaptionsAnimations = new Class({
612
613		Extends: Fx.Elements,
614
615		options: {
616			duration: 1000,
617			transition: 'expo:in:out',
618			link: 'cancel',
619
620			animation: 'crossfade'
621		},
622
623		animations: {},
624		animationsKeys: [],
625
626		initialize: function(elements, options){
627			this.parent(options);
628			this.setOptions(options);
629			this.isPaused = false;
630			this.elements = this.subject = $$(elements);
631			this.properties = {};
632
633			//this.addEvent('onComplete', this.onComplete.bind(this));
634			this.setAnimation(this.options.animation);
635			this.setFromTo(0, 0);
636		},
637
638		addAnimation: function(name, props){
639			if (!this.animations[name]) this.animations[name] = props;
640			this.animationsKeys.include(name);
641		},
642
643		setAnimation: function(name){
644			if (name == 'random') name = this.animationsKeys.getRandom();
645			if (!this.animations[name]) this.setOptions({animation: 'crossfade'});
646
647			this.properties = {};
648			for (var prop in this.animations[name]){
649				this.properties[prop] = this.animations[name][prop];
650			}
651			//this.build(this.type);
652		},
653
654		setFromTo: function(from, to){
655			this.fromCaption = this.elements[from] ? from : 0;
656			this.toCaption = this.elements[to] ? to : 0;
657		},
658
659		reset: function(properties, force){
660			var obj = {};
661			(this.elements.length).times(function(index){
662				obj[index] = properties;
663			}, this);
664
665			this.set(obj, force);
666		},
667
668		play: function(properties){
669			var obj = {}, current = {}, next = {}; properties = properties || this.properties;
670
671			var fromSize = {'width': this.elements[this.fromCaption].offsetWidth, 'height': this.elements[this.fromCaption].offsetHeight},
672				toSize = {'width': this.elements[this.toCaption].offsetWidth, 'height': this.elements[this.toCaption].offsetHeight};
673
674			if (this.fromCaption != this.toCaption){
675				obj[this.fromCaption] = properties['current'];
676				obj[this.toCaption] = properties['next'];
677			} else {
678				obj[this.toCaption] = properties['next'];
679			}
680
681			for (var prop in obj[this.fromCaption]){
682				obj[this.fromCaption][prop].each(function(value, i){
683					if (typeof value == 'string')
684						obj[this.fromCaption][prop][i] = value.replace('%height2%', fromSize.width * 2).replace('%width2%', fromSize.width * 2)
685												.replace('%height%', fromSize.height).replace('%width%', fromSize.width).toInt();
686
687				}, this);
688			}
689
690			for (var prop in obj[this.toCaption]){
691				obj[this.toCaption][prop].each(function(value, i){
692					if (typeof value == 'string')
693						obj[this.toCaption][prop][i] = value.replace('%height2%', toSize.height * 2).replace('%width2%', toSize.width * 2)
694										.replace('%height%', toSize.height).replace('%width%', toSize.width).toInt();
695				}, this);
696			}
697
698			this.start(obj);
699			return this;
700		},
701
702		complete: function(){
703			if (this.stopTimer()) this.onComplete();
704			return this;
705		},
706
707		cancel: function(){
708			if (this.stopTimer()) this.onCancel();
709			return this;
710		},
711
712		onStart: function(){
713			this.fireEvent('start', this.subject);
714		},
715
716		onComplete: function(){
717			this.fireEvent('complete', this.subject);
718			if (!this.callChain()) this.fireEvent('chainComplete', this.subject);
719		},
720
721		onCancel: function(){
722			this.fireEvent('cancel', this.subject).clearChain();
723		},
724
725		pause: function(){
726			this.isPaused = true;
727			this.stopTimer();
728			return this;
729		},
730
731		resume: function(){
732			this.isPaused = false;
733			this.startTimer();
734			return this;
735		},
736
737		clean: function(){
738			$$(this.slides).dispose();
739			this.slides.empty();
740
741			return this;
742		},
743
744		stopTimer: function(){
745			if (!this.timer) return false;
746			this.time = Date.now() - this.time;
747			this.timer = removeInstance(this);
748			return true;
749		},
750
751		startTimer: function(){
752			if (this.timer) return false;
753			this.time = Date.now() - this.time;
754			this.timer = addInstance(this);
755			return true;
756		}
757
758	});
759
760	var captionsAnimations = {
761		'crossfade': {
762			current: {
763				'opacity': [1, 0]
764			},
765			next: {
766				'opacity': [0, 1]
767			}
768		},
769
770		'topdown': {
771			current: {
772				'opacity': [1, 0],
773				'top': [0, '%height%']
774			},
775			next: {
776				'opacity': [0, 1],
777				'top': ['-%height%', 0]
778			}
779		},
780
781		'bottomup': {
782			current: {
783				'opacity': [1, 0],
784				'top': [0, '-%height%']
785			},
786			next: {
787				'opacity': [0, 1],
788				'top': ['%height2%', 0]
789			}
790		}
791	};
792
793	var animations = {
794
795		'crossfade': {
796			type: 'blinds',
797			blinds: 1,
798			delay: 0,
799			direction: 'right',
800			properties: {
801				'opacity': [0, 1]
802			}
803		},
804
805		'blindsRight': {
806			type: 'blinds',
807			direction: 'right',
808			delay: 50,
809			properties: {
810				'opacity': [0, 1]
811			}
812		},
813
814		'blindsLeft': {
815			type: 'blinds',
816			direction: 'left',
817			delay: 50,
818			properties: {
819				'opacity': [0, 1]
820			}
821		},
822
823		'blindsDownLeft': {
824			type: 'blinds',
825			direction: 'left',
826			delay: 50,
827			properties: {
828				width: [0, '%width%'],
829				height: [0, '%height%'],
830				opacity: [0, 1]
831			}
832		},
833
834		'blindsDownRight': {
835			type: 'blinds',
836			direction: 'right',
837			delay: 50,
838			properties: {
839				width: [0, '%width%'],
840				height: [0, '%height%'],
841				opacity: [0, 1]
842			}
843		},
844
845		'boxesOpacityRight': {
846			type: 'boxes',
847			direction: 'right',
848			delay: 6,
849			properties: {
850				opacity: [0, 1]
851			}
852		},
853
854		'boxesOpacityLeft': {
855			type: 'boxes',
856			direction: 'left',
857			delay: 6,
858			properties: {
859				opacity: [0, 1]
860			}
861		},
862
863		'slideDown': {
864			type: 'boxes',
865			boxes: {
866				cols: 1,
867				rows: 1
868			},
869			direction: 'right',
870			delay: 200,
871			properties: {
872				height: [0, '%height%'],
873				opacity: [0, 1]
874			}
875		},
876
877		'slideUp': {
878			type: 'boxes',
879			boxes: {
880				cols: 1,
881				rows: 1
882			},
883			direction: 'right',
884			delay: 200,
885			properties: {
886				top: ['%height%', 0],
887				opacity: [0, 1]
888			}
889		},
890
891		'slideLeft': {
892			type: 'boxes',
893			boxes: {
894				cols: 1,
895				rows: 1
896			},
897			direction: 'left',
898			delay: 200,
899			properties: {
900				left: ['-%width%', 0],
901				opacity: [0, 1]
902			}
903		},
904
905		'slideRight': {
906			type: 'boxes',
907			boxes: {
908				cols: 1,
909				rows: 1
910			},
911			direction: 'right',
912			delay: 200,
913			properties: {
914				left: ['%width%', 0],
915				opacity: [0, 1]
916			}
917		},
918
919		'boxesRight': {
920			type: 'boxes',
921			direction: 'right',
922			delay: 6,
923			properties: {
924				width: [0, '%width%'],
925				height: [0, '%height%'],
926				opacity: [0, 1]
927			}
928		},
929
930		'boxesLeft': {
931			type: 'boxes',
932			direction: 'left',
933			delay: 6,
934			properties: {
935				width: [0, '%width%'],
936				height: [0, '%height%'],
937				opacity: [0, 1]
938			}
939		},
940
941		'boxesMirror': {
942			type: 'boxes',
943			direction: 'left',
944			reorder: function(elements){
945				var boxes = [];
946
947				for (var i = 0, j = elements.length - 1; i < elements.length / 2;i++,j--){
948					boxes.push(elements[i]);
949					boxes.push(elements[j]);
950				}
951
952				return $$(boxes);
953			},
954			delay: 6,
955			properties: {
956				opacity: [0, 1],
957				width: [0, '%width%'],
958				height: [0, '%height%']
959			}
960		},
961
962		'boxesRandom': {
963			type: 'boxes',
964			direction: 'right',
965			reorder: function(elements){
966				var boxes = elements;
967
968				boxes.sort(function() {
969					return 0.5 - Math.random();
970				});
971
972				return $$(boxes);
973			},
974			delay: 4,
975			properties: {
976				opacity: [0, 1]
977			}
978		},
979
980		'blindsMirrorIn': {
981			type: 'blinds',
982			direction: 'left',
983			reorder: function(elements){
984				var boxes = [];
985
986				for (var i = 0, j = elements.length - 1; i < elements.length / 2;i++,j--){
987					boxes.push(elements[i]);
988					boxes.push(elements[j]);
989				}
990
991				return $$(boxes);
992			},
993			delay: 50,
994			properties: {
995				opacity: [0, 1],
996				width: [0, '%width%'],
997				height: [0, '%height%']
998			}
999		},
1000
1001		'blindsMirrorOut': {
1002			type: 'blinds',
1003			direction: 'left',
1004			reorder: function(elements){
1005				var boxes = [];
1006
1007				for (var i = 0, j = elements.length - 1; i < elements.length / 2;i++,j--){
1008					boxes.push(elements[i]);
1009					boxes.push(elements[j]);
1010				}
1011
1012				boxes.reverse();
1013
1014				return $$(boxes);
1015			},
1016			delay: 50,
1017			properties: {
1018				opacity: [0, 1],
1019				width: [0, '%width%'],
1020				height: [0, '%height%']
1021			}
1022		},
1023
1024		'blindsRandom': {
1025			type: 'blinds',
1026			direction: 'right',
1027			reorder: function(elements){
1028				var boxes = elements;
1029
1030				boxes.sort(function() {
1031					return 0.5 - Math.random();
1032				});
1033
1034				return $$(boxes);
1035			},
1036			delay: 35,
1037			properties: {
1038				opacity: [0, 1]
1039			}
1040		}
1041
1042	};
1043
1044	for (var animation in animations){
1045		this.RokGallery.Showcase.Animations.prototype.addAnimation(animation, animations[animation]);
1046	}
1047
1048	for (var animation in captionsAnimations){
1049		this.RokGallery.Showcase.CaptionsAnimations.prototype.addAnimation(animation, captionsAnimations[animation]);
1050	}
1051
1052}());

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.