").append(m.parsehtml(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responsetext,b,a])}),this},m.each(["ajaxstart","ajaxstop","ajaxcomplete","ajaxerror","ajaxsuccess","ajaxsend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentelement;function dc(a){return m.iswindow(a)?a:9===a.nodetype?a.defaultview||a.parentwindow:!1}m.offset={setoffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inarray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parsefloat(f)||0,e=parsefloat(i)||0),m.isfunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setoffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerdocument;if(f)return b=f.documentelement,m.contains(b,e)?(typeof e.getboundingclientrect!==k&&(d=e.getboundingclientrect()),c=dc(f),{top:d.top+(c.pageyoffset||b.scrolltop)-(b.clienttop||0),left:d.left+(c.pagexoffset||b.scrollleft)-(b.clientleft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getboundingclientrect():(a=this.offsetparent(),b=this.offset(),m.nodename(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"bordertopwidth",!0),c.left+=m.css(a[0],"borderleftwidth",!0)),{top:b.top-c.top-m.css(d,"margintop",!0),left:b.left-c.left-m.css(d,"marginleft",!0)}}},offsetparent:function(){return this.map(function(){var a=this.offsetparent||cc;while(a&&!m.nodename(a,"html")&&"static"===m.css(a,"position"))a=a.offsetparent;return a||cc})}}),m.each({scrollleft:"pagexoffset",scrolltop:"pageyoffset"},function(a,b){var c=/y/.test(b);m.fn[a]=function(d){return v(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentelement[d]:a[d]:void(f?f.scrollto(c?m(f).scrollleft():e,c?e:m(f).scrolltop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.csshooks[b]=la(k.pixelposition,function(a,c){return c?(c=ja(a,b),ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({height:"height",width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return v(this,function(b,c,d){var e;return m.iswindow(b)?b.document.documentelement["client"+a]:9===b.nodetype?(e=b.documentelement,math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andself=m.fn.addback,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jquery,fc=a.$;return m.noconflict=function(b){return a.$===m&&(a.$=fc),b&&a.jquery===m&&(a.jquery=ec),m},typeof b===k&&(a.jquery=a.$=m),m});
/**
* bxslider v4.1.2 - fully loaded, responsive content slider
* http://bxslider.com
*
* copyright 2014, steven wanderski - http://stevenwanderski.com - http://bxcreative.com
* written while drinking belgian ales and listening to jazz
*
* released under the mit license - http://opensource.org/licenses/mit
*/
!function(t){var e={},s={mode:"horizontal",slideselector:"",infiniteloop:!0,hidecontrolonend:!1,speed:500,easing:null,slidemargin:0,startslide:0,randomstart:!1,captions:!1,ticker:!1,tickerhover:!1,adaptiveheight:!1,adaptiveheightspeed:500,video:!1,usecss:!0,preloadimages:"visible",responsive:!0,slidezindex:50,touchenabled:!0,swipethreshold:50,onetoonetouch:!0,preventdefaultswipex:!0,preventdefaultswipey:!1,pager:!0,pagertype:"full",pagershortseparator:" / ",pagerselector:null,buildpager:null,pagercustom:null,controls:!0,nexttext:"next",prevtext:"prev",nextselector:null,prevselector:null,autocontrols:!1,starttext:"start",stoptext:"stop",autocontrolscombine:!1,autocontrolsselector:null,auto:!1,pause:4e3,autostart:!0,autodirection:"next",autohover:!1,autodelay:0,minslides:1,maxslides:1,moveslides:0,slidewidth:0,onsliderload:function(){},onslidebefore:function(){},onslideafter:function(){},onslidenext:function(){},onslideprev:function(){},onsliderresize:function(){}};t.fn.bxslider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxslider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slidewidth=parseint(o.settings.slidewidth),o.children=r.children(o.settings.slideselector),o.children.length
1||o.settings.maxslides>1,o.carousel&&(o.settings.preloadimages="all"),o.minthreshold=o.settings.minslides*o.settings.slidewidth+(o.settings.minslides-1)*o.settings.slidemargin,o.maxthreshold=o.settings.maxslides*o.settings.slidewidth+(o.settings.maxslides-1)*o.settings.slidemargin,o.working=!1,o.controls={},o.interval=null,o.animprop="vertical"==o.settings.mode?"top":"left",o.usingcss=o.settings.usecss&&"fade"!=o.settings.mode&&function(){var t=document.createelement("div"),e=["webkitperspective","mozperspective","operspective","msperspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssprefix=e[i].replace("perspective","").tolowercase(),o.animprop="-"+o.cssprefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxslides=o.settings.minslides),r.data("origstyle",r.attr("style")),r.children(o.settings.slideselector).each(function(){t(this).data("origstyle",t(this).attr("style"))}),c()},c=function(){r.wrap(''),o.viewport=r.parent(),o.loader=t(''),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingcss&&o.settings.easing?r.css("-"+o.cssprefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxwidth:p()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",liststyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slidemargin>0&&o.children.css("marginright",o.settings.slidemargin),"vertical"==o.settings.mode&&o.settings.slidemargin>0&&o.children.css("marginbottom",o.settings.slidemargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zindex:0,display:"none"}),o.children.eq(o.settings.startslide).css({zindex:o.settings.slidezindex,display:"block"})),o.controls.el=t(''),o.settings.captions&&p(),o.active.last=o.settings.startslide==x()-1,o.settings.video&&r.fitvids();var e=o.children.eq(o.settings.startslide);"all"==o.settings.preloadimages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&t(),o.settings.controls&&c(),o.settings.auto&&o.settings.autocontrols&&e(),(o.settings.controls||o.settings.autocontrols||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).one("load",function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteloop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minslides:o.settings.maxslides,i=o.children.slice(0,e).clone().addclass("bx-clone"),s=o.children.slice(-e).clone().addclass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),s(),"vertical"==o.settings.mode&&(o.settings.adaptiveheight=!0),o.viewport.height(v()),r.redrawslider(),o.settings.onsliderload(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",z),o.settings.auto&&o.settings.autostart&&h(),o.settings.ticker&&l(),o.settings.pager&&q(o.settings.startslide),o.settings.controls&&w(),o.settings.touchenabled&&!o.settings.ticker&&o()},v=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveheight)if(o.carousel){var n=1==o.settings.moveslides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxslides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerheight()}),o.settings.slidemargin>0&&(e+=o.settings.slidemargin*(o.settings.minslides-1))):e=math.max.apply(math,s.map(function(){return t(this).outerheight(!1)}).get()),e},p=function(){var t="100%";return o.settings.slidewidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxslides*o.settings.slidewidth+(o.settings.maxslides-1)*o.settings.slidemargin:o.settings.slidewidth),t},u=function(){var t=o.settings.slidewidth,e=o.viewport.width();return 0==o.settings.slidewidth||o.settings.slidewidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxslides>1&&"horizontal"==o.settings.mode&&(e>o.maxthreshold||e0)if(o.viewport.width()o.maxthreshold)t=o.settings.maxslides;else{var e=o.children.first().width();t=math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minslides);return t},x=function(){var t=0;if(o.settings.moveslides>0)if(o.settings.infiniteloop)t=o.children.length/m();else for(var e=0,i=0;e0&&o.settings.moveslides<=f()?o.settings.moveslides:f()},s=function(){if(o.children.length>o.settings.maxslides&&o.active.last&&!o.settings.infiniteloop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minslides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingcss){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssprefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animprop,n),r.bind("transitionend webkittransitionend otransitionend mstransitionend",function(){r.unbind("transitionend webkittransitionend otransitionend mstransitionend"),d()})):"reset"==e?r.css(o.animprop,n):"ticker"==e&&(r.css("-"+o.cssprefix+"-transition-timing-function","linear"),r.css(o.animprop,n),r.bind("transitionend webkittransitionend otransitionend mstransitionend",function(){r.unbind("transitionend webkittransitionend otransitionend mstransitionend"),b(s.resetvalue,"reset",0),n()}))}else{var a={};a[o.animprop]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){d()}):"reset"==e?r.css(o.animprop,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetvalue,"reset",0),n()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildpager&&t.isfunction(o.settings.buildpager)?(n=o.settings.buildpager(s),o.pagerel.addclass("bx-custom-pager")):(n=s+1,o.pagerel.addclass("bx-default-pager")),e+='"}o.pagerel.html(e)},t=function(){o.settings.pagercustom?o.pagerel=t(o.settings.pagercustom):(o.pagerel=t(''),o.settings.pagerselector?t(o.settings.pagerselector).html(o.pagerel):o.controls.el.addclass("bx-has-pager").append(o.pagerel),w()),o.pagerel.on("click","a",i)},c=function(){o.controls.next=t(''+o.settings.nexttext+""),o.controls.prev=t(''+o.settings.prevtext+""),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextselector&&t(o.settings.nextselector).append(o.controls.next),o.settings.prevselector&&t(o.settings.prevselector).append(o.controls.prev),o.settings.nextselector||o.settings.prevselector||(o.controls.directionel=t(''),o.controls.directionel.append(o.controls.prev).append(o.controls.next),o.controls.el.addclass("bx-has-controls-direction").append(o.controls.directionel))},e=function(){o.controls.start=t('"),o.controls.stop=t('"),o.controls.autoel=t(''),o.controls.autoel.on("click",".bx-start",k),o.controls.autoel.on("click",".bx-stop",m),o.settings.autocontrolscombine?o.controls.autoel.append(o.controls.start):o.controls.autoel.append(o.controls.start).append(o.controls.stop),o.settings.autocontrolsselector?t(o.settings.autocontrolsselector).html(o.controls.autoel):o.controls.el.addclass("bx-has-controls-auto").append(o.controls.autoel),a(o.settings.autostart?"stop":"start")},p=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append(''+e+"
")})},y=function(t){o.settings.auto&&r.stopauto(),r.gotonextslide(),t.preventdefault()},z=function(t){o.settings.auto&&r.stopauto(),r.gotoprevslide(),t.preventdefault()},k=function(t){r.startauto(),t.preventdefault()},m=function(t){r.stopauto(),t.preventdefault()},i=function(e){o.settings.auto&&r.stopauto();var i=t(e.currenttarget),s=parseint(i.attr("data-slide-index"));s!=o.active.index&&r.gotoslide(s),e.preventdefault()},q=function(e){var i=o.children.length;return"short"==o.settings.pagertype?(o.settings.maxslides>1&&(i=math.ceil(o.children.length/o.settings.maxslides)),o.pagerel.html(e+1+o.settings.pagershortseparator+i),void 0):(o.pagerel.find("a").removeclass("active"),o.pagerel.each(function(i,s){t(s).find("a").eq(e).addclass("active")}),void 0)},d=function(){if(o.settings.infiniteloop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),t&&("horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0))}o.working=!1,o.settings.onslideafter(o.children.eq(o.active.index),o.oldindex,o.active.index)},a=function(t){o.settings.autocontrolscombine?o.controls.autoel.html(o.controls[t]):(o.controls.autoel.find("a").removeclass("active"),o.controls.autoel.find("a:not(.bx-"+t+")").addclass("active"))},w=function(){1==x()?(o.controls.prev.addclass("disabled"),o.controls.next.addclass("disabled")):!o.settings.infiniteloop&&o.settings.hidecontrolonend&&(0==o.active.index?(o.controls.prev.addclass("disabled"),o.controls.next.removeclass("disabled")):o.active.index==x()-1?(o.controls.next.addclass("disabled"),o.controls.prev.removeclass("disabled")):(o.controls.prev.removeclass("disabled"),o.controls.next.removeclass("disabled")))},h=function(){o.settings.autodelay>0?settimeout(r.startauto,o.settings.autodelay):r.startauto(),o.settings.autohover&&r.hover(function(){o.interval&&(r.stopauto(!0),o.autopaused=!0)},function(){o.autopaused&&(r.startauto(!0),o.autopaused=null)})},l=function(){var e=0;if("next"==o.settings.autodirection)r.append(o.children.clone().addclass("bx-clone"));else{r.prepend(o.children.clone().addclass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autocontrols=!1,o.settings.tickerhover&&!o.usingcss&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerwidth(!0):t(this).outerheight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-math.abs(parseint(r.css(s))));n(n)}),n()},n=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autodirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetvalue:n};b(s,"ticker",speed,a)},o=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",x)},x=function(t){if(o.working)t.preventdefault();else{o.touch.originalpos=r.position();var e=t.originalevent;o.touch.start.x=e.changedtouches[0].pagex,o.touch.start.y=e.changedtouches[0].pagey,o.viewport.bind("touchmove",y),o.viewport.bind("touchend",v)}},y=function(t){var e=t.originalevent,i=math.abs(e.changedtouches[0].pagex-o.touch.start.x),s=math.abs(e.changedtouches[0].pagey-o.touch.start.y);if(3*i>s&&o.settings.preventdefaultswipex?t.preventdefault():3*s>i&&o.settings.preventdefaultswipey&&t.preventdefault(),"fade"!=o.settings.mode&&o.settings.onetoonetouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedtouches[0].pagex-o.touch.start.x;n=o.touch.originalpos.left+r}else{var r=e.changedtouches[0].pagey-o.touch.start.y;n=o.touch.originalpos.top+r}b(n,"reset",0)}},v=function(t){o.viewport.unbind("touchmove",y);var e=t.originalevent,i=0;if(o.touch.end.x=e.changedtouches[0].pagex,o.touch.end.y=e.changedtouches[0].pagey,"fade"==o.settings.mode){var s=math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipethreshold&&(o.touch.start.x>o.touch.end.x?r.gotonextslide():r.gotoprevslide(),r.stopauto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalpos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalpos.top),!o.settings.infiniteloop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):math.abs(s)>=o.settings.swipethreshold?(0>s?r.gotonextslide():r.gotoprevslide(),r.stopauto()):b(i,"reset",200)}o.viewport.unbind("touchend",v)},z=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawslider(),o.settings.onsliderresize.call(r,o.active.index))};return r.gotoslide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldindex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onslidebefore(o.children.eq(o.active.index),o.oldindex,o.active.index),"next"==i?o.settings.onslidenext(o.children.eq(o.active.index),o.oldindex,o.active.index):"prev"==i&&o.settings.onslideprev(o.children.eq(o.active.index),o.oldindex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&q(o.active.index),o.settings.controls&&w(),"fade"==o.settings.mode)o.settings.adaptiveheight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveheightspeed),o.children.filter(":visible").fadeout(o.settings.speed).css({zindex:0}),o.children.eq(o.active.index).css("zindex",o.settings.slidezindex+1).fadein(o.settings.speed,function(){t(this).css("zindex",o.settings.slidezindex),d()});else{o.settings.adaptiveheight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveheightspeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteloop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerwidth()}else{var l=o.children.length-o.settings.minslides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveslides?o.settings.maxslides-m():(x()-1)*m()-(o.children.length-o.settings.maxslides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxslides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.gotonextslide=function(){if(o.settings.infiniteloop||!o.active.last){var t=parseint(o.active.index)+1;r.gotoslide(t,"next")}},r.gotoprevslide=function(){if(o.settings.infiniteloop||0!=o.active.index){var t=parseint(o.active.index)-1;r.gotoslide(t,"prev")}},r.startauto=function(t){o.interval||(o.interval=setinterval(function(){"next"==o.settings.autodirection?r.gotonextslide():r.gotoprevslide()},o.settings.pause),o.settings.autocontrols&&1!=t&&a("stop"))},r.stopauto=function(t){o.interval&&(clearinterval(o.interval),o.interval=null,o.settings.autocontrols&&1!=t&&a("start"))},r.getcurrentslide=function(){return o.active.index},r.getcurrentslideelement=function(){return o.children.eq(o.active.index)},r.getslidecount=function(){return o.children.length},r.redrawslider=function(){o.children.add(r.find(".bx-clone")).outerwidth(u()),o.viewport.css("height",v()),o.settings.ticker||s(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagercustom&&(w(),q(o.active.index))},r.destroyslider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origstyle")?t(this).attr("style",t(this).data("origstyle")):t(this).removeattr("style")}),void 0!=t(this).data("origstyle")?this.attr("style",t(this).data("origstyle")):t(this).removeattr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerel&&o.settings.controls&&o.pagerel.remove(),t(".bx-caption",this).remove(),o.controls.autoel&&o.controls.autoel.remove(),clearinterval(o.interval),o.settings.responsive&&t(window).unbind("resize",z))},r.reloadslider=function(t){void 0!=t&&(n=t),r.destroyslider(),d()},d(),this}}(jquery);
$(document).ready(function(){
//返回顶部
$("#gototop").click(function(){
$("html,body").animate({scrolltop :0}, 800);return false;
});
$("#gotocate").click(function(){
$("html,body").animate({scrolltop:$("#categories").offset().top},800);return false;
});
// 搜索
$("#small_search").click(function(){
$("#topsearch").slidetoggle();
});
if($(window).width()>768){
//鼠标划过就展开子菜单
$('ul.nav li.dropdown').hover(function() {
$(this).find('.dropdown-menu').stop(true, true).slidedown();
}, function() {
$(this).find('.dropdown-menu').stop(true, true).slideup();
});
}
//scrolltop
$(window).scroll(function(){
var scrolls = $(window).scrolltop()
if (scrolls > 10) {
$(".navbar").addclass("small-nav")
}else{
$(".navbar").removeclass("small-nav")
}
});
//左侧导航菜单
// if ($("#firstpane .menu_body:eq(0)").text().replace(/[\r\n ]/g,"").length>0) {
// $("#firstpane .menu_body:eq(0)").show().prev().html("-").prev().addclass("left_active");
// };
$("ul.menu_body").each(function(){
if ($(this).text().replace(/[\r\n ]/g,"").length<=0) {$(this).prev().remove();} //去掉span
});
$("#firstpane span.menu_head").click(function(){
var spanatt = $(this).next("ul.menu_body").css('display');
if (spanatt == "block"){
var spantext = "+";
$(this).prev().removeclass("left_active");
}else{
var spantext = "-";
$(this).prev().addclass("left_active");
}
$(this).html(spantext).addclass("current").next("ul.menu_body").slidetoggle(300).siblings("ul.menu_body");
});
});
/*!
* bootstrap v3.3.4 (http://getbootstrap.com)
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
*/
if (typeof jquery === 'undefined') {
throw new error('bootstrap\'s javascript requires jquery')
}
+function ($) {
'use strict';
var version = $.fn.jquery.split(' ')[0].split('.')
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
throw new error('bootstrap\'s javascript requires jquery version 1.9.1 or higher')
}
}(jquery);
/* ========================================================================
* bootstrap: transition.js v3.3.4
* http://getbootstrap.com/javascript/#transitions
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// css transition support (shoutout: http://www.modernizr.com/)
// ============================================================
function transitionend() {
var el = document.createelement('bootstrap')
var transendeventnames = {
webkittransition : 'webkittransitionend',
moztransition : 'transitionend',
otransition : 'otransitionend otransitionend',
transition : 'transitionend'
}
for (var name in transendeventnames) {
if (el.style[name] !== undefined) {
return { end: transendeventnames[name] }
}
}
return false // explicit for ie8 ( ._.)
}
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulatetransitionend = function (duration) {
var called = false
var $el = this
$(this).one('bstransitionend', function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
settimeout(callback, duration)
return this
}
$(function () {
$.support.transition = transitionend()
if (!$.support.transition) return
$.event.special.bstransitionend = {
bindtype: $.support.transition.end,
delegatetype: $.support.transition.end,
handle: function (e) {
if ($(e.target).is(this)) return e.handleobj.handler.apply(this, arguments)
}
}
})
}(jquery);
/* ========================================================================
* bootstrap: alert.js v3.3.4
* http://getbootstrap.com/javascript/#alerts
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// alert class definition
// ======================
var dismiss = '[data-dismiss="alert"]'
var alert = function (el) {
$(el).on('click', dismiss, this.close)
}
alert.version = '3.3.4'
alert.transition_duration = 150
alert.prototype.close = function (e) {
var $this = $(this)
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = $(selector)
if (e) e.preventdefault()
if (!$parent.length) {
$parent = $this.closest('.alert')
}
$parent.trigger(e = $.event('close.bs.alert'))
if (e.isdefaultprevented()) return
$parent.removeclass('in')
function removeelement() {
// detach from parent, fire event then clean up data
$parent.detach().trigger('closed.bs.alert').remove()
}
$.support.transition && $parent.hasclass('fade') ?
$parent
.one('bstransitionend', removeelement)
.emulatetransitionend(alert.transition_duration) :
removeelement()
}
// alert plugin definition
// =======================
function plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.alert')
if (!data) $this.data('bs.alert', (data = new alert(this)))
if (typeof option == 'string') data[option].call($this)
})
}
var old = $.fn.alert
$.fn.alert = plugin
$.fn.alert.constructor = alert
// alert no conflict
// =================
$.fn.alert.noconflict = function () {
$.fn.alert = old
return this
}
// alert data-api
// ==============
$(document).on('click.bs.alert.data-api', dismiss, alert.prototype.close)
}(jquery);
/* ========================================================================
* bootstrap: button.js v3.3.4
* http://getbootstrap.com/javascript/#buttons
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// button public class definition
// ==============================
var button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, button.defaults, options)
this.isloading = false
}
button.version = '3.3.4'
button.defaults = {
loadingtext: 'loading...'
}
button.prototype.setstate = function (state) {
var d = 'disabled'
var $el = this.$element
var val = $el.is('input') ? 'val' : 'html'
var data = $el.data()
state = state + 'text'
if (data.resettext == null) $el.data('resettext', $el[val]())
// push to event loop to allow forms to submit
settimeout($.proxy(function () {
$el[val](data[state] == null ? this.options[state] : data[state])
if (state == 'loadingtext') {
this.isloading = true
$el.addclass(d).attr(d, d)
} else if (this.isloading) {
this.isloading = false
$el.removeclass(d).removeattr(d)
}
}, this), 0)
}
button.prototype.toggle = function () {
var changed = true
var $parent = this.$element.closest('[data-toggle="buttons"]')
if ($parent.length) {
var $input = this.$element.find('input')
if ($input.prop('type') == 'radio') {
if ($input.prop('checked') && this.$element.hasclass('active')) changed = false
else $parent.find('.active').removeclass('active')
}
if (changed) $input.prop('checked', !this.$element.hasclass('active')).trigger('change')
} else {
this.$element.attr('aria-pressed', !this.$element.hasclass('active'))
}
if (changed) this.$element.toggleclass('active')
}
// button plugin definition
// ========================
function plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.button')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.button', (data = new button(this, options)))
if (option == 'toggle') data.toggle()
else if (option) data.setstate(option)
})
}
var old = $.fn.button
$.fn.button = plugin
$.fn.button.constructor = button
// button no conflict
// ==================
$.fn.button.noconflict = function () {
$.fn.button = old
return this
}
// button data-api
// ===============
$(document)
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
var $btn = $(e.target)
if (!$btn.hasclass('btn')) $btn = $btn.closest('.btn')
plugin.call($btn, 'toggle')
e.preventdefault()
})
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
$(e.target).closest('.btn').toggleclass('focus', /^focus(in)?$/.test(e.type))
})
}(jquery);
/* ========================================================================
* bootstrap: carousel.js v3.3.4
* http://getbootstrap.com/javascript/#carousel
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// carousel class definition
// =========================
var carousel = function (element, options) {
this.$element = $(element)
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.paused = null
this.sliding = null
this.interval = null
this.$active = null
this.$items = null
this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
this.options.pause == 'hover' && !('ontouchstart' in document.documentelement) && this.$element
.on('mouseenter.bs.carousel', $.proxy(this.pause, this))
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
}
carousel.version = '3.3.4'
carousel.transition_duration = 600
carousel.defaults = {
interval: 5000,
pause: 'hover',
wrap: true,
keyboard: true
}
carousel.prototype.keydown = function (e) {
if (/input|textarea/i.test(e.target.tagname)) return
switch (e.which) {
case 37: this.prev(); break
case 39: this.next(); break
default: return
}
e.preventdefault()
}
carousel.prototype.cycle = function (e) {
e || (this.paused = false)
this.interval && clearinterval(this.interval)
this.options.interval
&& !this.paused
&& (this.interval = setinterval($.proxy(this.next, this), this.options.interval))
return this
}
carousel.prototype.getitemindex = function (item) {
this.$items = item.parent().children('.item')
return this.$items.index(item || this.$active)
}
carousel.prototype.getitemfordirection = function (direction, active) {
var activeindex = this.getitemindex(active)
var willwrap = (direction == 'prev' && activeindex === 0)
|| (direction == 'next' && activeindex == (this.$items.length - 1))
if (willwrap && !this.options.wrap) return active
var delta = direction == 'prev' ? -1 : 1
var itemindex = (activeindex + delta) % this.$items.length
return this.$items.eq(itemindex)
}
carousel.prototype.to = function (pos) {
var that = this
var activeindex = this.getitemindex(this.$active = this.$element.find('.item.active'))
if (pos > (this.$items.length - 1) || pos < 0) return
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
if (activeindex == pos) return this.pause().cycle()
return this.slide(pos > activeindex ? 'next' : 'prev', this.$items.eq(pos))
}
carousel.prototype.pause = function (e) {
e || (this.paused = true)
if (this.$element.find('.next, .prev').length && $.support.transition) {
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
this.interval = clearinterval(this.interval)
return this
}
carousel.prototype.next = function () {
if (this.sliding) return
return this.slide('next')
}
carousel.prototype.prev = function () {
if (this.sliding) return
return this.slide('prev')
}
carousel.prototype.slide = function (type, next) {
var $active = this.$element.find('.item.active')
var $next = next || this.getitemfordirection(type, $active)
var iscycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
var that = this
if ($next.hasclass('active')) return (this.sliding = false)
var relatedtarget = $next[0]
var slideevent = $.event('slide.bs.carousel', {
relatedtarget: relatedtarget,
direction: direction
})
this.$element.trigger(slideevent)
if (slideevent.isdefaultprevented()) return
this.sliding = true
iscycling && this.pause()
if (this.$indicators.length) {
this.$indicators.find('.active').removeclass('active')
var $nextindicator = $(this.$indicators.children()[this.getitemindex($next)])
$nextindicator && $nextindicator.addclass('active')
}
var slidevent = $.event('slid.bs.carousel', { relatedtarget: relatedtarget, direction: direction }) // yes, "slid"
if ($.support.transition && this.$element.hasclass('slide')) {
$next.addclass(type)
$next[0].offsetwidth // force reflow
$active.addclass(direction)
$next.addclass(direction)
$active
.one('bstransitionend', function () {
$next.removeclass([type, direction].join(' ')).addclass('active')
$active.removeclass(['active', direction].join(' '))
that.sliding = false
settimeout(function () {
that.$element.trigger(slidevent)
}, 0)
})
.emulatetransitionend(carousel.transition_duration)
} else {
$active.removeclass('active')
$next.addclass('active')
this.sliding = false
this.$element.trigger(slidevent)
}
iscycling && this.cycle()
return this
}
// carousel plugin definition
// ==========================
function plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.carousel')
var options = $.extend({}, carousel.defaults, $this.data(), typeof option == 'object' && option)
var action = typeof option == 'string' ? option : options.slide
if (!data) $this.data('bs.carousel', (data = new carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (action) data[action]()
else if (options.interval) data.pause().cycle()
})
}
var old = $.fn.carousel
$.fn.carousel = plugin
$.fn.carousel.constructor = carousel
// carousel no conflict
// ====================
$.fn.carousel.noconflict = function () {
$.fn.carousel = old
return this
}
// carousel data-api
// =================
var clickhandler = function (e) {
var href
var $this = $(this)
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
if (!$target.hasclass('carousel')) return
var options = $.extend({}, $target.data(), $this.data())
var slideindex = $this.attr('data-slide-to')
if (slideindex) options.interval = false
plugin.call($target, options)
if (slideindex) {
$target.data('bs.carousel').to(slideindex)
}
e.preventdefault()
}
$(document)
.on('click.bs.carousel.data-api', '[data-slide]', clickhandler)
.on('click.bs.carousel.data-api', '[data-slide-to]', clickhandler)
$(window).on('load', function () {
$('[data-ride="carousel"]').each(function () {
var $carousel = $(this)
plugin.call($carousel, $carousel.data())
})
})
}(jquery);
/* ========================================================================
* bootstrap: collapse.js v3.3.4
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// collapse public class definition
// ================================
var collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, collapse.defaults, options)
this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
this.transitioning = null
if (this.options.parent) {
this.$parent = this.getparent()
} else {
this.addariaandcollapsedclass(this.$element, this.$trigger)
}
if (this.options.toggle) this.toggle()
}
collapse.version = '3.3.4'
collapse.transition_duration = 350
collapse.defaults = {
toggle: true
}
collapse.prototype.dimension = function () {
var haswidth = this.$element.hasclass('width')
return haswidth ? 'width' : 'height'
}
collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasclass('in')) return
var activesdata
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
if (actives && actives.length) {
activesdata = actives.data('bs.collapse')
if (activesdata && activesdata.transitioning) return
}
var startevent = $.event('show.bs.collapse')
this.$element.trigger(startevent)
if (startevent.isdefaultprevented()) return
if (actives && actives.length) {
plugin.call(actives, 'hide')
activesdata || actives.data('bs.collapse', null)
}
var dimension = this.dimension()
this.$element
.removeclass('collapse')
.addclass('collapsing')[dimension](0)
.attr('aria-expanded', true)
this.$trigger
.removeclass('collapsed')
.attr('aria-expanded', true)
this.transitioning = 1
var complete = function () {
this.$element
.removeclass('collapsing')
.addclass('collapse in')[dimension]('')
this.transitioning = 0
this.$element
.trigger('shown.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
var scrollsize = $.camelcase(['scroll', dimension].join('-'))
this.$element
.one('bstransitionend', $.proxy(complete, this))
.emulatetransitionend(collapse.transition_duration)[dimension](this.$element[0][scrollsize])
}
collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasclass('in')) return
var startevent = $.event('hide.bs.collapse')
this.$element.trigger(startevent)
if (startevent.isdefaultprevented()) return
var dimension = this.dimension()
this.$element[dimension](this.$element[dimension]())[0].offsetheight
this.$element
.addclass('collapsing')
.removeclass('collapse in')
.attr('aria-expanded', false)
this.$trigger
.addclass('collapsed')
.attr('aria-expanded', false)
this.transitioning = 1
var complete = function () {
this.transitioning = 0
this.$element
.removeclass('collapsing')
.addclass('collapse')
.trigger('hidden.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
this.$element
[dimension](0)
.one('bstransitionend', $.proxy(complete, this))
.emulatetransitionend(collapse.transition_duration)
}
collapse.prototype.toggle = function () {
this[this.$element.hasclass('in') ? 'hide' : 'show']()
}
collapse.prototype.getparent = function () {
return $(this.options.parent)
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
.each($.proxy(function (i, element) {
var $element = $(element)
this.addariaandcollapsedclass(gettargetfromtrigger($element), $element)
}, this))
.end()
}
collapse.prototype.addariaandcollapsedclass = function ($element, $trigger) {
var isopen = $element.hasclass('in')
$element.attr('aria-expanded', isopen)
$trigger
.toggleclass('collapsed', !isopen)
.attr('aria-expanded', isopen)
}
function gettargetfromtrigger($trigger) {
var href
var target = $trigger.attr('data-target')
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
return $(target)
}
// collapse plugin definition
// ==========================
function plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.collapse')
var options = $.extend({}, collapse.defaults, $this.data(), typeof option == 'object' && option)
if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
if (!data) $this.data('bs.collapse', (data = new collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.collapse
$.fn.collapse = plugin
$.fn.collapse.constructor = collapse
// collapse no conflict
// ====================
$.fn.collapse.noconflict = function () {
$.fn.collapse = old
return this
}
// collapse data-api
// =================
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
var $this = $(this)
if (!$this.attr('data-target')) e.preventdefault()
var $target = gettargetfromtrigger($this)
var data = $target.data('bs.collapse')
var option = data ? 'toggle' : $this.data()
plugin.call($target, option)
})
}(jquery);
/* ========================================================================
* bootstrap: dropdown.js v3.3.4
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// dropdown class definition
// =========================
var backdrop = '.dropdown-backdrop'
var toggle = '[data-toggle="dropdown"]'
var dropdown = function (element) {
$(element).on('click.bs.dropdown', this.toggle)
}
dropdown.version = '3.3.4'
dropdown.prototype.toggle = function (e) {
var $this = $(this)
if ($this.is('.disabled, :disabled')) return
var $parent = getparent($this)
var isactive = $parent.hasclass('open')
clearmenus()
if (!isactive) {
if ('ontouchstart' in document.documentelement && !$parent.closest('.navbar-nav').length) {
// if mobile we use a backdrop because click events don't delegate
$('').insertafter($(this)).on('click', clearmenus)
}
var relatedtarget = { relatedtarget: this }
$parent.trigger(e = $.event('show.bs.dropdown', relatedtarget))
if (e.isdefaultprevented()) return
$this
.trigger('focus')
.attr('aria-expanded', 'true')
$parent
.toggleclass('open')
.trigger('shown.bs.dropdown', relatedtarget)
}
return false
}
dropdown.prototype.keydown = function (e) {
if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagname)) return
var $this = $(this)
e.preventdefault()
e.stoppropagation()
if ($this.is('.disabled, :disabled')) return
var $parent = getparent($this)
var isactive = $parent.hasclass('open')
if ((!isactive && e.which != 27) || (isactive && e.which == 27)) {
if (e.which == 27) $parent.find(toggle).trigger('focus')
return $this.trigger('click')
}
var desc = ' li:not(.disabled):visible a'
var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
if (!$items.length) return
var index = $items.index(e.target)
if (e.which == 38 && index > 0) index-- // up
if (e.which == 40 && index < $items.length - 1) index++ // down
if (!~index) index = 0
$items.eq(index).trigger('focus')
}
function clearmenus(e) {
if (e && e.which === 3) return
$(backdrop).remove()
$(toggle).each(function () {
var $this = $(this)
var $parent = getparent($this)
var relatedtarget = { relatedtarget: this }
if (!$parent.hasclass('open')) return
$parent.trigger(e = $.event('hide.bs.dropdown', relatedtarget))
if (e.isdefaultprevented()) return
$this.attr('aria-expanded', 'false')
$parent.removeclass('open').trigger('hidden.bs.dropdown', relatedtarget)
})
}
function getparent($this) {
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && /#[a-za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = selector && $(selector)
return $parent && $parent.length ? $parent : $this.parent()
}
// dropdown plugin definition
// ==========================
function plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.dropdown')
if (!data) $this.data('bs.dropdown', (data = new dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
var old = $.fn.dropdown
$.fn.dropdown = plugin
$.fn.dropdown.constructor = dropdown
// dropdown no conflict
// ====================
$.fn.dropdown.noconflict = function () {
$.fn.dropdown = old
return this
}
// apply to standard dropdown elements
// ===================================
$(document)
.on('click.bs.dropdown.data-api', clearmenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stoppropagation() })
.on('click.bs.dropdown.data-api', toggle, dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle, dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', '[role="menu"]', dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', '[role="listbox"]', dropdown.prototype.keydown)
}(jquery);
/* ========================================================================
* bootstrap: modal.js v3.3.4
* http://getbootstrap.com/javascript/#modals
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// modal class definition
// ======================
var modal = function (element, options) {
this.options = options
this.$body = $(document.body)
this.$element = $(element)
this.$dialog = this.$element.find('.modal-dialog')
this.$backdrop = null
this.isshown = null
this.originalbodypad = null
this.scrollbarwidth = 0
this.ignorebackdropclick = false
if (this.options.remote) {
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
}
}
modal.version = '3.3.4'
modal.transition_duration = 300
modal.backdrop_transition_duration = 150
modal.defaults = {
backdrop: true,
keyboard: true,
show: true
}
modal.prototype.toggle = function (_relatedtarget) {
return this.isshown ? this.hide() : this.show(_relatedtarget)
}
modal.prototype.show = function (_relatedtarget) {
var that = this
var e = $.event('show.bs.modal', { relatedtarget: _relatedtarget })
this.$element.trigger(e)
if (this.isshown || e.isdefaultprevented()) return
this.isshown = true
this.checkscrollbar()
this.setscrollbar()
this.$body.addclass('modal-open')
this.escape()
this.resize()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.$dialog.on('mousedown.dismiss.bs.modal', function () {
that.$element.one('mouseup.dismiss.bs.modal', function (e) {
if ($(e.target).is(that.$element)) that.ignorebackdropclick = true
})
})
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasclass('fade')
if (!that.$element.parent().length) {
that.$element.appendto(that.$body) // don't move modals dom position
}
that.$element
.show()
.scrolltop(0)
that.adjustdialog()
if (transition) {
that.$element[0].offsetwidth // force reflow
}
that.$element
.addclass('in')
.attr('aria-hidden', false)
that.enforcefocus()
var e = $.event('shown.bs.modal', { relatedtarget: _relatedtarget })
transition ?
that.$dialog // wait for modal to slide in
.one('bstransitionend', function () {
that.$element.trigger('focus').trigger(e)
})
.emulatetransitionend(modal.transition_duration) :
that.$element.trigger('focus').trigger(e)
})
}
modal.prototype.hide = function (e) {
if (e) e.preventdefault()
e = $.event('hide.bs.modal')
this.$element.trigger(e)
if (!this.isshown || e.isdefaultprevented()) return
this.isshown = false
this.escape()
this.resize()
$(document).off('focusin.bs.modal')
this.$element
.removeclass('in')
.attr('aria-hidden', true)
.off('click.dismiss.bs.modal')
.off('mouseup.dismiss.bs.modal')
this.$dialog.off('mousedown.dismiss.bs.modal')
$.support.transition && this.$element.hasclass('fade') ?
this.$element
.one('bstransitionend', $.proxy(this.hidemodal, this))
.emulatetransitionend(modal.transition_duration) :
this.hidemodal()
}
modal.prototype.enforcefocus = function () {
$(document)
.off('focusin.bs.modal') // guard against infinite focus loop
.on('focusin.bs.modal', $.proxy(function (e) {
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
this.$element.trigger('focus')
}
}, this))
}
modal.prototype.escape = function () {
if (this.isshown && this.options.keyboard) {
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
e.which == 27 && this.hide()
}, this))
} else if (!this.isshown) {
this.$element.off('keydown.dismiss.bs.modal')
}
}
modal.prototype.resize = function () {
if (this.isshown) {
$(window).on('resize.bs.modal', $.proxy(this.handleupdate, this))
} else {
$(window).off('resize.bs.modal')
}
}
modal.prototype.hidemodal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.$body.removeclass('modal-open')
that.resetadjustments()
that.resetscrollbar()
that.$element.trigger('hidden.bs.modal')
})
}
modal.prototype.removebackdrop = function () {
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}
modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasclass('fade') ? 'fade' : ''
if (this.isshown && this.options.backdrop) {
var doanimate = $.support.transition && animate
this.$backdrop = $('')
.appendto(this.$body)
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
if (this.ignorebackdropclick) {
this.ignorebackdropclick = false
return
}
if (e.target !== e.currenttarget) return
this.options.backdrop == 'static'
? this.$element[0].focus()
: this.hide()
}, this))
if (doanimate) this.$backdrop[0].offsetwidth // force reflow
this.$backdrop.addclass('in')
if (!callback) return
doanimate ?
this.$backdrop
.one('bstransitionend', callback)
.emulatetransitionend(modal.backdrop_transition_duration) :
callback()
} else if (!this.isshown && this.$backdrop) {
this.$backdrop.removeclass('in')
var callbackremove = function () {
that.removebackdrop()
callback && callback()
}
$.support.transition && this.$element.hasclass('fade') ?
this.$backdrop
.one('bstransitionend', callbackremove)
.emulatetransitionend(modal.backdrop_transition_duration) :
callbackremove()
} else if (callback) {
callback()
}
}
// these following methods are used to handle overflowing modals
modal.prototype.handleupdate = function () {
this.adjustdialog()
}
modal.prototype.adjustdialog = function () {
var modalisoverflowing = this.$element[0].scrollheight > document.documentelement.clientheight
this.$element.css({
paddingleft: !this.bodyisoverflowing && modalisoverflowing ? this.scrollbarwidth : '',
paddingright: this.bodyisoverflowing && !modalisoverflowing ? this.scrollbarwidth : ''
})
}
modal.prototype.resetadjustments = function () {
this.$element.css({
paddingleft: '',
paddingright: ''
})
}
modal.prototype.checkscrollbar = function () {
var fullwindowwidth = window.innerwidth
if (!fullwindowwidth) { // workaround for missing window.innerwidth in ie8
var documentelementrect = document.documentelement.getboundingclientrect()
fullwindowwidth = documentelementrect.right - math.abs(documentelementrect.left)
}
this.bodyisoverflowing = document.body.clientwidth < fullwindowwidth
this.scrollbarwidth = this.measurescrollbar()
}
modal.prototype.setscrollbar = function () {
var bodypad = parseint((this.$body.css('padding-right') || 0), 10)
this.originalbodypad = document.body.style.paddingright || ''
if (this.bodyisoverflowing) this.$body.css('padding-right', bodypad + this.scrollbarwidth)
}
modal.prototype.resetscrollbar = function () {
this.$body.css('padding-right', this.originalbodypad)
}
modal.prototype.measurescrollbar = function () { // thx walsh
var scrolldiv = document.createelement('div')
scrolldiv.classname = 'modal-scrollbar-measure'
this.$body.append(scrolldiv)
var scrollbarwidth = scrolldiv.offsetwidth - scrolldiv.clientwidth
this.$body[0].removechild(scrolldiv)
return scrollbarwidth
}
// modal plugin definition
// =======================
function plugin(option, _relatedtarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.modal')
var options = $.extend({}, modal.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new modal(this, options)))
if (typeof option == 'string') data[option](_relatedtarget)
else if (options.show) data.show(_relatedtarget)
})
}
var old = $.fn.modal
$.fn.modal = plugin
$.fn.modal.constructor = modal
// modal no conflict
// =================
$.fn.modal.noconflict = function () {
$.fn.modal = old
return this
}
// modal data-api
// ==============
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
if ($this.is('a')) e.preventdefault()
$target.one('show.bs.modal', function (showevent) {
if (showevent.isdefaultprevented()) return // only register focus restorer if modal will actually get shown
$target.one('hidden.bs.modal', function () {
$this.is(':visible') && $this.trigger('focus')
})
})
plugin.call($target, option, this)
})
}(jquery);
/* ========================================================================
* bootstrap: tooltip.js v3.3.4
* http://getbootstrap.com/javascript/#tooltip
* inspired by the original jquery.tipsy by jason frame
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// tooltip public class definition
// ===============================
var tooltip = function (element, options) {
this.type = null
this.options = null
this.enabled = null
this.timeout = null
this.hoverstate = null
this.$element = null
this.init('tooltip', element, options)
}
tooltip.version = '3.3.4'
tooltip.transition_duration = 150
tooltip.defaults = {
animation: true,
placement: 'top',
selector: false,
template: '',
trigger: 'hover focus',
title: '',
delay: 0,
html: false,
container: false,
viewport: {
selector: 'body',
padding: 0
}
}
tooltip.prototype.init = function (type, element, options) {
this.enabled = true
this.type = type
this.$element = $(element)
this.options = this.getoptions(options)
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
if (this.$element[0] instanceof document.constructor && !this.options.selector) {
throw new error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
}
var triggers = this.options.trigger.split(' ')
for (var i = triggers.length; i--;) {
var trigger = triggers[i]
if (trigger == 'click') {
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
} else if (trigger != 'manual') {
var eventin = trigger == 'hover' ? 'mouseenter' : 'focusin'
var eventout = trigger == 'hover' ? 'mouseleave' : 'focusout'
this.$element.on(eventin + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventout + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
}
this.options.selector ?
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixtitle()
}
tooltip.prototype.getdefaults = function () {
return tooltip.defaults
}
tooltip.prototype.getoptions = function (options) {
options = $.extend({}, this.getdefaults(), this.$element.data(), options)
if (options.delay && typeof options.delay == 'number') {
options.delay = {
show: options.delay,
hide: options.delay
}
}
return options
}
tooltip.prototype.getdelegateoptions = function () {
var options = {}
var defaults = this.getdefaults()
this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
})
return options
}
tooltip.prototype.enter = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currenttarget).data('bs.' + this.type)
if (self && self.$tip && self.$tip.is(':visible')) {
self.hoverstate = 'in'
return
}
if (!self) {
self = new this.constructor(obj.currenttarget, this.getdelegateoptions())
$(obj.currenttarget).data('bs.' + this.type, self)
}
cleartimeout(self.timeout)
self.hoverstate = 'in'
if (!self.options.delay || !self.options.delay.show) return self.show()
self.timeout = settimeout(function () {
if (self.hoverstate == 'in') self.show()
}, self.options.delay.show)
}
tooltip.prototype.leave = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currenttarget).data('bs.' + this.type)
if (!self) {
self = new this.constructor(obj.currenttarget, this.getdelegateoptions())
$(obj.currenttarget).data('bs.' + this.type, self)
}
cleartimeout(self.timeout)
self.hoverstate = 'out'
if (!self.options.delay || !self.options.delay.hide) return self.hide()
self.timeout = settimeout(function () {
if (self.hoverstate == 'out') self.hide()
}, self.options.delay.hide)
}
tooltip.prototype.show = function () {
var e = $.event('show.bs.' + this.type)
if (this.hascontent() && this.enabled) {
this.$element.trigger(e)
var indom = $.contains(this.$element[0].ownerdocument.documentelement, this.$element[0])
if (e.isdefaultprevented() || !indom) return
var that = this
var $tip = this.tip()
var tipid = this.getuid(this.type)
this.setcontent()
$tip.attr('id', tipid)
this.$element.attr('aria-describedby', tipid)
if (this.options.animation) $tip.addclass('fade')
var placement = typeof this.options.placement == 'function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
var autotoken = /\s?auto?\s?/i
var autoplace = autotoken.test(placement)
if (autoplace) placement = placement.replace(autotoken, '') || 'top'
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
.addclass(placement)
.data('bs.' + this.type, this)
this.options.container ? $tip.appendto(this.options.container) : $tip.insertafter(this.$element)
var pos = this.getposition()
var actualwidth = $tip[0].offsetwidth
var actualheight = $tip[0].offsetheight
if (autoplace) {
var orgplacement = placement
var $container = this.options.container ? $(this.options.container) : this.$element.parent()
var containerdim = this.getposition($container)
placement = placement == 'bottom' && pos.bottom + actualheight > containerdim.bottom ? 'top' :
placement == 'top' && pos.top - actualheight < containerdim.top ? 'bottom' :
placement == 'right' && pos.right + actualwidth > containerdim.width ? 'left' :
placement == 'left' && pos.left - actualwidth < containerdim.left ? 'right' :
placement
$tip
.removeclass(orgplacement)
.addclass(placement)
}
var calculatedoffset = this.getcalculatedoffset(placement, pos, actualwidth, actualheight)
this.applyplacement(calculatedoffset, placement)
var complete = function () {
var prevhoverstate = that.hoverstate
that.$element.trigger('shown.bs.' + that.type)
that.hoverstate = null
if (prevhoverstate == 'out') that.leave(that)
}
$.support.transition && this.$tip.hasclass('fade') ?
$tip
.one('bstransitionend', complete)
.emulatetransitionend(tooltip.transition_duration) :
complete()
}
}
tooltip.prototype.applyplacement = function (offset, placement) {
var $tip = this.tip()
var width = $tip[0].offsetwidth
var height = $tip[0].offsetheight
// manually read margins because getboundingclientrect includes difference
var margintop = parseint($tip.css('margin-top'), 10)
var marginleft = parseint($tip.css('margin-left'), 10)
// we must check for nan for ie 8/9
if (isnan(margintop)) margintop = 0
if (isnan(marginleft)) marginleft = 0
offset.top = offset.top + margintop
offset.left = offset.left + marginleft
// $.fn.offset doesn't round pixel values
// so we use setoffset directly with our own function b-0
$.offset.setoffset($tip[0], $.extend({
using: function (props) {
$tip.css({
top: math.round(props.top),
left: math.round(props.left)
})
}
}, offset), 0)
$tip.addclass('in')
// check to see if placing tip in new offset caused the tip to resize itself
var actualwidth = $tip[0].offsetwidth
var actualheight = $tip[0].offsetheight
if (placement == 'top' && actualheight != height) {
offset.top = offset.top + height - actualheight
}
var delta = this.getviewportadjusteddelta(placement, offset, actualwidth, actualheight)
if (delta.left) offset.left += delta.left
else offset.top += delta.top
var isvertical = /top|bottom/.test(placement)
var arrowdelta = isvertical ? delta.left * 2 - width + actualwidth : delta.top * 2 - height + actualheight
var arrowoffsetposition = isvertical ? 'offsetwidth' : 'offsetheight'
$tip.offset(offset)
this.replacearrow(arrowdelta, $tip[0][arrowoffsetposition], isvertical)
}
tooltip.prototype.replacearrow = function (delta, dimension, isvertical) {
this.arrow()
.css(isvertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
.css(isvertical ? 'top' : 'left', '')
}
tooltip.prototype.setcontent = function () {
var $tip = this.tip()
var title = this.gettitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
$tip.removeclass('fade in top bottom left right')
}
tooltip.prototype.hide = function (callback) {
var that = this
var $tip = $(this.$tip)
var e = $.event('hide.bs.' + this.type)
function complete() {
if (that.hoverstate != 'in') $tip.detach()
that.$element
.removeattr('aria-describedby')
.trigger('hidden.bs.' + that.type)
callback && callback()
}
this.$element.trigger(e)
if (e.isdefaultprevented()) return
$tip.removeclass('in')
$.support.transition && $tip.hasclass('fade') ?
$tip
.one('bstransitionend', complete)
.emulatetransitionend(tooltip.transition_duration) :
complete()
this.hoverstate = null
return this
}
tooltip.prototype.fixtitle = function () {
var $e = this.$element
if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
}
}
tooltip.prototype.hascontent = function () {
return this.gettitle()
}
tooltip.prototype.getposition = function ($element) {
$element = $element || this.$element
var el = $element[0]
var isbody = el.tagname == 'body'
var elrect = el.getboundingclientrect()
if (elrect.width == null) {
// width and height are missing in ie8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
elrect = $.extend({}, elrect, { width: elrect.right - elrect.left, height: elrect.bottom - elrect.top })
}
var eloffset = isbody ? { top: 0, left: 0 } : $element.offset()
var scroll = { scroll: isbody ? document.documentelement.scrolltop || document.body.scrolltop : $element.scrolltop() }
var outerdims = isbody ? { width: $(window).width(), height: $(window).height() } : null
return $.extend({}, elrect, scroll, outerdims, eloffset)
}
tooltip.prototype.getcalculatedoffset = function (placement, pos, actualwidth, actualheight) {
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualwidth / 2 } :
placement == 'top' ? { top: pos.top - actualheight, left: pos.left + pos.width / 2 - actualwidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2 - actualheight / 2, left: pos.left - actualwidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualheight / 2, left: pos.left + pos.width }
}
tooltip.prototype.getviewportadjusteddelta = function (placement, pos, actualwidth, actualheight) {
var delta = { top: 0, left: 0 }
if (!this.$viewport) return delta
var viewportpadding = this.options.viewport && this.options.viewport.padding || 0
var viewportdimensions = this.getposition(this.$viewport)
if (/right|left/.test(placement)) {
var topedgeoffset = pos.top - viewportpadding - viewportdimensions.scroll
var bottomedgeoffset = pos.top + viewportpadding - viewportdimensions.scroll + actualheight
if (topedgeoffset < viewportdimensions.top) { // top overflow
delta.top = viewportdimensions.top - topedgeoffset
} else if (bottomedgeoffset > viewportdimensions.top + viewportdimensions.height) { // bottom overflow
delta.top = viewportdimensions.top + viewportdimensions.height - bottomedgeoffset
}
} else {
var leftedgeoffset = pos.left - viewportpadding
var rightedgeoffset = pos.left + viewportpadding + actualwidth
if (leftedgeoffset < viewportdimensions.left) { // left overflow
delta.left = viewportdimensions.left - leftedgeoffset
} else if (rightedgeoffset > viewportdimensions.width) { // right overflow
delta.left = viewportdimensions.left + viewportdimensions.width - rightedgeoffset
}
}
return delta
}
tooltip.prototype.gettitle = function () {
var title
var $e = this.$element
var o = this.options
title = $e.attr('data-original-title')
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
return title
}
tooltip.prototype.getuid = function (prefix) {
do prefix += ~~(math.random() * 1000000)
while (document.getelementbyid(prefix))
return prefix
}
tooltip.prototype.tip = function () {
return (this.$tip = this.$tip || $(this.options.template))
}
tooltip.prototype.arrow = function () {
return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
}
tooltip.prototype.enable = function () {
this.enabled = true
}
tooltip.prototype.disable = function () {
this.enabled = false
}
tooltip.prototype.toggleenabled = function () {
this.enabled = !this.enabled
}
tooltip.prototype.toggle = function (e) {
var self = this
if (e) {
self = $(e.currenttarget).data('bs.' + this.type)
if (!self) {
self = new this.constructor(e.currenttarget, this.getdelegateoptions())
$(e.currenttarget).data('bs.' + this.type, self)
}
}
self.tip().hasclass('in') ? self.leave(self) : self.enter(self)
}
tooltip.prototype.destroy = function () {
var that = this
cleartimeout(this.timeout)
this.hide(function () {
that.$element.off('.' + that.type).removedata('bs.' + that.type)
})
}
// tooltip plugin definition
// =========================
function plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tooltip')
var options = typeof option == 'object' && option
if (!data && /destroy|hide/.test(option)) return
if (!data) $this.data('bs.tooltip', (data = new tooltip(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.tooltip
$.fn.tooltip = plugin
$.fn.tooltip.constructor = tooltip
// tooltip no conflict
// ===================
$.fn.tooltip.noconflict = function () {
$.fn.tooltip = old
return this
}
}(jquery);
/* ========================================================================
* bootstrap: popover.js v3.3.4
* http://getbootstrap.com/javascript/#popovers
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// popover public class definition
// ===============================
var popover = function (element, options) {
this.init('popover', element, options)
}
if (!$.fn.tooltip) throw new error('popover requires tooltip.js')
popover.version = '3.3.4'
popover.defaults = $.extend({}, $.fn.tooltip.constructor.defaults, {
placement: 'right',
trigger: 'click',
content: '',
template: ''
})
// note: popover extends tooltip.js
// ================================
popover.prototype = $.extend({}, $.fn.tooltip.constructor.prototype)
popover.prototype.constructor = popover
popover.prototype.getdefaults = function () {
return popover.defaults
}
popover.prototype.setcontent = function () {
var $tip = this.tip()
var title = this.gettitle()
var content = this.getcontent()
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
$tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
](content)
$tip.removeclass('fade top bottom left right in')
// ie8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
// this manually by checking the contents.
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
}
popover.prototype.hascontent = function () {
return this.gettitle() || this.getcontent()
}
popover.prototype.getcontent = function () {
var $e = this.$element
var o = this.options
return $e.attr('data-content')
|| (typeof o.content == 'function' ?
o.content.call($e[0]) :
o.content)
}
popover.prototype.arrow = function () {
return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
}
// popover plugin definition
// =========================
function plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.popover')
var options = typeof option == 'object' && option
if (!data && /destroy|hide/.test(option)) return
if (!data) $this.data('bs.popover', (data = new popover(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.popover
$.fn.popover = plugin
$.fn.popover.constructor = popover
// popover no conflict
// ===================
$.fn.popover.noconflict = function () {
$.fn.popover = old
return this
}
}(jquery);
/* ========================================================================
* bootstrap: scrollspy.js v3.3.4
* http://getbootstrap.com/javascript/#scrollspy
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// scrollspy class definition
// ==========================
function scrollspy(element, options) {
this.$body = $(document.body)
this.$scrollelement = $(element).is(document.body) ? $(window) : $(element)
this.options = $.extend({}, scrollspy.defaults, options)
this.selector = (this.options.target || '') + ' .nav li > a'
this.offsets = []
this.targets = []
this.activetarget = null
this.scrollheight = 0
this.$scrollelement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
this.refresh()
this.process()
}
scrollspy.version = '3.3.4'
scrollspy.defaults = {
offset: 10
}
scrollspy.prototype.getscrollheight = function () {
return this.$scrollelement[0].scrollheight || math.max(this.$body[0].scrollheight, document.documentelement.scrollheight)
}
scrollspy.prototype.refresh = function () {
var that = this
var offsetmethod = 'offset'
var offsetbase = 0
this.offsets = []
this.targets = []
this.scrollheight = this.getscrollheight()
if (!$.iswindow(this.$scrollelement[0])) {
offsetmethod = 'position'
offsetbase = this.$scrollelement.scrolltop()
}
this.$body
.find(this.selector)
.map(function () {
var $el = $(this)
var href = $el.data('target') || $el.attr('href')
var $href = /^#./.test(href) && $(href)
return ($href
&& $href.length
&& $href.is(':visible')
&& [[$href[offsetmethod]().top + offsetbase, href]]) || null
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
that.offsets.push(this[0])
that.targets.push(this[1])
})
}
scrollspy.prototype.process = function () {
var scrolltop = this.$scrollelement.scrolltop() + this.options.offset
var scrollheight = this.getscrollheight()
var maxscroll = this.options.offset + scrollheight - this.$scrollelement.height()
var offsets = this.offsets
var targets = this.targets
var activetarget = this.activetarget
var i
if (this.scrollheight != scrollheight) {
this.refresh()
}
if (scrolltop >= maxscroll) {
return activetarget != (i = targets[targets.length - 1]) && this.activate(i)
}
if (activetarget && scrolltop < offsets[0]) {
this.activetarget = null
return this.clear()
}
for (i = offsets.length; i--;) {
activetarget != targets[i]
&& scrolltop >= offsets[i]
&& (offsets[i + 1] === undefined || scrolltop < offsets[i + 1])
&& this.activate(targets[i])
}
}
scrollspy.prototype.activate = function (target) {
this.activetarget = target
this.clear()
var selector = this.selector +
'[data-target="' + target + '"],' +
this.selector + '[href="' + target + '"]'
var active = $(selector)
.parents('li')
.addclass('active')
if (active.parent('.dropdown-menu').length) {
active = active
.closest('li.dropdown')
.addclass('active')
}
active.trigger('activate.bs.scrollspy')
}
scrollspy.prototype.clear = function () {
$(this.selector)
.parentsuntil(this.options.target, '.active')
.removeclass('active')
}
// scrollspy plugin definition
// ===========================
function plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.scrollspy')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.scrollspy', (data = new scrollspy(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.scrollspy
$.fn.scrollspy = plugin
$.fn.scrollspy.constructor = scrollspy
// scrollspy no conflict
// =====================
$.fn.scrollspy.noconflict = function () {
$.fn.scrollspy = old
return this
}
// scrollspy data-api
// ==================
$(window).on('load.bs.scrollspy.data-api', function () {
$('[data-spy="scroll"]').each(function () {
var $spy = $(this)
plugin.call($spy, $spy.data())
})
})
}(jquery);
/* ========================================================================
* bootstrap: tab.js v3.3.4
* http://getbootstrap.com/javascript/#tabs
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// tab class definition
// ====================
var tab = function (element) {
this.element = $(element)
}
tab.version = '3.3.4'
tab.transition_duration = 150
tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.data('target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
if ($this.parent('li').hasclass('active')) return
var $previous = $ul.find('.active:last a')
var hideevent = $.event('hide.bs.tab', {
relatedtarget: $this[0]
})
var showevent = $.event('show.bs.tab', {
relatedtarget: $previous[0]
})
$previous.trigger(hideevent)
$this.trigger(showevent)
if (showevent.isdefaultprevented() || hideevent.isdefaultprevented()) return
var $target = $(selector)
this.activate($this.closest('li'), $ul)
this.activate($target, $target.parent(), function () {
$previous.trigger({
type: 'hidden.bs.tab',
relatedtarget: $this[0]
})
$this.trigger({
type: 'shown.bs.tab',
relatedtarget: $previous[0]
})
})
}
tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& (($active.length && $active.hasclass('fade')) || !!container.find('> .fade').length)
function next() {
$active
.removeclass('active')
.find('> .dropdown-menu > .active')
.removeclass('active')
.end()
.find('[data-toggle="tab"]')
.attr('aria-expanded', false)
element
.addclass('active')
.find('[data-toggle="tab"]')
.attr('aria-expanded', true)
if (transition) {
element[0].offsetwidth // reflow for transition
element.addclass('in')
} else {
element.removeclass('fade')
}
if (element.parent('.dropdown-menu').length) {
element
.closest('li.dropdown')
.addclass('active')
.end()
.find('[data-toggle="tab"]')
.attr('aria-expanded', true)
}
callback && callback()
}
$active.length && transition ?
$active
.one('bstransitionend', next)
.emulatetransitionend(tab.transition_duration) :
next()
$active.removeclass('in')
}
// tab plugin definition
// =====================
function plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tab')
if (!data) $this.data('bs.tab', (data = new tab(this)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.tab
$.fn.tab = plugin
$.fn.tab.constructor = tab
// tab no conflict
// ===============
$.fn.tab.noconflict = function () {
$.fn.tab = old
return this
}
// tab data-api
// ============
var clickhandler = function (e) {
e.preventdefault()
plugin.call($(this), 'show')
}
$(document)
.on('click.bs.tab.data-api', '[data-toggle="tab"]', clickhandler)
.on('click.bs.tab.data-api', '[data-toggle="pill"]', clickhandler)
}(jquery);
/* ========================================================================
* bootstrap: affix.js v3.3.4
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* copyright 2011-2015 twitter, inc.
* licensed under mit (https://github.com/twbs/bootstrap/blob/master/license)
* ======================================================================== */
+function ($) {
'use strict';
// affix class definition
// ======================
var affix = function (element, options) {
this.options = $.extend({}, affix.defaults, options)
this.$target = $(this.options.target)
.on('scroll.bs.affix.data-api', $.proxy(this.checkposition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkpositionwitheventloop, this))
this.$element = $(element)
this.affixed = null
this.unpin = null
this.pinnedoffset = null
this.checkposition()
}
affix.version = '3.3.4'
affix.reset = 'affix affix-top affix-bottom'
affix.defaults = {
offset: 0,
target: window
}
affix.prototype.getstate = function (scrollheight, height, offsettop, offsetbottom) {
var scrolltop = this.$target.scrolltop()
var position = this.$element.offset()
var targetheight = this.$target.height()
if (offsettop != null && this.affixed == 'top') return scrolltop < offsettop ? 'top' : false
if (this.affixed == 'bottom') {
if (offsettop != null) return (scrolltop + this.unpin <= position.top) ? false : 'bottom'
return (scrolltop + targetheight <= scrollheight - offsetbottom) ? false : 'bottom'
}
var initializing = this.affixed == null
var collidertop = initializing ? scrolltop : position.top
var colliderheight = initializing ? targetheight : height
if (offsettop != null && scrolltop <= offsettop) return 'top'
if (offsetbottom != null && (collidertop + colliderheight >= scrollheight - offsetbottom)) return 'bottom'
return false
}
affix.prototype.getpinnedoffset = function () {
if (this.pinnedoffset) return this.pinnedoffset
this.$element.removeclass(affix.reset).addclass('affix')
var scrolltop = this.$target.scrolltop()
var position = this.$element.offset()
return (this.pinnedoffset = position.top - scrolltop)
}
affix.prototype.checkpositionwitheventloop = function () {
settimeout($.proxy(this.checkposition, this), 1)
}
affix.prototype.checkposition = function () {
if (!this.$element.is(':visible')) return
var height = this.$element.height()
var offset = this.options.offset
var offsettop = offset.top
var offsetbottom = offset.bottom
var scrollheight = $(document.body).height()
if (typeof offset != 'object') offsetbottom = offsettop = offset
if (typeof offsettop == 'function') offsettop = offset.top(this.$element)
if (typeof offsetbottom == 'function') offsetbottom = offset.bottom(this.$element)
var affix = this.getstate(scrollheight, height, offsettop, offsetbottom)
if (this.affixed != affix) {
if (this.unpin != null) this.$element.css('top', '')
var affixtype = 'affix' + (affix ? '-' + affix : '')
var e = $.event(affixtype + '.bs.affix')
this.$element.trigger(e)
if (e.isdefaultprevented()) return
this.affixed = affix
this.unpin = affix == 'bottom' ? this.getpinnedoffset() : null
this.$element
.removeclass(affix.reset)
.addclass(affixtype)
.trigger(affixtype.replace('affix', 'affixed') + '.bs.affix')
}
if (affix == 'bottom') {
this.$element.offset({
top: scrollheight - height - offsetbottom
})
}
}
// affix plugin definition
// =======================
function plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.affix')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.affix', (data = new affix(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.affix
$.fn.affix = plugin
$.fn.affix.constructor = affix
// affix no conflict
// =================
$.fn.affix.noconflict = function () {
$.fn.affix = old
return this
}
// affix data-api
// ==============
$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
var data = $spy.data()
data.offset = data.offset || {}
if (data.offsetbottom != null) data.offset.bottom = data.offsetbottom
if (data.offsettop != null) data.offset.top = data.offsettop
plugin.call($spy, data)
})
})
}(jquery);