Skip to content
This repository
Browse code

Removed old 3.2.2 file from 3.2.3 update

  • Loading branch information...
commit 0b81650aecaa914d5d915db7ea6699b24b1af50d 1 parent 2badff0
Sam Dunn authored July 08, 2011

Showing 1 changed file with 0 additions and 936 deletions. Show diff stats Hide diff stats

  1. 936  slideshow/js/supersized.3.2.2.js
936  slideshow/js/supersized.3.2.2.js
... ...
@@ -1,936 +0,0 @@
1  
-/*
2  
-
3  
-	Supersized - Fullscreen Slideshow jQuery Plugin
4  
-	Version : 3.2.2
5  
-	Site	: www.buildinternet.com/project/supersized
6  
-	
7  
-	Author	: Sam Dunn
8  
-	Company : One Mighty Roar (www.onemightyroar.com)
9  
-	License : MIT License / GPL License
10  
-	
11  
-*/
12  
-
13  
-(function($){
14  
-
15  
-	/* Place Supersized Elements
16  
-	----------------------------*/
17  
-	$(document).ready(function() {
18  
-		$('body').append('<div id="supersized-loader"></div><ul id="supersized"></ul>');
19  
-	});
20  
-    
21  
-    
22  
-    $.supersized = function(options){
23  
-    	
24  
-    	/* Variables
25  
-		----------------------------*/
26  
-    	var el = '#supersized',
27  
-        	base = this;
28  
-        // Access to jQuery and DOM versions of element
29  
-        base.$el = $(el);
30  
-        base.el = el;
31  
-        vars = $.supersized.vars;
32  
-        // Add a reverse reference to the DOM object
33  
-        base.$el.data("supersized", base);
34  
-        api = base.$el.data('supersized');
35  
-		
36  
-		base.init = function(){
37  
-        	// Combine options and vars
38  
-        	$.supersized.vars = $.extend($.supersized.vars, $.supersized.themeVars);
39  
-        	$.supersized.vars.options = $.extend({},$.supersized.defaultOptions, $.supersized.themeOptions, options);
40  
-            base.options = $.supersized.vars.options;
41  
-            
42  
-            base._build();
43  
-        };
44  
-        
45  
-        
46  
-        /* Build Elements
47  
-		----------------------------*/
48  
-        base._build = function(){
49  
-        	// Add in slide markers
50  
-        	var thisSlide = 0,
51  
-        		slideSet = '',
52  
-				markers = '',
53  
-				markerContent,
54  
-				thumbMarkers = '',
55  
-				thumbImage;
56  
-				
57  
-			while(thisSlide <= base.options.slides.length-1){
58  
-				//Determine slide link content
59  
-				switch(base.options.slide_links){
60  
-					case 'num':
61  
-						markerContent = thisSlide;
62  
-						break;
63  
-					case 'name':
64  
-						markerContent = base.options.slides[thisSlide].title;
65  
-						break;
66  
-					case 'blank':
67  
-						markerContent = '';
68  
-						break;
69  
-				}
70  
-				
71  
-				slideSet = slideSet+'<li class="slide-'+thisSlide+'"></li>';
72  
-				
73  
-				if(thisSlide == base.options.start_slide-1){
74  
-					// Slide links
75  
-					if (base.options.slide_links)markers = markers+'<li class="slide-link-'+thisSlide+' current-slide"><a>'+markerContent+'</a></li>';
76  
-					// Slide Thumbnail Links
77  
-					if (base.options.thumb_links){
78  
-						base.options.slides[thisSlide].thumb ? thumbImage = base.options.slides[thisSlide].thumb : thumbImage = base.options.slides[thisSlide].image;
79  
-						thumbMarkers = thumbMarkers+'<li class="thumb'+thisSlide+' current-thumb"><img src="'+thumbImage+'"/></li>';
80  
-					};
81  
-				}else{
82  
-					// Slide links
83  
-					if (base.options.slide_links) markers = markers+'<li class="slide-link-'+thisSlide+'" ><a>'+markerContent+'</a></li>';
84  
-					// Slide Thumbnail Links
85  
-					if (base.options.thumb_links){
86  
-						base.options.slides[thisSlide].thumb ? thumbImage = base.options.slides[thisSlide].thumb : thumbImage = base.options.slides[thisSlide].image;
87  
-						thumbMarkers = thumbMarkers+'<li class="thumb'+thisSlide+'"><img src="'+thumbImage+'"/></li>';
88  
-					};
89  
-				}
90  
-				thisSlide++;
91  
-			}
92  
-			
93  
-			if (base.options.slide_links) $(vars.slide_list).html(markers);
94  
-			if (base.options.thumb_links && vars.thumb_tray.length){
95  
-				$(vars.thumb_tray).append('<ul id="'+vars.thumb_list.replace('#','')+'">'+thumbMarkers+'</ul>');
96  
-			}
97  
-			
98  
-			$(base.el).append(slideSet);
99  
-			
100  
-			// Add in thumbnails
101  
-			if (base.options.thumbnail_navigation){
102  
-				// Load previous thumbnail
103  
-				vars.current_slide - 1 < 0  ? prevThumb = base.options.slides.length - 1 : prevThumb = vars.current_slide - 1;
104  
-				$(vars.prev_thumb).show().html($("<img/>").attr("src", base.options.slides[prevThumb].image));
105  
-				
106  
-				// Load next thumbnail
107  
-				vars.current_slide == base.options.slides.length - 1 ? nextThumb = 0 : nextThumb = vars.current_slide + 1;
108  
-				$(vars.next_thumb).show().html($("<img/>").attr("src", base.options.slides[nextThumb].image));
109  
-			}
110  
-			
111  
-            base._start(); // Get things started
112  
-        };
113  
-        
114  
-        
115  
-        /* Initialize
116  
-		----------------------------*/
117  
-    	base._start = function(){
118  
-			
119  
-			// Determine if starting slide random
120  
-			if (base.options.start_slide){
121  
-				vars.current_slide = base.options.start_slide - 1;
122  
-			}else{
123  
-				vars.current_slide = Math.floor(Math.random()*base.options.slides.length);	// Generate random slide number
124  
-			}
125  
-			
126  
-			// If links should open in new window
127  
-			var linkTarget = base.options.new_window ? ' target="_blank"' : '';
128  
-			
129  
-			// Set slideshow quality (Supported only in FF and IE, no Webkit)
130  
-			if (base.options.performance == 3){
131  
-				base.$el.addClass('speed'); 		// Faster transitions
132  
-			} else if ((base.options.performance == 1) || (base.options.performance == 2)){
133  
-				base.$el.addClass('quality');	// Higher image quality
134  
-			}
135  
-						
136  
-			// Shuffle slide order if needed		
137  
-			if (base.options.random){
138  
-				arr = base.options.slides;
139  
-				for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x);	// Fisher-Yates shuffle algorithm (jsfromhell.com/array/shuffle)
140  
-			    base.options.slides = arr;
141  
-			}
142  
-			
143  
-			/*-----Load initial set of images-----*/
144  
-	
145  
-			if (base.options.slides.length > 1){
146  
-				// Set previous image
147  
-				vars.current_slide - 1 < 0  ? loadPrev = base.options.slides.length - 1 : loadPrev = vars.current_slide - 1;	// If slide is 1, load last slide as previous
148  
-				var imageLink = (base.options.slides[loadPrev].url) ? "href='" + base.options.slides[loadPrev].url + "'" : "";
149  
-				
150  
-				var imgPrev = $('<img src="'+base.options.slides[loadPrev].image+'"/>');
151  
-				var slidePrev = base.el+' li:eq('+loadPrev+')';
152  
-				imgPrev.appendTo(slidePrev).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading prevslide');
153  
-				
154  
-				imgPrev.load(function(){
155  
-					$(this).data('origWidth', $(this).width()).data('origHeight', $(this).height());
156  
-					base.resizeNow();	// Resize background image
157  
-				});	// End Load
158  
-			} else {
159  
-				// Slideshow turned off if there is only one slide
160  
-				base.options.slideshow = 0;
161  
-			}
162  
-			
163  
-			// Set current image
164  
-			imageLink = (api.getField('url')) ? "href='" + api.getField('url') + "'" : "";
165  
-			var img = $('<img src="'+api.getField('image')+'"/>');
166  
-			
167  
-			var slideCurrent= base.el+' li:eq('+vars.current_slide+')';
168  
-			img.appendTo(slideCurrent).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading activeslide');
169  
-			
170  
-			img.load(function(){
171  
-				base._origDim($(this));
172  
-				base.resizeNow();	// Resize background image
173  
-				base.launch();
174  
-				if( typeof theme != 'undefined' && typeof theme._init == "function" ) theme._init();	// Load Theme
175  
-			});
176  
-			
177  
-			if (base.options.slides.length > 1){
178  
-				// Set next image
179  
-				vars.current_slide == base.options.slides.length - 1 ? loadNext = 0 : loadNext = vars.current_slide + 1;	// If slide is last, load first slide as next
180  
-				imageLink = (base.options.slides[loadNext].url) ? "href='" + base.options.slides[loadNext].url + "'" : "";
181  
-				
182  
-				var imgNext = $('<img src="'+base.options.slides[loadNext].image+'"/>');
183  
-				var slideNext = base.el+' li:eq('+loadNext+')';
184  
-				imgNext.appendTo(slideNext).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading');
185  
-				
186  
-				imgNext.load(function(){
187  
-					$(this).data('origWidth', $(this).width()).data('origHeight', $(this).height());
188  
-					base.resizeNow();	// Resize background image
189  
-				});	// End Load
190  
-			}
191  
-			/*-----End load initial images-----*/
192  
-			
193  
-			//  Hide elements to be faded in
194  
-			base.$el.css('visibility','hidden');
195  
-			$('.load-item').hide();
196  
-			
197  
-    	};
198  
-		
199  
-		
200  
-		/* Launch Supersized
201  
-		----------------------------*/
202  
-		base.launch = function(){
203  
-		
204  
-			base.$el.css('visibility','visible');
205  
-			$('#supersized-loader').remove();		//Hide loading animation
206  
-			
207  
-			// Call theme function for before slide transition
208  
-			if( typeof theme != 'undefined' && typeof theme.beforeAnimation == "function" ) theme.beforeAnimation('next');
209  
-			$('.load-item').show();
210  
-			
211  
-			// Keyboard Navigation
212  
-			if (base.options.keyboard_nav){
213  
-				$(document.documentElement).keyup(function (event) {
214  
-				
215  
-					if(vars.in_animation) return false;		// Abort if currently animating
216  
-					
217  
-					// Left Arrow or Down Arrow
218  
-					if ((event.keyCode == 37) || (event.keyCode == 40)) {
219  
-						clearInterval(vars.slideshow_interval);	// Stop slideshow, prevent buildup
220  
-						base.prevSlide();
221  
-					
222  
-					// Right Arrow or Up Arrow
223  
-					} else if ((event.keyCode == 39) || (event.keyCode == 38)) {
224  
-						clearInterval(vars.slideshow_interval);	// Stop slideshow, prevent buildup
225  
-						base.nextSlide();
226  
-					
227  
-					// Spacebar	
228  
-					} else if (event.keyCode == 32 && !vars.hover_pause) {
229  
-						clearInterval(vars.slideshow_interval);	// Stop slideshow, prevent buildup
230  
-						base.playToggle();
231  
-					}
232  
-				
233  
-				});
234  
-			}
235  
-			
236  
-			// Pause when hover on image
237  
-			if (base.options.slideshow && base.options.pause_hover){
238  
-				$(base.el).hover(function() {
239  
-					if(vars.in_animation) return false;		// Abort if currently animating
240  
-			   			vars.hover_pause = true;	// Mark slideshow paused from hover
241  
-			   			if(!vars.is_paused){
242  
-			   				vars.hover_pause = 'resume';	// It needs to resume afterwards
243  
-			   				base.playToggle();
244  
-			   			}
245  
-			   	}, function() {
246  
-					if(vars.hover_pause == 'resume'){
247  
-						base.playToggle();
248  
-						vars.hover_pause = false;
249  
-					}
250  
-			   	});
251  
-			}
252  
-			
253  
-			if (base.options.slide_links){
254  
-				// Slide marker clicked
255  
-				$(vars.slide_list+'> li').click(function(){
256  
-				
257  
-					index = $(vars.slide_list+'> li').index(this);
258  
-					targetSlide = index + 1;
259  
-					
260  
-					base.goTo(targetSlide);
261  
-					return false;
262  
-					
263  
-				});
264  
-			}
265  
-			
266  
-			// Thumb marker clicked
267  
-			if (base.options.thumb_links){
268  
-				$(vars.thumb_list+'> li').click(function(){
269  
-				
270  
-					index = $(vars.thumb_list+'> li').index(this);
271  
-					targetSlide = index + 1;
272  
-					
273  
-					api.goTo(targetSlide);
274  
-					return false;
275  
-					
276  
-				});
277  
-			}
278  
-			
279  
-			// Start slideshow if enabled
280  
-			if (base.options.slideshow && base.options.slides.length > 1){
281  
-	    		
282  
-	    		// Start slideshow if autoplay enabled
283  
-	    		if (base.options.autoplay && base.options.slides.length > 1){
284  
-	    			vars.slideshow_interval = setInterval(base.nextSlide, base.options.slide_interval);	// Initiate slide interval
285  
-				}else{
286  
-					vars.is_paused = true;	// Mark as paused
287  
-				}
288  
-				
289  
-				//Prevent navigation items from being dragged					
290  
-				$('.load-item img').bind("contextmenu mousedown",function(){
291  
-					return false;
292  
-				});
293  
-								
294  
-			}
295  
-			
296  
-			// Adjust image when browser is resized
297  
-			$(window).resize(function(){
298  
-	    		base.resizeNow();
299  
-			});
300  
-    		
301  
-    	};
302  
-        
303  
-        
304  
-        /* Resize Images
305  
-		----------------------------*/
306  
-		base.resizeNow = function(){
307  
-			
308  
-			return base.$el.each(function() {
309  
-		  		//  Resize each image seperately
310  
-		  		$('img', base.el).each(function(){
311  
-		  			
312  
-					thisSlide = $(this);
313  
-					var ratio = (thisSlide.data('origHeight')/thisSlide.data('origWidth')).toFixed(2);	// Define image ratio
314  
-					
315  
-					// Gather browser size
316  
-					var browserwidth = base.$el.width(),
317  
-						browserheight = base.$el.height(),
318  
-						offset;
319  
-					
320  
-					/*-----Resize Image-----*/
321  
-					if (base.options.fit_always){	// Fit always is enabled
322  
-						if ((browserheight/browserwidth) > ratio){
323  
-							resizeWidth();
324  
-						} else {
325  
-							resizeHeight();
326  
-						}
327  
-					}else{	// Normal Resize
328  
-						if ((browserheight <= base.options.min_height) && (browserwidth <= base.options.min_width)){	// If window smaller than minimum width and height
329  
-						
330  
-							if ((browserheight/browserwidth) > ratio){
331  
-								base.options.fit_landscape && ratio < 1 ? resizeWidth(true) : resizeHeight(true);	// If landscapes are set to fit
332  
-							} else {
333  
-								base.options.fit_portrait && ratio >= 1 ? resizeHeight(true) : resizeWidth(true);		// If portraits are set to fit
334  
-							}
335  
-						
336  
-						} else if (browserwidth <= base.options.min_width){		// If window only smaller than minimum width
337  
-						
338  
-							if ((browserheight/browserwidth) > ratio){
339  
-								base.options.fit_landscape && ratio < 1 ? resizeWidth(true) : resizeHeight();	// If landscapes are set to fit
340  
-							} else {
341  
-								base.options.fit_portrait && ratio >= 1 ? resizeHeight() : resizeWidth(true);		// If portraits are set to fit
342  
-							}
343  
-							
344  
-						} else if (browserheight <= base.options.min_height){	// If window only smaller than minimum height
345  
-						
346  
-							if ((browserheight/browserwidth) > ratio){
347  
-								base.options.fit_landscape && ratio < 1 ? resizeWidth() : resizeHeight(true);	// If landscapes are set to fit
348  
-							} else {
349  
-								base.options.fit_portrait && ratio >= 1 ? resizeHeight(true) : resizeWidth();		// If portraits are set to fit
350  
-							}
351  
-						
352  
-						} else {	// If larger than minimums
353  
-							
354  
-							if ((browserheight/browserwidth) > ratio){
355  
-								base.options.fit_landscape && ratio < 1 ? resizeWidth() : resizeHeight();	// If landscapes are set to fit
356  
-							} else {
357  
-								base.options.fit_portrait && ratio >= 1 ? resizeHeight() : resizeWidth();		// If portraits are set to fit
358  
-							}
359  
-							
360  
-						}
361  
-					}
362  
-					/*-----End Image Resize-----*/
363  
-					
364  
-					
365  
-					/*-----Resize Functions-----*/
366  
-					
367  
-					function resizeWidth(minimum){
368  
-						if (minimum){	// If minimum height needs to be considered
369  
-							if(thisSlide.width() < browserwidth || thisSlide.width() < base.options.min_width ){
370  
-								if (thisSlide.width() * ratio >= base.options.min_height){
371  
-									thisSlide.width(base.options.min_width);
372  
-						    		thisSlide.height(thisSlide.width() * ratio);
373  
-						    	}else{
374  
-						    		resizeHeight();
375  
-						    	}
376  
-						    }
377  
-						}else{
378  
-							if (base.options.min_height >= browserheight && !base.options.fit_landscape){	// If minimum height needs to be considered
379  
-								if (browserwidth * ratio >= base.options.min_height || (browserwidth * ratio >= base.options.min_height && ratio <= 1)){	// If resizing would push below minimum height or image is a landscape
380  
-									thisSlide.width(browserwidth);
381  
-									thisSlide.height(browserwidth * ratio);
382  
-								} else if (ratio > 1){		// Else the image is portrait
383  
-									thisSlide.height(base.options.min_height);
384  
-									thisSlide.width(thisSlide.height() / ratio);
385  
-								} else if (thisSlide.width() < browserwidth) {
386  
-									thisSlide.width(browserwidth);
387  
-						    		thisSlide.height(thisSlide.width() * ratio);
388  
-								}
389  
-							}else{	// Otherwise, resize as normal
390  
-								thisSlide.width(browserwidth);
391  
-								thisSlide.height(browserwidth * ratio);
392  
-							}
393  
-						}
394  
-					};
395  
-					
396  
-					function resizeHeight(minimum){
397  
-						if (minimum){	// If minimum height needs to be considered
398  
-							if(thisSlide.height() < browserheight){
399  
-								if (thisSlide.height() / ratio >= base.options.min_width){
400  
-									thisSlide.height(base.options.min_height);
401  
-									thisSlide.width(thisSlide.height() / ratio);
402  
-								}else{
403  
-									resizeWidth(true);
404  
-								}
405  
-							}
406  
-						}else{	// Otherwise, resized as normal
407  
-							if (base.options.min_width >= browserwidth){	// If minimum width needs to be considered
408  
-								if (browserheight / ratio >= base.options.min_width || ratio > 1){	// If resizing would push below minimum width or image is a portrait
409  
-									thisSlide.height(browserheight);
410  
-									thisSlide.width(browserheight / ratio);
411  
-								} else if (ratio <= 1){		// Else the image is landscape
412  
-									thisSlide.width(base.options.min_width);
413  
-						    		thisSlide.height(thisSlide.width() * ratio);
414  
-								}
415  
-							}else{	// Otherwise, resize as normal
416  
-								thisSlide.height(browserheight);
417  
-								thisSlide.width(browserheight / ratio);
418  
-							}
419  
-						}
420  
-					};
421  
-					
422  
-					/*-----End Resize Functions-----*/
423  
-					
424  
-					if (thisSlide.parents('li').hasClass('image-loading')){
425  
-						$('.image-loading').removeClass('image-loading');
426  
-					}
427  
-					
428  
-					// Horizontally Center
429  
-					if (base.options.horizontal_center){
430  
-						$(this).css('left', (browserwidth - $(this).width())/2);
431  
-					}
432  
-					
433  
-					// Vertically Center
434  
-					if (base.options.vertical_center){
435  
-						$(this).css('top', (browserheight - $(this).height())/2);
436  
-					}
437  
-					
438  
-				});
439  
-				
440  
-				// Basic image drag and right click protection
441  
-				if (base.options.image_protect){
442  
-					
443  
-					$('img', base.el).bind("contextmenu mousedown",function(){
444  
-						return false;
445  
-					});
446  
-				
447  
-				}
448  
-				
449  
-				return false;
450  
-				
451  
-			});
452  
-			
453  
-		};
454  
-        
455  
-        
456  
-        /* Next Slide
457  
-		----------------------------*/
458  
-		base.nextSlide = function(goSlide){
459  
-			
460  
-			if(vars.in_animation || !api.options.slideshow) return false;		// Abort if currently animating
461  
-				else vars.in_animation = true;		// Otherwise set animation marker
462  
-		   
463  
-		    clearInterval(vars.slideshow_interval);	// Stop slideshow
464  
-		    
465  
-		    var slides = base.options.slides,					// Pull in slides array
466  
-				liveslide = base.$el.find('.activeslide');		// Find active slide
467  
-				$('.prevslide').removeClass('prevslide');
468  
-				liveslide.removeClass('activeslide').addClass('prevslide');	// Remove active class & update previous slide
469  
-			
470  
-		   // if ( liveslide.length == 0 ) liveslide = base.$el.find('li:last');	// If end of set, note this is last slide
471  
-		    var nextslide = liveslide.next().length ? liveslide.next() : base.$el.find('li:first'),
472  
-		    	prevslide = base.$el.find('.prevslide');
473  
-			
474  
-			if (goSlide) nextslide = $(base.el+' li:eq('+goSlide+')');
475  
-			
476  
-			// Get the slide number of new slide
477  
-			vars.current_slide + 1 == base.options.slides.length ? vars.current_slide = 0 : vars.current_slide++;
478  
-			
479  
-			// If hybrid mode is on drop quality for transition
480  
-			if (base.options.performance == 1) base.$el.removeClass('quality').addClass('speed');	
481  
-			
482  
-			
483  
-			/*-----Load Image-----*/
484  
-			
485  
-			loadSlide = false;
486  
-			
487  
-			vars.current_slide == base.options.slides.length - 1 ? loadSlide = 0 : loadSlide = vars.current_slide + 1;	// Determine next slide
488  
-			
489  
-			var targetList = base.el+' li:eq('+loadSlide+')';
490  
-			if (!$(targetList).html()){
491  
-				// If links should open in new window
492  
-				var linkTarget = base.options.new_window ? ' target="_blank"' : '';
493  
-				
494  
-				imageLink = (base.options.slides[loadSlide].url) ? "href='" + base.options.slides[loadSlide].url + "'" : "";	// If link exists, build it
495  
-				var img = $('<img src="'+base.options.slides[loadSlide].image+'"/>'); 
496  
-				
497  
-				img.appendTo(targetList).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading').css('visibility','hidden');
498  
-				
499  
-				img.load(function(){
500  
-					base._origDim($(this));
501  
-					base.resizeNow();
502  
-				});	// End Load
503  
-			};
504  
-						
505  
-			// Update thumbnails (if enabled)
506  
-			if (base.options.thumbnail_navigation == 1){
507  
-			
508  
-				// Load previous thumbnail
509  
-				vars.current_slide - 1 < 0  ? prevThumb = base.options.slides.length - 1 : prevThumb = vars.current_slide - 1;
510  
-				$(vars.prev_thumb).html($("<img/>").attr("src", base.options.slides[prevThumb].image));
511  
-			
512  
-				// Load next thumbnail
513  
-				nextThumb = loadSlide;
514  
-				$(vars.next_thumb).html($("<img/>").attr("src", base.options.slides[nextThumb].image));
515  
-				
516  
-			}
517  
-			
518  
-			
519  
-			
520  
-			/*-----End Load Image-----*/
521  
-			
522  
-			
523  
-			// Call theme function for before slide transition
524  
-			if( typeof theme != 'undefined' && typeof theme.beforeAnimation == "function" ) theme.beforeAnimation('next');
525  
-			
526  
-			//Update slide markers
527  
-			if (base.options.slide_links){
528  
-				$('.current-slide').removeClass('current-slide');
529  
-				$(vars.slide_list +'> li' ).eq(vars.current_slide).addClass('current-slide');
530  
-			}
531  
-		    
532  
-		    nextslide.css('visibility','hidden').addClass('activeslide');	// Update active slide
533  
-		    
534  
-	    	switch(base.options.transition){
535  
-	    		case 0: case 'none':	// No transition
536  
-	    		    nextslide.css('visibility','visible');
537  
-	    		    vars.in_animation = false;
538  
-	    		    break;
539  
-	    		case 1: case 'fade':	// Fade
540  
-	    		    nextslide.animate({opacity : 0},0).css('visibility','visible').animate({opacity : 1, avoidTransforms : false}, base.options.transition_speed, function(){ base.afterAnimation(); });
541  
-	    		    break;
542  
-	    		case 2: case 'slideTop':	// Slide Top
543  
-	    		    nextslide.animate({top : -base.$el.height()}, 0 ).css('visibility','visible').animate({ top:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
544  
-	    		    break;
545  
-	    		case 3: case 'slideRight':	// Slide Right
546  
-	    			nextslide.animate({left : base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
547  
-	    			break;
548  
-	    		case 4: case 'slideBottom': // Slide Bottom
549  
-	    			nextslide.animate({top : base.$el.height()}, 0 ).css('visibility','visible').animate({ top:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
550  
-	    			break;
551  
-	    		case 5: case 'slideLeft':  // Slide Left
552  
-	    			nextslide.animate({left : -base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
553  
-	    			break;
554  
-	    		case 6: case 'carouselRight':	// Carousel Right
555  
-	    			nextslide.animate({left : base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
556  
-					liveslide.animate({ left: -base.$el.width(), avoidTransforms : false }, base.options.transition_speed );
557  
-	    			break;
558  
-	    		case 7: case 'carouselLeft':   // Carousel Left
559  
-	    			nextslide.animate({left : -base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
560  
-					liveslide.animate({ left: base.$el.width(), avoidTransforms : false }, base.options.transition_speed );
561  
-	    			break;
562  
-	    	}
563  
-		    return false;	
564  
-		};
565  
-		
566  
-		
567  
-		/* Previous Slide
568  
-		----------------------------*/
569  
-		base.prevSlide = function(goSlide){
570  
-		
571  
-			if(vars.in_animation || !api.options.slideshow) return false;		// Abort if currently animating
572  
-				else vars.in_animation = true;		// Otherwise set animation marker
573  
-			
574  
-			clearInterval(vars.slideshow_interval);	// Stop slideshow
575  
-			
576  
-			var slides = base.options.slides,					// Pull in slides array
577  
-				liveslide = base.$el.find('.activeslide');		// Find active slide
578  
-				$('.prevslide').removeClass('prevslide');
579  
-				liveslide.removeClass('activeslide').addClass('prevslide');		// Remove active class & update previous slide
580  
-				
581  
-		    var nextslide =  liveslide.prev().length ? liveslide.prev() : base.$el.find('li:last'),
582  
-		    	prevslide =  base.$el.find('.prevslide');
583  
-				
584  
-			if (goSlide){
585  
-				goSlide--;
586  
-				nextslide = $(base.el+' li:eq('+goSlide+')');
587  
-			}
588  
-			
589  
-			// Get current slide number
590  
-			vars.current_slide == 0 ?  vars.current_slide = base.options.slides.length - 1 : vars.current_slide-- ;
591  
-			
592  
-			// If hybrid mode is on drop quality for transition
593  
-			if (base.options.performance == 1) base.$el.removeClass('quality').addClass('speed');	
594  
-			
595  
-			
596  
-			/*-----Load Image-----*/
597  
-			
598  
-			loadSlide = false;
599  
-			
600  
-			vars.current_slide - 1 < 0  ? loadSlide = base.options.slides.length - 1 : loadSlide = vars.current_slide - 1;	// Determine next slide
601  
-			var targetList = base.el+' li:eq('+loadSlide+')';
602  
-			if (!$(targetList).html()){
603  
-				// If links should open in new window
604  
-				var linkTarget = base.options.new_window ? ' target="_blank"' : '';
605  
-				imageLink = (base.options.slides[loadSlide].url) ? "href='" + base.options.slides[loadSlide].url + "'" : "";	// If link exists, build it
606  
-				var img = $('<img src="'+base.options.slides[loadSlide].image+'"/>'); 
607  
-				
608  
-				img.appendTo(targetList).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading').css('visibility','hidden');
609  
-				
610  
-				img.load(function(){
611  
-					base._origDim($(this));
612  
-					base.resizeNow();
613  
-				});	// End Load
614  
-			};
615  
-			
616  
-			// Update thumbnails (if enabled)
617  
-			if (base.options.thumbnail_navigation == 1){
618  
-			
619  
-				// Load previous thumbnail
620  
-				prevThumb = loadSlide;
621  
-				$(vars.prev_thumb).html($("<img/>").attr("src", base.options.slides[prevThumb].image));
622  
-				
623  
-				// Load next thumbnail
624  
-				vars.current_slide == base.options.slides.length - 1 ? nextThumb = 0 : nextThumb = vars.current_slide + 1;
625  
-				$(vars.next_thumb).html($("<img/>").attr("src", base.options.slides[nextThumb].image));
626  
-			}
627  
-			
628  
-			/*-----End Load Image-----*/
629  
-			
630  
-			
631  
-			// Call theme function for before slide transition
632  
-			if( typeof theme != 'undefined' && typeof theme.beforeAnimation == "function" ) theme.beforeAnimation('prev');
633  
-			
634  
-			//Update slide markers
635  
-			if (base.options.slide_links){
636  
-				$('.current-slide').removeClass('current-slide');
637  
-				$(vars.slide_list +'> li' ).eq(vars.current_slide).addClass('current-slide');
638  
-			}
639  
-			
640  
-		    nextslide.css('visibility','hidden').addClass('activeslide');	// Update active slide
641  
-		    
642  
-		    switch(base.options.transition){
643  
-	    		case 0: case 'none':	// No transition
644  
-	    		    nextslide.css('visibility','visible'); vars.in_animation = false; base.afterAnimation();
645  
-	    		    break;
646  
-	    		case 1: case 'fade':	// Fade
647  
-	    		  	nextslide.animate({opacity : 0},0).css('visibility','visible').animate({opacity : 1, avoidTransforms : false}, base.options.transition_speed, function(){ base.afterAnimation(); });
648  
-	    		    break;
649  
-	    		case 2: case 'slideTop':	// Slide Top (reverse)
650  
-	    		    nextslide.animate({top : base.$el.height()}, 0 ).css('visibility','visible').animate({ top:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
651  
-	    		    break;
652  
-	    		case 3: case 'slideRight':	// Slide Right (reverse)
653  
-	    			nextslide.animate({left : -base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
654  
-	    			break;
655  
-	    		case 4: case 'slideBottom': // Slide Bottom (reverse)
656  
-	    			nextslide.animate({top : -base.$el.height()}, 0 ).css('visibility','visible').animate({ top:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
657  
-	    			break;
658  
-	    		case 5: case 'slideLeft':  // Slide Left (reverse)
659  
-	    			nextslide.animate({left : base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
660  
-	    			break;
661  
-	    		case 6: case 'carouselRight':	// Carousel Right (reverse)
662  
-	    			nextslide.animate({left : -base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
663  
-					liveslide.animate({left : 0}, 0 ).animate({ left: base.$el.width(), avoidTransforms : false}, base.options.transition_speed );
664  
-	    			break;
665  
-	    		case 7: case 'carouselLeft':   // Carousel Left (reverse)
666  
-	    			nextslide.animate({left : base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); });
667  
-					liveslide.animate({left : 0}, 0 ).animate({ left: -base.$el.width(), avoidTransforms : false }, base.options.transition_speed );
668  
-	    			break;
669  
-	    	}
670  
-		    return false;	
671  
-		};
672  
-		
673  
-		
674  
-		/* Play/Pause Toggle
675  
-		----------------------------*/
676  
-		base.playToggle = function(){
677  
-		
678  
-			if (vars.in_animation || !api.options.slideshow) return false;		// Abort if currently animating
679  
-			
680  
-			if (vars.is_paused){
681  
-				
682  
-				vars.is_paused = false;
683  
-				
684  
-				// Call theme function for play
685  
-				if( typeof theme != 'undefined' && typeof theme.playToggle == "function" ) theme.playToggle('play');
686  
-				
687  
-				// Resume slideshow
688  
-	        	vars.slideshow_interval = setInterval(base.nextSlide, base.options.slide_interval);
689  
-	        	  
690  
-        	}else{
691  
-        		
692  
-        		vars.is_paused = true;
693  
-        		
694  
-        		// Call theme function for pause
695  
-        		if( typeof theme != 'undefined' && typeof theme.playToggle == "function" ) theme.playToggle('pause');
696  
-        		
697  
-        		// Stop slideshow
698  
-        		clearInterval(vars.slideshow_interval);	
699  
-       		
700  
-       		}
701  
-		    
702  
-		    return false;
703  
-    		
704  
-    	};
705  
-    	
706  
-    	
707  
-    	/* Go to specific slide
708  
-		----------------------------*/
709  
-    	base.goTo = function(targetSlide){
710  
-			if (vars.in_animation || !api.options.slideshow) return false;		// Abort if currently animating
711  
-			
712  
-			var totalSlides = base.options.slides.length;
713  
-			
714  
-			// If target outside range
715  
-			if(targetSlide < 0){
716  
-				targetSlide = totalSlides;
717  
-			}else if(targetSlide > totalSlides){
718  
-				targetSlide = 1;
719  
-			}
720  
-			targetSlide = totalSlides - targetSlide + 1;
721  
-			
722  
-			clearInterval(vars.slideshow_interval);	// Stop slideshow, prevent buildup
723  
-			
724  
-			// Call theme function for goTo trigger
725  
-			if (typeof theme != 'undefined' && typeof theme.goTo == "function" ) theme.goTo();
726  
-			
727  
-			if (vars.current_slide == totalSlides - targetSlide){
728  
-				if(!(vars.is_paused)){
729  
-					vars.slideshow_interval = setInterval(base.nextSlide, base.options.slide_interval);
730  
-				} 
731  
-				return false;
732  
-			}
733  
-			
734  
-			// If ahead of current position
735  
-			if(totalSlides - targetSlide > vars.current_slide ){
736  
-				
737  
-				// Adjust for new next slide
738  
-				vars.current_slide = totalSlides-targetSlide-1;
739  
-				vars.update_images = 'next';
740  
-				base._placeSlide(vars.update_images);
741  
-				
742  
-			//Otherwise it's before current position
743  
-			}else if(totalSlides - targetSlide < vars.current_slide){
744  
-				
745  
-				// Adjust for new prev slide
746  
-				vars.current_slide = totalSlides-targetSlide+1;
747  
-				vars.update_images = 'prev';
748  
-			    base._placeSlide(vars.update_images);
749  
-			    
750  
-			}
751  
-			
752  
-			// set active markers
753  
-			if (base.options.slide_links){
754  
-				$(vars.slide_list +'> .current-slide').removeClass('current-slide');
755  
-				$(vars.slide_list +'> li').eq((totalSlides-targetSlide)).addClass('current-slide');
756  
-			}
757  
-			
758  
-			if (base.options.thumb_links){
759  
-				$(vars.thumb_list +'> .current-thumb').removeClass('current-thumb');
760  
-				$(vars.thumb_list +'> li').eq((totalSlides-targetSlide)).addClass('current-thumb');
761  
-			}
762  
-			
763  
-		};
764  
-        
765  
-        
766  
-        /* Place Slide
767  
-		----------------------------*/
768  
-        base._placeSlide = function(place){
769  
-    			
770  
-			// If links should open in new window
771  
-			var linkTarget = base.options.new_window ? ' target="_blank"' : '';
772  
-			
773  
-			loadSlide = false;
774  
-			
775  
-			if (place == 'next'){
776  
-				
777  
-				vars.current_slide == base.options.slides.length - 1 ? loadSlide = 0 : loadSlide = vars.current_slide + 1;	// Determine next slide
778  
-				
779  
-				var targetList = base.el+' li:eq('+loadSlide+')';
780  
-				
781  
-				if (!$(targetList).html()){
782  
-					// If links should open in new window
783  
-					var linkTarget = base.options.new_window ? ' target="_blank"' : '';
784  
-					
785  
-					imageLink = (base.options.slides[loadSlide].url) ? "href='" + base.options.slides[loadSlide].url + "'" : "";	// If link exists, build it
786  
-					var img = $('<img src="'+base.options.slides[loadSlide].image+'"/>'); 
787  
-					
788  
-					img.appendTo(targetList).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading').css('visibility','hidden');
789  
-					
790  
-					img.load(function(){
791  
-						base._origDim($(this));
792  
-						base.resizeNow();
793  
-					});	// End Load
794  
-				};
795  
-				
796  
-				base.nextSlide(loadSlide);
797  
-				
798  
-			}else if (place == 'prev'){
799  
-			
800  
-				vars.current_slide - 1 < 0  ? loadSlide = base.options.slides.length - 1 : loadSlide = vars.current_slide - 1;	// Determine next slide
801  
-				
802  
-				var targetList = base.el+' li:eq('+loadSlide+')';
803  
-				
804  
-				if (!$(targetList).html()){
805  
-					// If links should open in new window
806  
-					var linkTarget = base.options.new_window ? ' target="_blank"' : '';
807  
-					
808  
-					imageLink = (base.options.slides[loadSlide].url) ? "href='" + base.options.slides[loadSlide].url + "'" : "";	// If link exists, build it
809  
-					var img = $('<img src="'+base.options.slides[loadSlide].image+'"/>'); 
810  
-					
811  
-					img.appendTo(targetList).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading').css('visibility','hidden');
812  
-					
813  
-					img.load(function(){
814  
-						base._origDim($(this));
815  
-						base.resizeNow();
816  
-					});	// End Load
817  
-				};
818  
-				base.prevSlide(loadSlide+1);
819  
-			}
820  
-			
821  
-		};
822  
-		
823  
-		
824  
-		/* Get Original Dimensions
825  
-		----------------------------*/
826  
-		base._origDim = function(targetSlide){
827  
-			targetSlide.data('origWidth', targetSlide.width()).data('origHeight', targetSlide.height());
828  
-		};
829  
-		
830  
-		
831  
-		/* After Slide Animation
832  
-		----------------------------*/
833  
-		base.afterAnimation = function(){
834  
-			
835  
-			// If hybrid mode is on swap back to higher image quality
836  
-			if (base.options.performance == 1){
837  
-		    	base.$el.removeClass('speed').addClass('quality');
838  
-			}
839  
-			
840  
-			// Update previous slide
841  
-			if (vars.update_images){
842  
-				vars.current_slide - 1 < 0  ? setPrev = base.options.slides.length - 1 : setPrev = vars.current_slide - 1;
843  
-				vars.update_images = false;
844  
-				$('.prevslide').removeClass('prevslide');
845  
-				$(base.el+' li:eq('+setPrev+')').addClass('prevslide');
846  
-			}
847  
-			
848  
-			vars.in_animation = false;
849  
-			
850  
-			// Resume slideshow
851  
-			if (!vars.is_paused && base.options.slideshow){
852  
-				vars.slideshow_interval = setInterval(base.nextSlide, base.options.slide_interval);
853  
-				if (base.options.stop_loop && vars.current_slide == base.options.slides.length - 1 ) base.playToggle();
854  
-			}
855  
-			
856  
-			// Call theme function for after slide transition
857  
-			if (typeof theme != 'undefined' && typeof theme.afterAnimation == "function" ) theme.afterAnimation();
858  
-			
859  
-			return false;
860  
-		
861  
-		};
862  
-		
863  
-		base.getField = function(field){
864  
-			return base.options.slides[vars.current_slide][field];
865  
-		};
866  
-		
867  
-        // Make it go!
868  
-        base.init();
869  
-	};
870  
-	
871  
-	
872  
-	/* Global Variables
873  
-	----------------------------*/
874  
-	$.supersized.vars = {
875  
-	
876  
-		// Elements							
877  
-		thumb_tray			:	'#thumb-tray',	// Thumbnail tray
878  
-		thumb_list			:	'#thumb-list',	// Thumbnail list
879  
-		slide_list          :   '#slide-list',	// Slide link list
880  
-		
881  
-		// Internal variables
882  
-		current_slide			:	0,			// Current slide number
883  
-		in_animation 			:	false,		// Prevents animations from stacking
884  
-		is_paused 				: 	false,		// Tracks paused on/off
885  
-		hover_pause				:	false,		// If slideshow is paused from hover
886  
-		slideshow_interval		:	false,		// Stores slideshow timer					
887  
-		update_images 			: 	false,		// Trigger to update images after slide jump
888  
-		options					:	{}			// Stores assembled options list
889  
-		
890  
-	};
891  
-	
892  
-	
893  
-	/* Default Options
894  
-	----------------------------*/
895  
-	$.supersized.defaultOptions = {
896  
-    
897  
-    	// Functionality
898  
-		slideshow               :   1,			// Slideshow on/off
899  
-		autoplay				:	1,			// Slideshow starts playing automatically
900  
-		start_slide             :   1,			// Start slide (0 is random)
901  
-		stop_loop				:	0,			// Stops slideshow on last slide
902  
-		random					: 	0,			// Randomize slide order (Ignores start slide)
903  
-		slide_interval          :   5000,		// Length between transitions
904  
-		transition              :   1, 			// 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
905  
-		transition_speed		:	750,		// Speed of transition
906  
-		new_window				:	1,			// Image links open in new window/tab
907  
-		pause_hover             :   0,			// Pause slideshow on hover
908  
-		keyboard_nav            :   1,			// Keyboard navigation on/off
909  
-		performance				:	1,			// 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed //  (Only works for Firefox/IE, not Webkit)
910  
-		image_protect			:	1,			// Disables image dragging and right click with Javascript
911  
-												   
912  
-		// Size & Position
913  
-		fit_always				:	0,			// Image will never exceed browser width or height (Ignores min. dimensions)
914  
-		fit_landscape			:   0,			// Landscape images will not exceed browser width
915  
-		fit_portrait         	:   1,			// Portrait images will not exceed browser height  			   
916  
-		min_width		        :   0,			// Min width allowed (in pixels)
917  
-		min_height		        :   0,			// Min height allowed (in pixels)
918  
-		horizontal_center       :   1,			// Horizontally center background
919  
-		vertical_center         :   1,			// Vertically center background
920  
-		
921  
-												   
922  
-		// Components							
923  
-		slide_links				:	1,			// Individual links for each slide	
924  
-		thumb_links				:	1,			// Individual thumb links for each slide
925  
-		thumbnail_navigation    :   0			// Thumbnail navigation
926  
-    	
927  
-    };
928  
-    
929  
-    $.fn.supersized = function(options){
930  
-        return this.each(function(){
931  
-            (new $.supersized(options));
932  
-        });
933  
-    };
934  
-		
935  
-})(jQuery);
936  
-

0 notes on commit 0b81650

Please sign in to comment.
Something went wrong with that request. Please try again.