# HG changeset patch # User Chris Ridgway # Date 1321335134 21600 # Node ID 8bda0ec405e491f3c5fe3aa80963a4a2c598ece2 # Parent f8b32ce38533f56a63d564c426c1cf62edd2ef8d# Parent c3b4884fe4ea9e005eda745a88c3260c6e15b1c5 Merged experimental band ui branch to default. diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/bands/fixtures/bands.json --- a/bns_website/bands/fixtures/bands.json Mon Nov 14 20:06:58 2011 -0600 +++ b/bns_website/bands/fixtures/bands.json Mon Nov 14 23:32:14 2011 -0600 @@ -6,6 +6,7 @@ "url": "http://www.myspace.com/elsupernaut", "notes": "El Supernaut is a new band from Finland (the home of the legendary Laika & the Cosmonauts) that grew out of another surf/instro band, the Lunatics. The band members\u2019 prior experience was obvious in their confident and powerful debut \u201cViva!,\u201d released in early 2011 and packed full of stunning musicianship. El Supernaut have a deep love for the hard rock of the 1970s and 1980s, which they freely incorporate into their sound. As their slogan says, pure instro rock!", "name": "El Supernaut", + "asset_prefix": "elsupernaut", "order": 0 } }, @@ -15,7 +16,8 @@ "fields": { "url": "http://www.twang-marvels.de/", "notes": "Los Twang! Marvels, based in Berlin, Germany, has an Argentinian lead guitarist (who was taught by King Crimson\u2019s Robert Fripp!), and Chilean rhythm guitarist (also taught by Fripp!) and drummer. Their diverse backgrounds result in an exotic sound that is full of passion, virtuosity, precision, and fun, all in evidence on their two full-length CDs: 2005\u2019s debut, \u201cGuitars in Orbit\u201d and 2008\u2019s epic, \u201cJungle of Twang.\u201d They have toured throughout Europe and Mexico.", - "name": "Los Twang! Marvels", + "name": "Los Twang! Marvels", + "asset_prefix": "lostwangmarvels", "order": 1 } }, @@ -25,7 +27,8 @@ "fields": { "url": "http://www.elray.dk/", "notes": "El Ray is a Danish band with a diverse approach to surf music, reflecting their alternative rock influences. They just celebrated their 10th anniversary, having had a highly productive career so far with four CDs and one best-of compilation. Their most recent release is the phenomenal \u201cChasing Ray\u201d from 2010. El Ray have toured much of Europe, making a particularly strong impression with their appearance at 2010\u2019s Surfer Joe Festival in Livorno, Italy.", - "name": "El Ray", + "name": "El Ray", + "asset_prefix": "el_ray", "order": 2 } }, @@ -36,6 +39,7 @@ "url": "http://www.coffindaggers.com/", "notes": "The Coffin Daggers emerged from New York City\u2019s punk scene. Not surprisingly, their take on surf music is marked by a metropolitan attitude and a gritty toughness. They have released two CDs, 2011\u2019s hard-hitting and diverse \u201dMonsters from the ID\u201d being their most recent, notable for being recorded and mixed on tape \u2013 a true rarity today in any genre. The band toured Europe in 2005 and twice in 2006. Since then, they have been regularly criss-crossing the US, picking up fans far and wide.", "name": "The Coffin Daggers", + "asset_prefix": "coffindaggers", "order": 3 } }, @@ -45,7 +49,7 @@ "fields": { "url": "http://www.aqualads.com/", "notes": "Aqualads, based in Charlotte, NC, have been together since 1997. They released three CDs between 1998 and 2004, chock full of traditional surf: \u201cHotbox,\u201d \u201cRevenge,\u201d and \u201cSurf Surf Surf.\u201d After some downtime, they returned with a vengeance in 2011 with the astonishing \u201cTreasures\u201d (produced by Rick Miller of Southern Culture on the Skids), which firmly established them as one of the hottest American surf bands today. They are now playing throughout the South, hell-bent on making up for the lost time.", - "name": "Aqualads", + "name": "Aqualads", "order": 4 } }, @@ -75,7 +79,8 @@ "fields": { "url": "http://www.atomicmosquitos.com/", "notes": "Atomic Mosquitos were inspired by their Washington, DC predecessors, Insect Surfers and The Space Cossacks, along with many others, when they formed in 2000. Since then, they have released three CDs: 2002\u2019s self-titled debut, 2005\u2019s \u201cRelease the Mosquitos,\u201d and 2008\u2019s \u201cMeltdown.\u201d Through the years they evolved a distinctive complex-yet-tight sound marked by the contrasting styles of their two lead guitar players and three songwriters. Though they primarily play on the central East Coast, they did venture out west for an appearance at the 2010 SG101 Convention in Los Alamitos, CA.", - "name": "Atomic Mosquitos", + "name": "Atomic Mosquitos", + "asset_prefix": "atomic_mosquitos", "order": 7 } }, @@ -145,7 +150,8 @@ "fields": { "url": "http://themadeira.net/", "notes": "The Madeira is based out of Indianapolis, IN and has been around since 2004, releasing two CDs with a third on the way. They\u2019ve played all around the US, including two California tours as well as shows on the East Coast and in the South, but primarily play around the Midwest. They headlined the third night of the 2009 Surfer Joe Festival, followed by an Italian tour. Their 2008 CD, \u201cCarpe Noctem,\u201d was selected Album of the Year by Pipeline magazine.", - "name": "The Madeira", + "name": "The Madeira", + "asset_prefix": "madeira", "order": 14 } }, @@ -176,6 +182,7 @@ "url": "http://www.reverbnation.com/thedeadbeats63", "notes": "The Deadbeats have the distinction of being the youngest band on this compilation, all four of them currently in their early 20s. Their mix of youthful energy and highly skilled musicianship has made them a popular draw in teen punk clubs around the San Francisco Bay area for the past few years. Their inspired and impressive debut mini-CD \u201cDay of the Deadbeats\u201d came out this past summer, and they subsequently blew everyone away at the SG101 Convention with a performance that is sure to go down in legend.", "name": "The Deadbeats", + "asset_prefix": "deadbeats", "order": 17 } }, @@ -186,6 +193,7 @@ "url": "http://daikaiju.org/", "notes": "Daikaiju have been forging a radically new and futuristic path in surf music since forming in 1999 in Alabama. The very embodiment of progressive surf music, they recognize no boundaries and are fearless about introducing a diverse set of influences \u2013 from Rush to My Bloody Valentine\u2013 into their highly personal musical vision. The out-of-this world results can be heard on 2004\u2019s self-titled debut and its remarkable 2010 follow-up, \u201cPhase 2.\u201d They have toured Europe twice, and in the last couple of years began touring the US heavily, averaging 200-250 shows each year. Their live shows are pure performance art, incorporating theatrical and even confrontational elements, the band wearing kabuki masks and sci-fi uniforms, and spending more time running among and interacting with the audience than on stage!", "name": "Daikaiju", + "asset_prefix": "daikaiju", "order": 18 } }, diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/bands/models.py --- a/bns_website/bands/models.py Mon Nov 14 20:06:58 2011 -0600 +++ b/bns_website/bands/models.py Mon Nov 14 23:32:14 2011 -0600 @@ -13,6 +13,7 @@ name = models.CharField(max_length=128) url = models.URLField(verify_exists=False, max_length=200) notes = models.TextField() + asset_prefix = models.CharField(max_length=64, blank=True) order = models.IntegerField(default=0) class Meta: diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/css/base.css --- a/bns_website/static/css/base.css Mon Nov 14 20:06:58 2011 -0600 +++ b/bns_website/static/css/base.css Mon Nov 14 23:32:14 2011 -0600 @@ -28,10 +28,10 @@ /* ----------------------------------------------- -New Styles +News Styles ----------------------------------------------- */ article.news { margin-bottom: 2em; border-top: 2px solid DimGray; /* some other gray color might be better */ -} \ No newline at end of file +} diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/css/bx_styles.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/static/css/bx_styles.css Mon Nov 14 23:32:14 2011 -0600 @@ -0,0 +1,104 @@ +/* + * To change the color scheme of slider change each + * background property for each of the five styles below + */ + +/*next button*/ +.bx-next { + position:absolute; + top:40%; + right:-50px; + z-index:999; + width: 30px; + height: 30px; + text-indent: -999999px; + background: url(../images/gray_next.png) no-repeat 0 -30px; +} + +/*previous button*/ +.bx-prev { + position:absolute; + top:40%; + left:-50px; + z-index:999; + width: 30px; + height: 30px; + text-indent: -999999px; + background: url(../images/gray_prev.png) no-repeat 0 -30px; +} + +/*pager links*/ +.bx-pager a { + margin-right: 5px; + color: #fff; + padding: 3px 8px 3px 6px; + font-size: 12px; + zoom:1; + background: url(../images/gray_pager.png) no-repeat 0 -20px; +} + +/*auto start button*/ +.bx-auto .start { + background: url(../images/gray_auto.png) no-repeat 0 2px; + padding-left: 13px; +} + +/*auto stop button*/ +.bx-auto .stop { + background: url(../images/gray_auto.png) no-repeat 0 -14px; + padding-left: 13px; +} + +/* + * End color scheme styles + */ + + +/*next/prev button hover state*/ +.bx-next:hover, +.bx-prev:hover { + background-position: 0 0; +} + +/*pager links hover and active states*/ +.bx-pager .pager-active, +.bx-pager a:hover { + background-position: 0 0; +} + +/*pager wrapper*/ +.bx-pager { + text-align:center; + padding-top: 7px; + font-size:12px; + color:#666; +} + +/*captions*/ +.bx-captions { + text-align:center; + font-size: 12px; + padding: 7px 0; + color: #666; +} + +/*auto controls*/ +.bx-auto { + text-align: center; + padding-top: 7px; +} + +.bx-auto a { + color: #666; + font-size: 12px; +} + + + + + + + + + + diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/atomic_mosquitos_large.jpg Binary file bns_website/static/images/bands/atomic_mosquitos_large.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/atomic_mosquitos_small.jpg Binary file bns_website/static/images/bands/atomic_mosquitos_small.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/coffindaggers_large.jpg Binary file bns_website/static/images/bands/coffindaggers_large.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/coffindaggers_small.jpg Binary file bns_website/static/images/bands/coffindaggers_small.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/daikaiju_large.jpg Binary file bns_website/static/images/bands/daikaiju_large.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/daikaiju_small.jpg Binary file bns_website/static/images/bands/daikaiju_small.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/deadbeats_large.jpg Binary file bns_website/static/images/bands/deadbeats_large.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/deadbeats_small.jpg Binary file bns_website/static/images/bands/deadbeats_small.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/el_ray_large.jpg Binary file bns_website/static/images/bands/el_ray_large.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/el_ray_small.jpg Binary file bns_website/static/images/bands/el_ray_small.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/elsupernaut_large.jpg Binary file bns_website/static/images/bands/elsupernaut_large.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/elsupernaut_small.jpg Binary file bns_website/static/images/bands/elsupernaut_small.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/los_kahunas_large.jpg Binary file bns_website/static/images/bands/los_kahunas_large.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/los_kahunas_small.jpg Binary file bns_website/static/images/bands/los_kahunas_small.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/lostwangmarvels_large.jpg Binary file bns_website/static/images/bands/lostwangmarvels_large.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/lostwangmarvels_small.jpg Binary file bns_website/static/images/bands/lostwangmarvels_small.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/madeira_large.jpg Binary file bns_website/static/images/bands/madeira_large.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/bands/madeira_small.jpg Binary file bns_website/static/images/bands/madeira_small.jpg has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/gray_auto.png Binary file bns_website/static/images/gray_auto.png has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/gray_next.png Binary file bns_website/static/images/gray_next.png has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/gray_pager.png Binary file bns_website/static/images/gray_pager.png has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/images/gray_prev.png Binary file bns_website/static/images/gray_prev.png has changed diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/js/bxslider/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/static/js/bxslider/README Mon Nov 14 23:32:14 2011 -0600 @@ -0,0 +1,8 @@ +jQuery bxSlider v3.0 +http://bxslider.com + +Copyright 2011, Steven Wanderski +http://bxcreative.com + +Free to use and abuse under the MIT license. +http://www.opensource.org/licenses/mit-license.php \ No newline at end of file diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/js/bxslider/jquery.bxSlider.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/static/js/bxslider/jquery.bxSlider.min.js Mon Nov 14 23:32:14 2011 -0600 @@ -0,0 +1,12 @@ +/** + * jQuery bxSlider v3.0 + * http://bxslider.com + * + * Copyright 2010, Steven Wanderski + * http://bxcreative.com + * + * Free to use and abuse under the MIT license. + * http://www.opensource.org/licenses/mit-license.php + * + */ +(function(a){a.fn.bxSlider=function(b){function Z(b,c,d,e){var f=[];var g=d;var h=false;if(e=="backward"){b=a.makeArray(b);b.reverse()}while(g>0){a.each(b,function(b,d){if(g>0){if(!h){if(b==c){h=true;f.push(a(this).clone());g--}}else{f.push(a(this).clone());g--}}else{return false}})}return f}function Y(){var a=i.outerHeight()*b.displaySlideQty;return a}function X(){var a=i.outerWidth()*b.displaySlideQty;return a}function W(b,c){if(c=="left"){var d=a(".pager",h).eq(b).position().left}else if(c=="top"){var d=a(".pager",h).eq(b).position().top}return d}function V(){if(!b.infiniteLoop&&b.hideControlOnEnd){if(x==F){a(".bx-prev",h).hide()}else{a(".bx-prev",h).show()}if(x==G){a(".bx-next",h).hide()}else{a(".bx-next",h).show()}}}function U(c,e,f,g){p=a('');if(c=="text"){r=e}else{r=''}if(f=="text"){s=g}else{s=''}if(b.autoControlsSelector){a(b.autoControlsSelector).append(p)}else{h.append('
');a(".bx-auto",h).html(p)}p.click(function(){if(b.ticker){if(a(this).hasClass("stop")){d.stopTicker()}else if(a(this).hasClass("start")){d.startTicker()}}else{if(a(this).hasClass("stop")){d.stopShow(true)}else if(a(this).hasClass("start")){d.startShow(true)}}return false})}function T(){var c=a("img",g.eq(x)).attr("title");if(c!=""){if(b.captionsSelector){a(b.captionsSelector).html(c)}else{a(".bx-captions",h).html(c)}}else{if(b.captionsSelector){a(b.captionsSelector).html(" ")}else{a(".bx-captions",h).html(" ")}}}function S(c){var e=g.length;if(b.moveSlideQty>1){if(g.length%b.moveSlideQty!=0){e=Math.ceil(g.length/b.moveSlideQty)}else{e=g.length/b.moveSlideQty}}var f="";if(b.buildPager){for(var i=0;i'+i+""}}else if(c=="short"){f=''+(b.startingSlide+1)+" "+b.pagerShortSeparator+' '+g.length+""}if(b.pagerSelector){a(b.pagerSelector).append(f);n=a(b.pagerSelector)}else{var j=a('
');j.append(f);if(b.pagerLocation=="top"){h.prepend(j)}else if(b.pagerLocation=="bottom"){h.append(j)}n=a(".bx-pager",h)}n.children().click(function(){if(b.pagerType=="full"){var a=n.children().index(this);if(b.moveSlideQty>1){a*=b.moveSlideQty}d.goToSlide(a)}return false})}function R(c,e,f,g){var i=a('');var j=a('');if(c=="text"){i.html(e)}else{i.html('')}if(f=="text"){j.html(g)}else{j.html('')}if(b.prevSelector){a(b.prevSelector).append(j)}else{h.append(j)}if(b.nextSelector){a(b.nextSelector).append(i)}else{h.append(i)}i.click(function(){d.goToNextSlide();return false});j.click(function(){d.goToPreviousSlide();return false})}function Q(c){if(b.pagerType=="full"&&b.pager){a("a",n).removeClass(b.pagerActiveClass);a("a",n).eq(c).addClass(b.pagerActiveClass)}else if(b.pagerType=="short"&&b.pager){a(".bx-pager-current",n).html(x+1)}}function P(){g.not(":eq("+x+")").fadeTo(b.speed,0).css("zIndex",98);g.eq(x).css("zIndex",99).fadeTo(b.speed,1,function(){E=false;if(jQuery.browser.msie){g.eq(x).get(0).style.removeAttribute("filter")}b.onAfterSlide(x,g.length,g.eq(x))})}function O(){e.hover(function(){if(t){d.stopTicker(false)}},function(){if(t){d.startTicker(false)}})}function N(){h.find(".bx-window").hover(function(){if(t){d.stopShow(false)}},function(){if(t){d.startShow(false)}})}function M(){if(b.startImage!=""){startContent=b.startImage;startType="image"}else{startContent=b.startText;startType="text"}if(b.stopImage!=""){stopContent=b.stopImage;stopType="image"}else{stopContent=b.stopText;stopType="text"}U(startType,startContent,stopType,stopContent)}function L(a,c,d){if(b.mode=="horizontal"){if(b.tickerDirection=="next"){e.animate({left:"-="+c+"px"},d,"linear",function(){e.css("left",a);L(a,A,b.tickerSpeed)})}else if(b.tickerDirection=="prev"){e.animate({left:"+="+c+"px"},d,"linear",function(){e.css("left",a);L(a,A,b.tickerSpeed)})}}else if(b.mode=="vertical"){if(b.tickerDirection=="next"){e.animate({top:"-="+c+"px"},d,"linear",function(){e.css("top",a);L(a,B,b.tickerSpeed)})}else if(b.tickerDirection=="prev"){e.animate({top:"+="+c+"px"},d,"linear",function(){e.css("top",a);L(a,B,b.tickerSpeed)})}}}function K(){if(b.auto){if(!b.infiniteLoop){if(b.autoDirection=="next"){o=setInterval(function(){x+=b.moveSlideQty;if(x>G){x=x%g.length}d.goToSlide(x,false)},b.pause)}else if(b.autoDirection=="prev"){o=setInterval(function(){x-=b.moveSlideQty;if(x<0){negativeOffset=x%g.length;if(negativeOffset==0){x=0}else{x=g.length+negativeOffset}}d.goToSlide(x,false)},b.pause)}}else{if(b.autoDirection=="next"){o=setInterval(function(){d.goToNextSlide(false)},b.pause)}else if(b.autoDirection=="prev"){o=setInterval(function(){d.goToPreviousSlide(false)},b.pause)}}}else if(b.ticker){b.tickerSpeed*=10;a(".pager",h).each(function(b){A+=a(this).width();B+=a(this).height()});if(b.tickerDirection=="prev"&&b.mode=="horizontal"){e.css("left","-"+(A+y)+"px")}else if(b.tickerDirection=="prev"&&b.mode=="vertical"){e.css("top","-"+(B+z)+"px")}if(b.mode=="horizontal"){C=parseInt(e.css("left"));L(C,A,b.tickerSpeed)}else if(b.mode=="vertical"){D=parseInt(e.css("top"));L(D,B,b.tickerSpeed)}if(b.tickerHover){O()}}}function J(){if(b.nextImage!=""){nextContent=b.nextImage;nextType="image"}else{nextContent=b.nextText;nextType="text"}if(b.prevImage!=""){prevContent=b.prevImage;prevType="image"}else{prevContent=b.prevText;prevType="text"}R(nextType,nextContent,prevType,prevContent)}function I(){if(b.mode=="horizontal"||b.mode=="vertical"){var c=Z(g,0,b.moveSlideQty,"backward");a.each(c,function(b){e.prepend(a(this))});var d=g.length+b.moveSlideQty-1;var f=g.length-b.displaySlideQty;var h=d-f;var i=Z(g,0,h,"forward");if(b.infiniteLoop){a.each(i,function(b){e.append(a(this))})}}}function H(){I(b.startingSlide);if(b.mode=="horizontal"){e.wrap('
').wrap('
').css({width:"999999px",position:"relative",left:"-"+y+"px"});e.children().css({width:j,"float":"left",listStyle:"none"});h=e.parent().parent();g.addClass("pager")}else if(b.mode=="vertical"){e.wrap('
').wrap('
').css({height:"999999px",position:"relative",top:"-"+z+"px"});e.children().css({listStyle:"none",height:w});h=e.parent().parent();g.addClass("pager")}else if(b.mode=="fade"){e.wrap('
').wrap('
');e.children().css({listStyle:"none",position:"absolute",top:0,left:0,zIndex:98});h=e.parent().parent();g.not(":eq("+x+")").fadeTo(0,0);g.eq(x).css("zIndex",99)}if(b.captions&&b.captionsSelector==null){h.append('
')}}var c={mode:"horizontal",infiniteLoop:true,hideControlOnEnd:false,controls:true,speed:500,easing:"swing",pager:false,pagerSelector:null,pagerType:"full",pagerLocation:"bottom",pagerShortSeparator:"/",pagerActiveClass:"pager-active",nextText:"next",nextImage:"",nextSelector:null,prevText:"prev",prevImage:"",prevSelector:null,captions:false,captionsSelector:null,auto:false,autoDirection:"next",autoControls:false,autoControlsSelector:null,autoStart:true,autoHover:false,autoDelay:0,pause:3e3,startText:"start",startImage:"",stopText:"stop",stopImage:"",ticker:false,tickerSpeed:5e3,tickerDirection:"next",tickerHover:false,wrapperClass:"bx-wrapper",startingSlide:0,displaySlideQty:1,moveSlideQty:1,randomStart:false,onBeforeSlide:function(){},onAfterSlide:function(){},onLastSlide:function(){},onFirstSlide:function(){},onNextSlide:function(){},onPrevSlide:function(){},buildPager:null};var b=a.extend(c,b);var d=this;var e="";var f="";var g="";var h="";var i="";var j="";var k="";var l="";var m="";var n="";var o="";var p="";var q="";var r="";var s="";var t=true;var u=false;var v=0;var w=0;var x=0;var y=0;var z=0;var A=0;var B=0;var C=0;var D=0;var E=false;var F=0;var G=g.length-1;this.goToSlide=function(a,c){if(!E){E=true;x=a;b.onBeforeSlide(x,g.length,g.eq(x));if(typeof c=="undefined"){var c=true}if(c){if(b.auto){d.stopShow(true)}}slide=a;if(slide==F){b.onFirstSlide(x,g.length,g.eq(x))}if(slide==G){b.onLastSlide(x,g.length,g.eq(x))}if(b.mode=="horizontal"){e.animate({left:"-"+W(slide,"left")+"px"},b.speed,b.easing,function(){E=false;b.onAfterSlide(x,g.length,g.eq(x))})}else if(b.mode=="vertical"){e.animate({top:"-"+W(slide,"top")+"px"},b.speed,b.easing,function(){E=false;b.onAfterSlide(x,g.length,g.eq(x))})}else if(b.mode=="fade"){P()}V();if(b.moveSlideQty>1){a=Math.floor(a/b.moveSlideQty)}Q(a);T()}};this.goToNextSlide=function(a){if(typeof a=="undefined"){var a=true}if(a){if(b.auto){d.stopShow(true)}}if(!b.infiniteLoop){if(!E){var c=false;x=x+b.moveSlideQty;if(x<=G){V();b.onNextSlide(x,g.length,g.eq(x));d.goToSlide(x)}else{x-=b.moveSlideQty}}}else{if(!E){E=true;var c=false;x=x+b.moveSlideQty;if(x>G){x=x%g.length;c=true}b.onNextSlide(x,g.length,g.eq(x));b.onBeforeSlide(x,g.length,g.eq(x));if(b.mode=="horizontal"){var f=b.moveSlideQty*k;e.animate({left:"-="+f+"px"},b.speed,b.easing,function(){E=false;if(c){e.css("left","-"+W(x,"left")+"px")}b.onAfterSlide(x,g.length,g.eq(x))})}else if(b.mode=="vertical"){var h=b.moveSlideQty*w;e.animate({top:"-="+h+"px"},b.speed,b.easing,function(){E=false;if(c){e.css("top","-"+W(x,"top")+"px")}b.onAfterSlide(x,g.length,g.eq(x))})}else if(b.mode=="fade"){P()}if(b.moveSlideQty>1){Q(Math.ceil(x/b.moveSlideQty))}else{Q(x)}T()}}};this.goToPreviousSlide=function(c){if(typeof c=="undefined"){var c=true}if(c){if(b.auto){d.stopShow(true)}}if(!b.infiniteLoop){if(!E){var f=false;x=x-b.moveSlideQty;if(x<0){x=0;if(b.hideControlOnEnd){a(".bx-prev",h).hide()}}V();b.onPrevSlide(x,g.length,g.eq(x));d.goToSlide(x)}}else{if(!E){E=true;var f=false;x=x-b.moveSlideQty;if(x<0){negativeOffset=x%g.length;if(negativeOffset==0){x=0}else{x=g.length+negativeOffset}f=true}b.onPrevSlide(x,g.length,g.eq(x));b.onBeforeSlide(x,g.length,g.eq(x));if(b.mode=="horizontal"){var i=b.moveSlideQty*k;e.animate({left:"+="+i+"px"},b.speed,b.easing,function(){E=false;if(f){e.css("left","-"+W(x,"left")+"px")}b.onAfterSlide(x,g.length,g.eq(x))})}else if(b.mode=="vertical"){var j=b.moveSlideQty*w;e.animate({top:"+="+j+"px"},b.speed,b.easing,function(){E=false;if(f){e.css("top","-"+W(x,"top")+"px")}b.onAfterSlide(x,g.length,g.eq(x))})}else if(b.mode=="fade"){P()}if(b.moveSlideQty>1){Q(Math.ceil(x/b.moveSlideQty))}else{Q(x)}T()}}};this.goToFirstSlide=function(a){if(typeof a=="undefined"){var a=true}d.goToSlide(F,a)};this.goToLastSlide=function(){if(typeof a=="undefined"){var a=true}d.goToSlide(G,a)};this.getCurrentSlide=function(){return x};this.getSlideCount=function(){return g.length};this.stopShow=function(a){clearInterval(o);if(typeof a=="undefined"){var a=true}if(a&&b.autoControls){p.html(r).removeClass("stop").addClass("start");t=false}};this.startShow=function(a){if(typeof a=="undefined"){var a=true}K();if(a&&b.autoControls){p.html(s).removeClass("start").addClass("stop");t=true}};this.stopTicker=function(a){e.stop();if(typeof a=="undefined"){var a=true}if(a&&b.ticker){p.html(r).removeClass("stop").addClass("start");t=false}};this.startTicker=function(a){if(b.mode=="horizontal"){if(b.tickerDirection=="next"){var c=parseInt(e.css("left"));var d=A+c+g.eq(0).width()}else if(b.tickerDirection=="prev"){var c=-parseInt(e.css("left"));var d=c-g.eq(0).width()}var f=d*b.tickerSpeed/A;L(C,d,f)}else if(b.mode=="vertical"){if(b.tickerDirection=="next"){var h=parseInt(e.css("top"));var d=B+h+g.eq(0).height()}else if(b.tickerDirection=="prev"){var h=-parseInt(e.css("top"));var d=h-g.eq(0).height()}var f=d*b.tickerSpeed/B;L(D,d,f);if(typeof a=="undefined"){var a=true}if(a&&b.ticker){p.html(s).removeClass("start").addClass("stop");t=true}}};this.initShow=function(){e=a(this);f=e.clone();g=e.children();h="";i=e.children(":first");j=i.width();v=0;k=i.outerWidth();w=0;l=X();m=Y();E=false;n="";x=0;y=0;z=0;o="";p="";q="";r="";s="";t=true;u=false;A=0;B=0;C=0;D=0;F=0;G=g.length-1;g.each(function(b){if(a(this).outerHeight()>w){w=a(this).outerHeight()}if(a(this).outerWidth()>v){v=a(this).outerWidth()}});if(b.randomStart){var c=Math.floor(Math.random()*g.length);x=c;y=k*(b.moveSlideQty+c);z=w*(b.moveSlideQty+c)}else{x=b.startingSlide;y=k*(b.moveSlideQty+b.startingSlide);z=w*(b.moveSlideQty+b.startingSlide)}H();if(b.pager&&!b.ticker){if(b.pagerType=="full"){S("full")}else if(b.pagerType=="short"){S("short")}}if(b.controls&&!b.ticker){J()}if(b.auto||b.ticker){if(b.autoControls){M()}if(b.autoStart){setTimeout(function(){d.startShow(true)},b.autoDelay)}else{d.stopShow(true)}if(b.autoHover&&!b.ticker){N()}}if(b.moveSlideQty>1){Q(Math.ceil(x/b.moveSlideQty))}else{Q(x)}V();if(b.captions){T()}b.onAfterSlide(x,g.length,g.eq(x))};this.destroyShow=function(){clearInterval(o);a(".bx-next, .bx-prev, .bx-pager, .bx-auto",h).remove();e.unwrap().unwrap().removeAttr("style");e.children().removeAttr("style").not(".pager").remove();g.removeClass("pager")};this.reloadShow=function(){d.destroyShow();d.initShow()};this.each(function(){if(a(this).children().length>0){d.initShow()}});return this};jQuery.fx.prototype.cur=function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var a=parseFloat(jQuery.css(this.elem,this.prop));return a}})(jQuery) \ No newline at end of file diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/js/bxslider/jquery.easing.1.3.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/static/js/bxslider/jquery.easing.1.3.js Mon Nov 14 23:32:14 2011 -0600 @@ -0,0 +1,205 @@ +/* + * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ + * + * Uses the built in easing capabilities added In jQuery 1.1 + * to offer multiple easing options + * + * TERMS OF USE - jQuery Easing + * + * Open source under the BSD License. + * + * Copyright © 2008 George McGinley Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * +*/ + +// t: current time, b: begInnIng value, c: change In value, d: duration +jQuery.easing['jswing'] = jQuery.easing['swing']; + +jQuery.extend( jQuery.easing, +{ + def: 'easeOutQuad', + swing: function (x, t, b, c, d) { + //alert(jQuery.easing.default); + return jQuery.easing[jQuery.easing.def](x, t, b, c, d); + }, + easeInQuad: function (x, t, b, c, d) { + return c*(t/=d)*t + b; + }, + easeOutQuad: function (x, t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + easeInOutQuad: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + easeInCubic: function (x, t, b, c, d) { + return c*(t/=d)*t*t + b; + }, + easeOutCubic: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t + 1) + b; + }, + easeInOutCubic: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + easeInQuart: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + easeOutQuart: function (x, t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + easeInOutQuart: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + easeInQuint: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t*t + b; + }, + easeOutQuint: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + easeInOutQuint: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + easeInSine: function (x, t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + easeOutSine: function (x, t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + easeInOutSine: function (x, t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + easeInExpo: function (x, t, b, c, d) { + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + easeOutExpo: function (x, t, b, c, d) { + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + easeInOutExpo: function (x, t, b, c, d) { + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + easeInElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + easeOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + easeInOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + easeInBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + easeOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + easeInOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + easeInBounce: function (x, t, b, c, d) { + return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; + }, + easeOutBounce: function (x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + easeInOutBounce: function (x, t, b, c, d) { + if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; + return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}); + +/* + * + * TERMS OF USE - EASING EQUATIONS + * + * Open source under the BSD License. + * + * Copyright © 2001 Robert Penner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ \ No newline at end of file diff -r f8b32ce38533 -r 8bda0ec405e4 bns_website/static/js/bxslider/source/jquery.bxSlider.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/static/js/bxslider/source/jquery.bxSlider.js Mon Nov 14 23:32:14 2011 -0600 @@ -0,0 +1,1260 @@ +/** + * jQuery bxSlider v3.0 + * http://bxslider.com + * + * Copyright 2011, Steven Wanderski + * http://bxcreative.com + * + * Free to use and abuse under the MIT license. + * http://www.opensource.org/licenses/mit-license.php + * + */ + + +(function($){ + + $.fn.bxSlider = function(options){ + + var defaults = { + mode: 'horizontal', // 'horizontal', 'vertical', 'fade' + infiniteLoop: true, // true, false - display first slide after last + hideControlOnEnd: false, // true, false - if true, will hide 'next' control on last slide and 'prev' control on first + controls: true, // true, false - previous and next controls + speed: 500, // integer - in ms, duration of time slide transitions will occupy + easing: 'swing', // used with jquery.easing.1.3.js - see http://gsgd.co.uk/sandbox/jquery/easing/ for available options + pager: false, // true / false - display a pager + pagerSelector: null, // jQuery selector - element to contain the pager. ex: '#pager' + pagerType: 'full', // 'full', 'short' - if 'full' pager displays 1,2,3... if 'short' pager displays 1 / 4 + pagerLocation: 'bottom', // 'bottom', 'top' - location of pager + pagerShortSeparator: '/', // string - ex: 'of' pager would display 1 of 4 + pagerActiveClass: 'pager-active', // string - classname attached to the active pager link + nextText: 'next', // string - text displayed for 'next' control + nextImage: '', // string - filepath of image used for 'next' control. ex: 'images/next.jpg' + nextSelector: null, // jQuery selector - element to contain the next control. ex: '#next' + prevText: 'prev', // string - text displayed for 'previous' control + prevImage: '', // string - filepath of image used for 'previous' control. ex: 'images/prev.jpg' + prevSelector: null, // jQuery selector - element to contain the previous control. ex: '#next' + captions: false, // true, false - display image captions (reads the image 'title' tag) + captionsSelector: null, // jQuery selector - element to contain the captions. ex: '#captions' + auto: false, // true, false - make slideshow change automatically + autoDirection: 'next', // 'next', 'prev' - direction in which auto show will traverse + autoControls: false, // true, false - show 'start' and 'stop' controls for auto show + autoControlsSelector: null, // jQuery selector - element to contain the auto controls. ex: '#auto-controls' + autoStart: true, // true, false - if false show will wait for 'start' control to activate + autoHover: false, // true, false - if true show will pause on mouseover + autoDelay: 0, // integer - in ms, the amount of time before starting the auto show + pause: 3000, // integer - in ms, the duration between each slide transition + startText: 'start', // string - text displayed for 'start' control + startImage: '', // string - filepath of image used for 'start' control. ex: 'images/start.jpg' + stopText: 'stop', // string - text displayed for 'stop' control + stopImage: '', // string - filepath of image used for 'stop' control. ex: 'images/stop.jpg' + ticker: false, // true, false - continuous motion ticker mode (think news ticker) + // note: autoControls, autoControlsSelector, and autoHover apply to ticker! + tickerSpeed: 5000, // float - use value between 1 and 5000 to determine ticker speed - the smaller the value the faster the ticker speed + tickerDirection: 'next', // 'next', 'prev' - direction in which ticker show will traverse + tickerHover: false, // true, false - if true ticker will pause on mouseover + wrapperClass: 'bx-wrapper', // string - classname attached to the slider wraper + startingSlide: 0, // integer - show will start on specified slide. note: slides are zero based! + displaySlideQty: 1, // integer - number of slides to display at once + moveSlideQty: 1, // integer - number of slides to move at once + randomStart: false, // true, false - if true show will start on a random slide + onBeforeSlide: function(){}, // function(currentSlideNumber, totalSlideQty, currentSlideHtmlObject) - advanced use only! see the tutorial here: http://bxslider.com/custom-pager + onAfterSlide: function(){}, // function(currentSlideNumber, totalSlideQty, currentSlideHtmlObject) - advanced use only! see the tutorial here: http://bxslider.com/custom-pager + onLastSlide: function(){}, // function(currentSlideNumber, totalSlideQty, currentSlideHtmlObject) - advanced use only! see the tutorial here: http://bxslider.com/custom-pager + onFirstSlide: function(){}, // function(currentSlideNumber, totalSlideQty, currentSlideHtmlObject) - advanced use only! see the tutorial here: http://bxslider.com/custom-pager + onNextSlide: function(){}, // function(currentSlideNumber, totalSlideQty, currentSlideHtmlObject) - advanced use only! see the tutorial here: http://bxslider.com/custom-pager + onPrevSlide: function(){}, // function(currentSlideNumber, totalSlideQty, currentSlideHtmlObject) - advanced use only! see the tutorial here: http://bxslider.com/custom-pager + buildPager: null // function(slideIndex, slideHtmlObject){ return string; } - advanced use only! see the tutorial here: http://bxslider.com/custom-pager + } + + var options = $.extend(defaults, options); + + // cache the base element + var base = this; + // initialize (and localize) all variables + var $parent = ''; + var $origElement = ''; + var $children = ''; + var $outerWrapper = ''; + var $firstChild = ''; + var childrenWidth = ''; + var childrenOuterWidth = ''; + var wrapperWidth = ''; + var wrapperHeight = ''; + var $pager = ''; + var interval = ''; + var $autoControls = ''; + var $stopHtml = ''; + var $startContent = ''; + var $stopContent = ''; + var autoPlaying = true; + var loaded = false; + var childrenMaxWidth = 0; + var childrenMaxHeight = 0; + var currentSlide = 0; + var origLeft = 0; + var origTop = 0; + var origShowWidth = 0; + var origShowHeight = 0; + var tickerLeft = 0; + var tickerTop = 0; + var isWorking = false; + + var firstSlide = 0; + var lastSlide = $children.length - 1; + + + // PUBLIC FUNCTIONS + + /** + * Go to specified slide + */ + this.goToSlide = function(number, stopAuto){ + if(!isWorking){ + isWorking = true; + // set current slide to argument + currentSlide = number; + options.onBeforeSlide(currentSlide, $children.length, $children.eq(currentSlide)); + // check if stopAuto argument is supplied + if(typeof(stopAuto) == 'undefined'){ + var stopAuto = true; + } + if(stopAuto){ + // if show is auto playing, stop it + if(options.auto){ + base.stopShow(true); + } + } + slide = number; + // check for first slide callback + if(slide == firstSlide){ + options.onFirstSlide(currentSlide, $children.length, $children.eq(currentSlide)); + } + // check for last slide callback + if(slide == lastSlide){ + options.onLastSlide(currentSlide, $children.length, $children.eq(currentSlide)); + } + // horizontal + if(options.mode == 'horizontal'){ + $parent.animate({'left': '-'+getSlidePosition(slide, 'left')+'px'}, options.speed, options.easing, function(){ + isWorking = false; + // perform the callback function + options.onAfterSlide(currentSlide, $children.length, $children.eq(currentSlide)); + }); + // vertical + }else if(options.mode == 'vertical'){ + $parent.animate({'top': '-'+getSlidePosition(slide, 'top')+'px'}, options.speed, options.easing, function(){ + isWorking = false; + // perform the callback function + options.onAfterSlide(currentSlide, $children.length, $children.eq(currentSlide)); + }); + // fade + }else if(options.mode == 'fade'){ + setChildrenFade(); + } + // check to remove controls on last/first slide + checkEndControls(); + // accomodate multi slides + if(options.moveSlideQty > 1){ + number = Math.floor(number / options.moveSlideQty); + } + // make the current slide active + makeSlideActive(number); + // display the caption + showCaptions(); + } + } + + /** + * Go to next slide + */ + this.goToNextSlide = function(stopAuto){ + // check if stopAuto argument is supplied + if(typeof(stopAuto) == 'undefined'){ + var stopAuto = true; + } + if(stopAuto){ + // if show is auto playing, stop it + if(options.auto){ + base.stopShow(true); + } + } + // makes slideshow finite + if(!options.infiniteLoop){ + if(!isWorking){ + var slideLoop = false; + // make current slide the old value plus moveSlideQty + currentSlide = (currentSlide + (options.moveSlideQty)); + // if current slide has looped on itself + if(currentSlide <= lastSlide){ + checkEndControls(); + // next slide callback + options.onNextSlide(currentSlide, $children.length, $children.eq(currentSlide)); + // move to appropriate slide + base.goToSlide(currentSlide); + }else{ + currentSlide -= options.moveSlideQty; + } + } // end if(!isWorking) + }else{ + if(!isWorking){ + isWorking = true; + var slideLoop = false; + // make current slide the old value plus moveSlideQty + currentSlide = (currentSlide + options.moveSlideQty); + // if current slide has looped on itself + if(currentSlide > lastSlide){ + currentSlide = currentSlide % $children.length; + slideLoop = true; + } + // next slide callback + options.onNextSlide(currentSlide, $children.length, $children.eq(currentSlide)); + // slide before callback + options.onBeforeSlide(currentSlide, $children.length, $children.eq(currentSlide)); + if(options.mode == 'horizontal'){ + // get the new 'left' property for $parent + var parentLeft = (options.moveSlideQty * childrenOuterWidth); + // animate to the new 'left' + $parent.animate({'left': '-='+parentLeft+'px'}, options.speed, options.easing, function(){ + isWorking = false; + // if its time to loop, reset the $parent + if(slideLoop){ + $parent.css('left', '-'+getSlidePosition(currentSlide, 'left')+'px'); + } + // perform the callback function + options.onAfterSlide(currentSlide, $children.length, $children.eq(currentSlide)); + }); + }else if(options.mode == 'vertical'){ + // get the new 'left' property for $parent + var parentTop = (options.moveSlideQty * childrenMaxHeight); + // animate to the new 'left' + $parent.animate({'top': '-='+parentTop+'px'}, options.speed, options.easing, function(){ + isWorking = false; + // if its time to loop, reset the $parent + if(slideLoop){ + $parent.css('top', '-'+getSlidePosition(currentSlide, 'top')+'px'); + } + // perform the callback function + options.onAfterSlide(currentSlide, $children.length, $children.eq(currentSlide)); + }); + }else if(options.mode == 'fade'){ + setChildrenFade(); + } + // make the current slide active + if(options.moveSlideQty > 1){ + makeSlideActive(Math.ceil(currentSlide / options.moveSlideQty)); + }else{ + makeSlideActive(currentSlide); + } + // display the caption + showCaptions(); + } // end if(!isWorking) + + } + } // end function + + /** + * Go to previous slide + */ + this.goToPreviousSlide = function(stopAuto){ + // check if stopAuto argument is supplied + if(typeof(stopAuto) == 'undefined'){ + var stopAuto = true; + } + if(stopAuto){ + // if show is auto playing, stop it + if(options.auto){ + base.stopShow(true); + } + } + // makes slideshow finite + if(!options.infiniteLoop){ + if(!isWorking){ + var slideLoop = false; + // make current slide the old value plus moveSlideQty + currentSlide = currentSlide - options.moveSlideQty; + // if current slide has looped on itself + if(currentSlide < 0){ + currentSlide = 0; + // if specified, hide the control on the last slide + if(options.hideControlOnEnd){ + $('.bx-prev', $outerWrapper).hide(); + } + } + checkEndControls(); + // next slide callback + options.onPrevSlide(currentSlide, $children.length, $children.eq(currentSlide)); + // move to appropriate slide + base.goToSlide(currentSlide); + } + }else{ + if(!isWorking){ + isWorking = true; + var slideLoop = false; + // make current slide the old value plus moveSlideQty + currentSlide = (currentSlide - (options.moveSlideQty)); + // if current slide has looped on itself + if(currentSlide < 0){ + negativeOffset = (currentSlide % $children.length); + if(negativeOffset == 0){ + currentSlide = 0; + }else{ + currentSlide = ($children.length) + negativeOffset; + } + slideLoop = true; + } + // next slide callback + options.onPrevSlide(currentSlide, $children.length, $children.eq(currentSlide)); + // slide before callback + options.onBeforeSlide(currentSlide, $children.length, $children.eq(currentSlide)); + if(options.mode == 'horizontal'){ + // get the new 'left' property for $parent + var parentLeft = (options.moveSlideQty * childrenOuterWidth); + // animate to the new 'left' + $parent.animate({'left': '+='+parentLeft+'px'}, options.speed, options.easing, function(){ + isWorking = false; + // if its time to loop, reset the $parent + if(slideLoop){ + $parent.css('left', '-'+getSlidePosition(currentSlide, 'left')+'px'); + } + // perform the callback function + options.onAfterSlide(currentSlide, $children.length, $children.eq(currentSlide)); + }); + }else if(options.mode == 'vertical'){ + // get the new 'left' property for $parent + var parentTop = (options.moveSlideQty * childrenMaxHeight); + // animate to the new 'left' + $parent.animate({'top': '+='+parentTop+'px'}, options.speed, options.easing, function(){ + isWorking = false; + // if its time to loop, reset the $parent + if(slideLoop){ + $parent.css('top', '-'+getSlidePosition(currentSlide, 'top')+'px'); + } + // perform the callback function + options.onAfterSlide(currentSlide, $children.length, $children.eq(currentSlide)); + }); + }else if(options.mode == 'fade'){ + setChildrenFade(); + } + // make the current slide active + if(options.moveSlideQty > 1){ + makeSlideActive(Math.ceil(currentSlide / options.moveSlideQty)); + }else{ + makeSlideActive(currentSlide); + } + // display the caption + showCaptions(); + } // end if(!isWorking) + } + } // end function + + /** + * Go to first slide + */ + this.goToFirstSlide = function(stopAuto){ + // check if stopAuto argument is supplied + if(typeof(stopAuto) == 'undefined'){ + var stopAuto = true; + } + base.goToSlide(firstSlide, stopAuto); + } + + /** + * Go to last slide + */ + this.goToLastSlide = function(){ + // check if stopAuto argument is supplied + if(typeof(stopAuto) == 'undefined'){ + var stopAuto = true; + } + base.goToSlide(lastSlide, stopAuto); + } + + /** + * Get the current slide + */ + this.getCurrentSlide = function(){ + return currentSlide; + } + + /** + * Get the total slide count + */ + this.getSlideCount = function(){ + return $children.length; + } + + /** + * Stop the slideshow + */ + this.stopShow = function(changeText){ + clearInterval(interval); + // check if changeText argument is supplied + if(typeof(changeText) == 'undefined'){ + var changeText = true; + } + if(changeText && options.autoControls){ + $autoControls.html($startContent).removeClass('stop').addClass('start'); + autoPlaying = false; + } + } + + /** + * Start the slideshow + */ + this.startShow = function(changeText){ + // check if changeText argument is supplied + if(typeof(changeText) == 'undefined'){ + var changeText = true; + } + setAutoInterval(); + if(changeText && options.autoControls){ + $autoControls.html($stopContent).removeClass('start').addClass('stop'); + autoPlaying = true; + } + } + + /** + * Stops the ticker + */ + this.stopTicker = function(changeText){ + $parent.stop(); + // check if changeText argument is supplied + if(typeof(changeText) == 'undefined'){ + var changeText = true; + } + if(changeText && options.ticker){ + $autoControls.html($startContent).removeClass('stop').addClass('start'); + autoPlaying = false; + } + } + + /** + * Starts the ticker + */ + this.startTicker = function(changeText){ + if(options.mode == 'horizontal'){ + if(options.tickerDirection == 'next'){ + // get the 'left' property where the ticker stopped + var stoppedLeft = parseInt($parent.css('left')); + // calculate the remaining distance the show must travel until the loop + var remainingDistance = (origShowWidth + stoppedLeft) + $children.eq(0).width(); + }else if(options.tickerDirection == 'prev'){ + // get the 'left' property where the ticker stopped + var stoppedLeft = -parseInt($parent.css('left')); + // calculate the remaining distance the show must travel until the loop + var remainingDistance = (stoppedLeft) - $children.eq(0).width(); + } + // calculate the speed ratio to seamlessly finish the loop + var finishingSpeed = (remainingDistance * options.tickerSpeed) / origShowWidth; + // call the show + moveTheShow(tickerLeft, remainingDistance, finishingSpeed); + }else if(options.mode == 'vertical'){ + if(options.tickerDirection == 'next'){ + // get the 'top' property where the ticker stopped + var stoppedTop = parseInt($parent.css('top')); + // calculate the remaining distance the show must travel until the loop + var remainingDistance = (origShowHeight + stoppedTop) + $children.eq(0).height(); + }else if(options.tickerDirection == 'prev'){ + // get the 'left' property where the ticker stopped + var stoppedTop = -parseInt($parent.css('top')); + // calculate the remaining distance the show must travel until the loop + var remainingDistance = (stoppedTop) - $children.eq(0).height(); + } + // calculate the speed ratio to seamlessly finish the loop + var finishingSpeed = (remainingDistance * options.tickerSpeed) / origShowHeight; + // call the show + moveTheShow(tickerTop, remainingDistance, finishingSpeed); + // check if changeText argument is supplied + if(typeof(changeText) == 'undefined'){ + var changeText = true; + } + if(changeText && options.ticker){ + $autoControls.html($stopContent).removeClass('start').addClass('stop'); + autoPlaying = true; + } + } + } + + /** + * Initialize a new slideshow + */ + this.initShow = function(){ + + // reinitialize all variables + // base = this; + $parent = $(this); + $origElement = $parent.clone(); + $children = $parent.children(); + $outerWrapper = ''; + $firstChild = $parent.children(':first'); + childrenWidth = $firstChild.width(); + childrenMaxWidth = 0; + childrenOuterWidth = $firstChild.outerWidth(); + childrenMaxHeight = 0; + wrapperWidth = getWrapperWidth(); + wrapperHeight = getWrapperHeight(); + isWorking = false; + $pager = ''; + currentSlide = 0; + origLeft = 0; + origTop = 0; + interval = ''; + $autoControls = ''; + $stopHtml = ''; + $startContent = ''; + $stopContent = ''; + autoPlaying = true; + loaded = false; + origShowWidth = 0; + origShowHeight = 0; + tickerLeft = 0; + tickerTop = 0; + + firstSlide = 0; + lastSlide = $children.length - 1; + + // get the largest child's height and width + $children.each(function(index) { + if($(this).outerHeight() > childrenMaxHeight){ + childrenMaxHeight = $(this).outerHeight(); + } + if($(this).outerWidth() > childrenMaxWidth){ + childrenMaxWidth = $(this).outerWidth(); + } + }); + + // get random slide number + if(options.randomStart){ + var randomNumber = Math.floor(Math.random() * $children.length); + currentSlide = randomNumber; + origLeft = childrenOuterWidth * (options.moveSlideQty + randomNumber); + origTop = childrenMaxHeight * (options.moveSlideQty + randomNumber); + // start show at specific slide + }else{ + currentSlide = options.startingSlide; + origLeft = childrenOuterWidth * (options.moveSlideQty + options.startingSlide); + origTop = childrenMaxHeight * (options.moveSlideQty + options.startingSlide); + } + + // set initial css + initCss(); + + // check to show pager + if(options.pager && !options.ticker){ + if(options.pagerType == 'full'){ + showPager('full'); + }else if(options.pagerType == 'short'){ + showPager('short'); + } + } + + // check to show controls + if(options.controls && !options.ticker){ + setControlsVars(); + } + + // check if auto + if(options.auto || options.ticker){ + // check if auto controls are displayed + if(options.autoControls){ + setAutoControlsVars(); + } + // check if show should auto start + if(options.autoStart){ + // check if autostart should delay + setTimeout(function(){ + base.startShow(true); + }, options.autoDelay); + }else{ + base.stopShow(true); + } + // check if show should pause on hover + if(options.autoHover && !options.ticker){ + setAutoHover(); + } + } + // make the starting slide active + if(options.moveSlideQty > 1){ + makeSlideActive(Math.ceil(currentSlide / options.moveSlideQty)); + }else{ + makeSlideActive(currentSlide); + } + // check for finite show and if controls should be hidden + checkEndControls(); + // show captions + if(options.captions){ + showCaptions(); + } + // perform the callback function + options.onAfterSlide(currentSlide, $children.length, $children.eq(currentSlide)); + } + + /** + * Destroy the current slideshow + */ + this.destroyShow = function(){ + // stop the auto show + clearInterval(interval); + // remove any controls / pagers that have been appended + $('.bx-next, .bx-prev, .bx-pager, .bx-auto', $outerWrapper).remove(); + // unwrap all bx-wrappers + $parent.unwrap().unwrap().removeAttr('style'); + // remove any styles that were appended + $parent.children().removeAttr('style').not('.pager').remove(); + // remove any childrent that were appended + $children.removeClass('pager'); + + } + + /** + * Reload the current slideshow + */ + this.reloadShow = function(){ + base.destroyShow(); + base.initShow(); + } + + // PRIVATE FUNCTIONS + + /** + * Creates all neccessary styling for the slideshow + */ + function initCss(){ + // layout the children + setChildrenLayout(options.startingSlide); + // CSS for horizontal mode + if(options.mode == 'horizontal'){ + // wrap the