From 0ef4a104e1e67424ded9fb201b7d6dd2c56ec3a8 Mon Sep 17 00:00:00 2001 From: Tyler Smith Date: Sat, 26 Jan 2013 01:07:07 -0800 Subject: [PATCH 01/48] Version 2.2.0 - fixing a few bugs and adding a new responsive pattern by making slider vars public. --- README.mdown | 13 +- demo/basic-carousel.html | 4 +- demo/carousel-min-max.html | 3 +- demo/dynamic-carousel-min-max.html | 229 +++++++++++++++++++ demo/index.html | 3 +- demo/thumbnail-controlnav.html | 7 +- demo/thumbnail-slider.html | 3 +- demo/video.html | 1 + flexslider.css | 2 +- jquery.flexslider-min.js | 69 +++--- jquery.flexslider.js | 343 +++++++++++++++-------------- 11 files changed, 474 insertions(+), 203 deletions(-) create mode 100644 demo/dynamic-carousel-min-max.html diff --git a/README.mdown b/README.mdown index 7ef60753..98a7444f 100644 --- a/README.mdown +++ b/README.mdown @@ -1,7 +1,17 @@ # FlexSlider 2 http://www.woothemes.com/flexslider/ - Copyright (c) 2012 WooThemes -Documentation guides for properties and theming are coming soon. Shortly thereafter, the download builder will be released, where you can create minified FlexSlider scripts that contain only the properties you need. It's a brave new world. +## Updates + +** Version 2.2 / January 25, 2013** + +- Fixed event handler conflicts with devices that are both click and touch enabled. e.g., Windows 8. +- Made all slider variables public, stored in `slider.vars`. This allows manipulation of `slider.vars.minItems` and `slider.vars.maxItems` on the fly to create different fluid grids at certain breakpoints. [Check out this example demonstrating a basic technique](http://flexslider.woothemes.com/dynamic-carousel-min-max.html) +- Fixed calculations that were causing strange issues with paging and certain FlexSliders to out of alignment. + +*Be sure to test v2.2 with your current slider, before pushing live, to ensure everything is playing nicely.* + +----- ## General Notes FlexSlider is no longer licensed under the MIT license. FlexSlider now shares the common licensed used for all WooThemes themes, GPLv2. @@ -10,7 +20,6 @@ In an effort to move the plugin forward, support for jQuery 1.3.2 has been dropp Your old styles and properties *might not work out of the box*. Some property names have been changed, noted below, as well as namespacing prefixes being applied to all elements. This means that `.flex-direction-nav .next` is now `.flex-direction-nav .flex-next` by default. The namespacing property is exposed, free for you to change. -## Updates No more overflow hidden woes! The plugin now generates a viewport element to handle the tedious task of working around overflow hidden. Yay! The slider element is now accessible outside of the callback API via the jQuery .data() method. Example use: `$('#slider').data('flexslider')` diff --git a/demo/basic-carousel.html b/demo/basic-carousel.html index 66b75de7..ef9bdb92 100644 --- a/demo/basic-carousel.html +++ b/demo/basic-carousel.html @@ -38,7 +38,8 @@

Other Examples

  • Slider w/thumbnail controlNav pattern
  • Slider w/thumbnail slider
  • Basic Carousel
  • -
  • Carousel with min and max ranges
  • +
  • Carousel with min and max ranges
  • +
  • Carousel with dynamic min/max ranges
  • Video & the api (vimeo)
  • @@ -151,6 +152,7 @@

    Basic Carousel

    animationLoop: false, itemWidth: 210, itemMargin: 5, + pausePlay: true, start: function(slider){ $('body').removeClass('loading'); } diff --git a/demo/carousel-min-max.html b/demo/carousel-min-max.html index 5d2e4ce0..7bc6c6c9 100644 --- a/demo/carousel-min-max.html +++ b/demo/carousel-min-max.html @@ -38,7 +38,8 @@

    Other Examples

  • Slider w/thumbnail controlNav pattern
  • Slider w/thumbnail slider
  • Basic Carousel
  • -
  • Carousel with min and max ranges
  • +
  • Carousel with min and max ranges
  • +
  • Carousel with dynamic min/max ranges
  • Video & the api (vimeo)
  • diff --git a/demo/dynamic-carousel-min-max.html b/demo/dynamic-carousel-min-max.html new file mode 100644 index 00000000..f812295e --- /dev/null +++ b/demo/dynamic-carousel-min-max.html @@ -0,0 +1,229 @@ + + + + + FlexSlider 2 + + + + + + + + + + + + + + + +
    + + + WooThemes + + +
    + +
    +
    +

    FlexSlider 2

    +

    The best responsive slider. Period.

    + Download Flexslider + +
    + +
    +
    + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/index.html b/demo/index.html index 300ef089..ea7eeac2 100644 --- a/demo/index.html +++ b/demo/index.html @@ -38,7 +38,8 @@

    Other Examples

  • Slider w/thumbnail controlNav pattern
  • Slider w/thumbnail slider
  • Basic Carousel
  • -
  • Carousel with min and max ranges
  • +
  • Carousel with min and max ranges
  • +
  • Carousel with dynamic min/max ranges
  • Video & the api (vimeo)
  • diff --git a/demo/thumbnail-controlnav.html b/demo/thumbnail-controlnav.html index daefb507..36c708d0 100644 --- a/demo/thumbnail-controlnav.html +++ b/demo/thumbnail-controlnav.html @@ -38,7 +38,8 @@

    Other Examples

  • Slider w/thumbnail controlNav pattern
  • Slider w/thumbnail slider
  • Basic Carousel
  • -
  • Carousel with min and max ranges
  • +
  • Carousel with min and max ranges
  • +
  • Carousel with dynamic min/max ranges
  • Video & the api (vimeo)
  • @@ -113,7 +114,9 @@

    Thumbnail ControlNav Pattern

    - + + + + + + + + + +
    + + + WooThemes + + +
    + +
    +
    +

    FlexSlider 2

    +

    The best responsive slider. Period.

    + Download Flexslider + +
    +
    +
    +
    +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/video.html b/demo/video.html index 55ac6e6b..1ed0cfd9 100644 --- a/demo/video.html +++ b/demo/video.html @@ -40,7 +40,8 @@

    Other Examples

  • Basic Carousel
  • Carousel with min and max ranges
  • Carousel with dynamic min/max ranges
  • -
  • Video & the api (vimeo)
  • +
  • Video & the api (vimeo)
  • +
  • Video & the api (wistia)
  • From 9e19b5595d5c99efca2b88d3ab48f6d6d7153dca Mon Sep 17 00:00:00 2001 From: Matty Date: Fri, 8 Feb 2013 15:08:06 +0200 Subject: [PATCH 09/48] Merged #322. --- README.mdown | 2 ++ jquery.flexslider.js | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.mdown b/README.mdown index d23ddc79..9b2233b8 100644 --- a/README.mdown +++ b/README.mdown @@ -28,6 +28,7 @@ Helper strings have been added for performing actions quickly on FlexSlider elem - `$('#slider').flexslider("play") //Play slideshow` - `$('#slider').flexslider("pause") //Pause slideshow` +- `$('#slider').flexslider("stop") //Stop slideshow` - `$('#slider').flexslider("next") //Go to next slide` - `$('#slider').flexslider("prev") //Go to previous slide` - `$('#slider').flexslider(3) //Go fourth slide` @@ -45,6 +46,7 @@ Two new methods are available for adding/removing slides, `slider.addSlide()` an - [Basic Carousel](http://flexslider.woothemes.com/basic-carousel.html) - [Carousel with min and max ranges](http://flexslider.woothemes.com/carousel-min-max.html) - [Video with Vimeo API](http://flexslider.woothemes.com/video.html) +- [Video with Wistia API](http://flexslider.woothemes.com/video-wistia.html) ## Properties diff --git a/jquery.flexslider.js b/jquery.flexslider.js index bbd49f44..f41db2d3 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -48,6 +48,7 @@ slider.args = {}; // SLIDESHOW: slider.manualPause = false; + slider.stopped = false; // TOUCH/USECSS: slider.transitions = !slider.vars.video && !fade && slider.vars.useCSS && (function() { var obj = document.createElement('div'), @@ -115,7 +116,7 @@ slider.hover(function() { if (!slider.manualPlay && !slider.manualPause) slider.pause(); }, function() { - if (!slider.manualPause && !slider.manualPlay) slider.play(); + if (!slider.manualPause && !slider.manualPlay && !slider.stopped) slider.play(); }); } // initialize animation @@ -577,6 +578,7 @@ // SLIDESHOW: slider.pause = function() { clearInterval(slider.animatedSlides); + slider.animatedSlides = null; slider.playing = false; // PAUSEPLAY: if (slider.vars.pausePlay) methods.pausePlay.update("play"); @@ -585,13 +587,18 @@ } // SLIDESHOW: slider.play = function() { - slider.animatedSlides = setInterval(slider.animateSlides, slider.vars.slideshowSpeed); + slider.animatedSlides = slider.animatedSlides || setInterval(slider.animateSlides, slider.vars.slideshowSpeed); slider.playing = true; // PAUSEPLAY: if (slider.vars.pausePlay) methods.pausePlay.update("pause"); // SYNC: if (slider.syncExists) methods.sync("play"); } + // STOP: + slider.stop = function () { + slider.pause(); + slider.stopped = true; + } slider.canAdvance = function(target, fromNav) { // ASNAV: var last = (asNav) ? slider.pagingCount - 1 : slider.last; @@ -916,6 +923,7 @@ switch (options) { case "play": $slider.play(); break; case "pause": $slider.pause(); break; + case "stop": $slider.stop(); break; case "next": $slider.flexAnimate($slider.getTarget("next"), true); break; case "prev": case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break; From f4eacda6dd6523e6f7d6c7961d3174bc2c83ae75 Mon Sep 17 00:00:00 2001 From: Matty Date: Fri, 8 Feb 2013 15:14:18 +0200 Subject: [PATCH 10/48] Merged #454. --- images/bg_direction_nav.png | Bin 1866 -> 760 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/images/bg_direction_nav.png b/images/bg_direction_nav.png index de3fe04af42bfad8029698d81efe0ab6b8c0fc98..c4536f0f5907d57f4675fc75d6497e4058c388d0 100644 GIT binary patch delta 737 zcmV<70v`R!4)_I-BYy(FNkl1izgP6!}{K1w&X_q1{6jrv?LZS5c zOtuH6mey>y?IOJiufS8U#S^bUFT*?V%u_pW$vA09GT)cN95nE5aGZIcd1938ox|bq z-{;RC&0&i?6nP~w5(!0qMduO5qxWqF*Z`L%X^EVRT%(+j>wjpzMG!Q=)k}IJ0ZIxa zzkbGei|vO1iH5l`AL?k|0v6)xM-jVw~84utni@lq{Faw|QUsPFy{2I-S1eYz+Nr zl9EdexZua{D(o+pDgZVK|=I|BZ~f{pyV;2Dzf+@%TMu zgXm8PlDP;tOhLt!l0gtW$6x_bpSa1(G)at8)`P}rBeCH5v4v1pm)7q zpQcG-oPWr5xPs_~my|@T;c)nl@h{CpoS)&Wn~Prbr%5U;2lVZB+iWx%p|*e# z^r1IJ&Lme!!g{$}o>Oig>g|HQj8D-hSHdK)yjUzQtJUg{e*s}VdeE04Xq2m93RqdK zR!>{4)}#ms>#!a@If6#H37ERF`~CiL7=~}DS6UbIFdyr%UL$CfD`9Cs&b!M~K z%YMIq)o!;Z5{@%oV;t{e9_AC|5TjhmW~}IW@t(*dktZTuobfsu_b`tkXq5XK?&JdjY##>Lop63!>>abxh>KlRv!cl0v7=dssDI5s_Jh^xSB!tA$&9QBe z7Y;WLl!-#n5WYV{0?P?vGlrm%D={_>=jE+YiX|}+3PeI1WC|wutnm~G$fQg#n8qjZ zm24_7xk^axB*2|aAXD8uJUo^F6cU+4BvFWDiYwWJL8UNAB;fM}V$l$3 z6hp}2evXB$m|!%DDj7s#e0)41o=Sj`4MZ}XPB&{%D6Sa7Rkc}xiZ!kZmD8vK2U1B8 znG%)33c#!=j)c`H6T~w8RDxXjMOLBud`#GZ5jA2ZkxU?&OBx08`Tq}<%fFyis1W*^ z?|%xbM4OcmQ3$DEH6pzAjo7=h7X0~L1xp)G`c&9O!g(yeOXjCl}o14xMWWs56@99 z2bQSikOCd$O22X`V{*+_kSnps90-xcK~gRP%Ylz2Gh}1t;>I0Q?=x3Ab}pnbxkM}( zqPemEYV_z9<{tC(i*2#R7vn<;%%je7E9`4&=5bgeO;`6W{wh3cj-jWsW^+o% zf-c>H1F0d|J6G7O{N9R{)5{7aR{M=u7SH#2f!9pB<&c~kxah6zO1D`{Tsvm?9&zL0 z@gC2dwS`cS@$fNfiNeNSlXm6G@YeRNaZz#c`{NpWhEC1?hQBgb+R4?=(Oa{}JMNjT zu(mC>%+Y!3J*}$qr#Gz%Tbvj2W+rIU*MGi#N{;?@*MmI{J^k1H6M$03;o4pHR%!NE zPd26S*49Nik9+=MO2<<8~2NFTUqG}=5bu$Z?zT+encDDb=Y=*Ed@ z7k-I4cDsE>T5F`Y$z+Q4csK6F^taAcT{?v=de@>%MhVY(XIHcKj_)7uSc5xu>}aL# zzT^~CxOeTip4#)BPxluubhOYF^|n*H8ywr_RZg>8u00l${J8g405Y&TR-brDr~Cbo zik9b)HJJY68P&;}+FBF6{pG%gLrT8qU=vrZy)3N`nw(*md`%mxR@?URj$Vr%&v~?T zGLr4GQDi!>yXxj+L8UM3W=%@LIW;X^cOq1s-f=_7BK)<3TkY=DQ{c}%o@Kl`I5gsZ zhqcSH1)Na*vbxT#BzddWkGCa1OnXmu-Ojuw)LK(BJX})c4>S6BP;rEy(!m#2dyog{+XGXg~yghaci+kHM!flB^$t3zosaY zr`Ty_&cVUKS@UfC*c}UpE2@?qY;0;8Zu!&BIHXi(rm;GF*WYwD7!2F;^70H`B`dc# zC#BsZRx%$6{Qbjrg|{R))Z`c>0fWVd@I|4wH@Q#GGL%hDNqX0OC1`ldshTmhN;=bf-)J-rmX|LYAKPQ!SYJAEO@L{yuzU*9 z)s-nYAnZfxtDbM~@9ypF{{`Pdz>1AKKc|XRoWA znOstL^Ko^m&%PPk*NGwM+iA~oUSIg3>0*7QeOUUvG!dBE;F&T{njvxHiP|djFNAI_ fPK8aaBQB?Lb01_Z&TtV_oBwV+Uje7aCnD(|B&z%S From 369619c59cfb4160a603b4d0a6638c5caa182537 Mon Sep 17 00:00:00 2001 From: Matty Date: Mon, 11 Feb 2013 10:46:50 +0200 Subject: [PATCH 11/48] Adds "videoFoam" parameter to Wistia demo example. Removes trailing spaces in all main demo and FlexSlider core files. --- demo/basic-carousel.html | 26 ++--- demo/carousel-min-max.html | 30 ++--- demo/dynamic-carousel-min-max.html | 28 ++--- demo/index.html | 28 ++--- demo/thumbnail-controlnav.html | 28 ++--- demo/thumbnail-slider.html | 32 +++--- demo/video-wistia.html | 38 +++---- demo/video.html | 54 ++++----- flexslider.css | 10 +- jquery.flexslider.js | 176 ++++++++++++++--------------- 10 files changed, 225 insertions(+), 225 deletions(-) diff --git a/demo/basic-carousel.html b/demo/basic-carousel.html index c1fe2010..126162fb 100644 --- a/demo/basic-carousel.html +++ b/demo/basic-carousel.html @@ -4,28 +4,28 @@ FlexSlider 2 - + - + - +
    - + WooThemes - +
    - +

    FlexSlider 2

    @@ -41,7 +41,7 @@

    Other Examples

  • Carousel with min and max ranges
  • Carousel with dynamic min/max ranges
  • Video & the api (vimeo)
  • -
  • Video & the api (wistia)
  • +
  • Video & the api (wistia)
  • @@ -133,16 +133,16 @@

    Basic Carousel

    - + - + - + - + - + - + \ No newline at end of file diff --git a/demo/carousel-min-max.html b/demo/carousel-min-max.html index 9bd8caa9..64be028f 100644 --- a/demo/carousel-min-max.html +++ b/demo/carousel-min-max.html @@ -4,28 +4,28 @@ FlexSlider 2 - + - + - +
    - + WooThemes - +
    - + - + - + - + - + - + - + \ No newline at end of file diff --git a/demo/dynamic-carousel-min-max.html b/demo/dynamic-carousel-min-max.html index 19e892d7..3a8b343c 100644 --- a/demo/dynamic-carousel-min-max.html +++ b/demo/dynamic-carousel-min-max.html @@ -4,28 +4,28 @@ FlexSlider 2 - + - + - +
    - + WooThemes - +
    - + - + - + - + - + @@ -220,11 +220,11 @@

    Carousel With Min & Max Ranges

    - + - + \ No newline at end of file diff --git a/demo/index.html b/demo/index.html index f735731a..8afd4037 100644 --- a/demo/index.html +++ b/demo/index.html @@ -4,28 +4,28 @@ FlexSlider 2 - + - + - +
    - + WooThemes - +
    - + - + - + - + - + - + - + \ No newline at end of file diff --git a/demo/thumbnail-controlnav.html b/demo/thumbnail-controlnav.html index 70ceb4e7..6c860888 100644 --- a/demo/thumbnail-controlnav.html +++ b/demo/thumbnail-controlnav.html @@ -4,28 +4,28 @@ FlexSlider 2 - + - + - +
    - + WooThemes - +
    - + - + - + - + @@ -137,11 +137,11 @@

    Thumbnail ControlNav Pattern

    - + - + \ No newline at end of file diff --git a/demo/thumbnail-slider.html b/demo/thumbnail-slider.html index d10851e7..efef33b8 100644 --- a/demo/thumbnail-slider.html +++ b/demo/thumbnail-slider.html @@ -4,28 +4,28 @@ FlexSlider 2 - + - + - +
    - + WooThemes - +
    - +

    FlexSlider 2

    @@ -39,9 +39,9 @@

    Other Examples

  • Slider w/thumbnail slider
  • Basic Carousel
  • Carousel with min and max ranges
  • -
  • Carousel with dynamic min/max ranges
  • +
  • Carousel with dynamic min/max ranges
  • Video & the api (vimeo)
  • -
  • Video & the api (wistia)
  • +
  • Video & the api (wistia)
  • @@ -150,7 +150,7 @@

    Slider with Carousel Slider as Navigation

    itemMargin: 5, asNavFor: '#slider' }); - + $('#slider').flexslider({ animation: "slide", controlNav: false, @@ -202,16 +202,16 @@

    Slider with Carousel Slider as Navigation

    - + - + - + - + - + - + \ No newline at end of file diff --git a/demo/video-wistia.html b/demo/video-wistia.html index 54927837..d008d942 100644 --- a/demo/video-wistia.html +++ b/demo/video-wistia.html @@ -4,31 +4,31 @@ FlexSlider 2 - + - + - +
    - + WooThemes - +
    - +

    FlexSlider 2

    @@ -41,10 +41,10 @@

    Other Examples

  • Slider w/thumbnail controlNav pattern
  • Slider w/thumbnail slider
  • Basic Carousel
  • -
  • Carousel with min and max ranges
  • +
  • Carousel with min and max ranges
  • Carousel with dynamic min/max ranges
  • Video & the api (vimeo)
  • -
  • Video & the api (wistia)
  • +
  • Video & the api (wistia)
  • @@ -53,7 +53,7 @@

    Other Examples

    • - +
    • @@ -92,7 +92,7 @@

      Video

      smoothHeight: true, start: function( slider ) { $('body').removeClass( 'loading' ); - }, + }, before: function ( slider ) { wistiaEmbed.pause(); } @@ -114,7 +114,7 @@

      Video

      <div class="flexslider"> <ul class="slides"> <li> - <iframe id="player_1" src="http://fast.wistia.com/embed/iframe/t4yniozocs?controlsVisibleOnLoad=true&playerColor=474745&version=v1&videoHeight=366&videoWidth=650&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="650" height="366"></iframe> + <iframe id="player_1" src="http://fast.wistia.com/embed/iframe/t4yniozocs?controlsVisibleOnLoad=true&playerColor=474745&version=v1&videoHeight=366&videoWidth=650&volumeControl=true&videoFoam=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="650" height="366"></iframe> </li> <li> <img src="slide2.jpg" /> @@ -131,16 +131,16 @@

      Video

    - + - + - + - + - + - + - + \ No newline at end of file diff --git a/demo/video.html b/demo/video.html index 1ed0cfd9..e7dee9d2 100644 --- a/demo/video.html +++ b/demo/video.html @@ -4,28 +4,28 @@ FlexSlider 2 - + - + - +
    - + WooThemes - +
    - +

    FlexSlider 2

    @@ -38,10 +38,10 @@

    Other Examples

  • Slider w/thumbnail controlNav pattern
  • Slider w/thumbnail slider
  • Basic Carousel
  • -
  • Carousel with min and max ranges
  • +
  • Carousel with min and max ranges
  • Carousel with dynamic min/max ranges
  • -
  • Video & the api (vimeo)
  • -
  • Video & the api (wistia)
  • +
  • Video & the api (vimeo)
  • +
  • Video & the api (wistia)
  • @@ -76,7 +76,7 @@

    Video

                 // Can also be used with $(document).ready()
                 $(window).load(function() {
    -            
    +
                   // Vimeo API nonsense
                   var player = document.getElementById('player_1');
                   $f(player).addEvent('ready', ready);
    @@ -98,8 +98,8 @@ 

    Video

    $('.flexslider').flexslider("play"); }); } - - + + // Call fitVid before FlexSlider initializes, so the proper initial height can be retrieved. $(".flexslider") .fitVids() @@ -138,43 +138,43 @@

    Video

    - + - + - + - + - + - + - + \ No newline at end of file diff --git a/flexslider.css b/flexslider.css index 94c82173..e31aad8f 100644 --- a/flexslider.css +++ b/flexslider.css @@ -9,7 +9,7 @@ * Contributing author: Tyler Smith (@mbmufffin) */ - + /* Browser Resets */ .flex-container a:active, .flexslider a:active, @@ -17,18 +17,18 @@ .flexslider a:focus {outline: none;} .slides, .flex-control-nav, -.flex-direction-nav {margin: 0; padding: 0; list-style: none;} +.flex-direction-nav {margin: 0; padding: 0; list-style: none;} /* FlexSlider Necessary Styles -*********************************/ +*********************************/ .flexslider {margin: 0; padding: 0;} .flexslider .slides > li {display: none; -webkit-backface-visibility: hidden;} /* Hide the slides before the JS is loaded. Avoids image jumping */ .flexslider .slides img {width: 100%; display: block;} .flex-pauseplay span {text-transform: capitalize;} /* Clearfix for the .slides element */ -.slides:after {content: "\0020"; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;} -html[xmlns] .slides {display: block;} +.slides:after {content: "\0020"; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;} +html[xmlns] .slides {display: block;} * html .slides {height: 1%;} /* No JavaScript Fallback */ diff --git a/jquery.flexslider.js b/jquery.flexslider.js index f41db2d3..ff38abc1 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -25,10 +25,10 @@ fade = slider.vars.animation === "fade", asNav = slider.vars.asNavFor !== "", methods = {}; - + // Store a reference to the slider object $.data(el, "flexslider", slider); - + // Private slider methods methods = { init: function() { @@ -66,27 +66,27 @@ if (slider.vars.controlsContainer !== "") slider.controlsContainer = $(slider.vars.controlsContainer).length > 0 && $(slider.vars.controlsContainer); // MANUAL: if (slider.vars.manualControls !== "") slider.manualControls = $(slider.vars.manualControls).length > 0 && $(slider.vars.manualControls); - + // RANDOMIZE: if (slider.vars.randomize) { slider.slides.sort(function() { return (Math.round(Math.random())-0.5); }); slider.container.empty().append(slider.slides); } - + slider.doMath(); - + // ASNAV: if (asNav) methods.asNav.setup(); - + // INIT slider.setup("init"); - + // CONTROLNAV: if (slider.vars.controlNav) methods.controlNav.setup(); - + // DIRECTIONNAV: if (slider.vars.directionNav) methods.directionNav.setup(); - + // KEYBOARD: if (slider.vars.keyboard && ($(slider.containerSelector).length === 1 || slider.vars.multipleKeyboard)) { $(document).bind('keyup', function(event) { @@ -106,10 +106,10 @@ slider.flexAnimate(target, slider.vars.pauseOnAction); }); } - + // PAUSEPLAY if (slider.vars.pausePlay) methods.pausePlay.setup(); - + // SLIDSESHOW if (slider.vars.slideshow) { if (slider.vars.pauseOnHover) { @@ -122,14 +122,14 @@ // initialize animation (slider.vars.initDelay > 0) ? setTimeout(slider.play, slider.vars.initDelay) : slider.play(); } - + // TOUCH if (touch && slider.vars.touch) methods.touch(); - + // FADE&&SMOOTHHEIGHT || SLIDE: if (!fade || (fade && slider.vars.smoothHeight)) $(window).bind("resize focus", methods.resize); - - + + // API: start() Callback setTimeout(function(){ slider.vars.start(slider); @@ -164,9 +164,9 @@ var type = (slider.vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging', j = 1, item; - + slider.controlNavScaffold = $('
      '); - + if (slider.pagingCount > 1) { for (var i = 0; i < slider.pagingCount; i++) { item = (slider.vars.controlNav === "thumbnails") ? '' : '' + j + ''; @@ -174,13 +174,13 @@ j++; } } - + // CONTROLSCONTAINER: (slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold) : slider.append(slider.controlNavScaffold); methods.controlNav.set(); - + methods.controlNav.active(); - + slider.controlNavScaffold.delegate('a, img', eventType, function(event) { event.preventDefault(); @@ -205,14 +205,14 @@ setupManual: function() { slider.controlNav = slider.manualControls; methods.controlNav.active(); - + slider.controlNav.bind(eventType, function(event) { event.preventDefault(); if (watchedEvent === "" || watchedEvent === event.type) { var $this = $(this), target = slider.controlNav.index($this); - + if (!$this.hasClass(namespace + 'active')) { (target > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev"; slider.flexAnimate(target, slider.vars.pauseOnAction); @@ -248,7 +248,7 @@ directionNav: { setup: function() { var directionNavScaffold = $(''); - + // CONTROLSCONTAINER: if (slider.controlsContainer) { $(slider.controlsContainer).append(directionNavScaffold); @@ -257,9 +257,9 @@ slider.append(directionNavScaffold); slider.directionNav = $('.' + namespace + 'direction-nav li a', slider); } - + methods.directionNav.update(); - + slider.directionNav.bind(eventType, function(event) { event.preventDefault(); var target; @@ -296,7 +296,7 @@ pausePlay: { setup: function() { var pausePlayScaffold = $('
      '); - + // CONTROLSCONTAINER: if (slider.controlsContainer) { slider.controlsContainer.append(pausePlayScaffold); @@ -342,21 +342,21 @@ dx, startT, scrolling = false; - + el.addEventListener('touchstart', onTouchStart, false); function onTouchStart(e) { if (slider.animating) { e.preventDefault(); } else if (e.touches.length === 1) { slider.pause(); - // CAROUSEL: + // CAROUSEL: cwidth = (vertical) ? slider.h : slider. w; startT = Number(new Date()); // CAROUSEL: offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 : (carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : (carousel && slider.currentSlide === slider.last) ? slider.limit : - (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide : + (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide : (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth; startX = (vertical) ? e.touches[0].pageY : e.touches[0].pageX; startY = (vertical) ? e.touches[0].pageX : e.touches[0].pageY; @@ -369,7 +369,7 @@ function onTouchMove(e) { dx = (vertical) ? startX - e.touches[0].pageY : startX - e.touches[0].pageX; scrolling = (vertical) ? (Math.abs(dx) < Math.abs(e.touches[0].pageX - startY)) : (Math.abs(dx) < Math.abs(e.touches[0].pageY - startY)); - + if (!scrolling || Number(new Date()) - startT > 500) { e.preventDefault(); if (!fade && slider.transitions) { @@ -380,15 +380,15 @@ } } } - + function onTouchEnd(e) { // finish the touch by undoing the touch session el.removeEventListener('touchmove', onTouchMove, false); - + if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) { var updateDx = (reverse) ? -dx : dx, target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev'); - + if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) { slider.flexAnimate(target, slider.vars.pauseOnAction); } else { @@ -405,7 +405,7 @@ resize: function() { if (!slider.animating && slider.is(':visible')) { if (!carousel) slider.doMath(); - + if (fade) { // SMOOTH HEIGHT: methods.smoothHeight(); @@ -434,7 +434,7 @@ sync: function(action) { var $obj = $(slider.vars.sync).data("flexslider"), target = slider.animatingTo; - + switch (action) { case "animate": $obj.flexAnimate(target, slider.vars.pauseOnAction, false, true); break; case "play": if (!$obj.playing && !$obj.asNav) { $obj.play(); } break; @@ -448,11 +448,11 @@ }, 3000); } } - + // public methods slider.flexAnimate = function(target, pause, override, withSync, fromNav) { if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev"; - + if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) { if (asNav && withSync) { var master = $(slider.vars.asNavFor).data('flexslider'); @@ -460,7 +460,7 @@ master.flexAnimate(target, true, false, true, fromNav); slider.direction = (slider.currentItem < target) ? "next" : "prev"; master.direction = slider.direction; - + if (Math.ceil((target + 1)/slider.visible) - 1 !== slider.currentSlide && target !== 0) { slider.currentItem = target; slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide"); @@ -471,44 +471,44 @@ return false; } } - + slider.animating = true; slider.animatingTo = target; // API: before() animation Callback slider.vars.before(slider); - + // SLIDESHOW: if (pause) slider.pause(); - + // SYNC: if (slider.syncExists && !fromNav) methods.sync("animate"); - + // CONTROLNAV if (slider.vars.controlNav) methods.controlNav.active(); - + // !CAROUSEL: // CANDIDATE: slide active class (for add/remove slide) if (!carousel) slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide'); - + // INFINITE LOOP: // CANDIDATE: atEnd slider.atEnd = target === 0 || target === slider.last; - + // DIRECTIONNAV: if (slider.vars.directionNav) methods.directionNav.update(); - + if (target === slider.last) { // API: end() of cycle Callback slider.vars.end(slider); // SLIDESHOW && !INFINITE LOOP: if (!slider.vars.animationLoop) slider.pause(); } - + // SLIDE: if (!fade) { var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedW, margin, slideString, calcNext; - + // INFINITE LOOP / REVERSE: if (carousel) { //margin = (slider.vars.itemWidth > slider.w) ? slider.vars.itemMargin * 2 : slider.vars.itemMargin; @@ -541,10 +541,10 @@ if (!touch) { //slider.slides.eq(slider.currentSlide).fadeOut(slider.vars.animationSpeed, slider.vars.easing); //slider.slides.eq(target).fadeIn(slider.vars.animationSpeed, slider.vars.easing, slider.wrapup); - + slider.slides.eq(slider.currentSlide).css({"zIndex": 1}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing); - slider.slides.eq(target).css({"zIndex": 2}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup); - + slider.slides.eq(target).css({"zIndex": 2}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup); + } else { slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 }); slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 }); @@ -555,7 +555,7 @@ // SMOOTH HEIGHT: if (slider.vars.smoothHeight) methods.smoothHeight(slider.vars.animationSpeed); } - } + } slider.wrapup = function(dimension) { // SLIDE: if (!fade && !carousel) { @@ -570,7 +570,7 @@ // API: after() animation Callback slider.vars.after(slider); } - + // SLIDESHOW: slider.animateSlides = function() { if (!slider.animating) slider.flexAnimate(slider.getTarget("next")); @@ -612,14 +612,14 @@ true; } slider.getTarget = function(dir) { - slider.direction = dir; + slider.direction = dir; if (dir === "next") { return (slider.currentSlide === slider.last) ? 0 : slider.currentSlide + 1; } else { return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1; } } - + // SLIDE: slider.setProps = function(pos, special, dur) { var target = (function() { @@ -649,16 +649,16 @@ dur = (dur !== undefined) ? (dur/1000) + "s" : "0s"; slider.container.css("-" + slider.pfx + "-transition-duration", dur); } - + slider.args[slider.prop] = target; if (slider.transitions || dur === undefined) slider.container.css(slider.args); } - + slider.setup = function(type) { // SLIDE: if (!fade) { var sliderOffset, arr; - + if (type === "init") { slider.viewport = $('
      ').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container); // INFINITE LOOP: @@ -680,7 +680,7 @@ slider.container.append(slider.slides.first().clone().addClass('clone').attr('aria-hidden', 'true')).prepend(slider.slides.last().clone().addClass('clone').attr('aria-hidden', 'true')); } slider.newSlides = $(slider.vars.selector, slider); - + sliderOffset = (reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset : slider.currentSlide + slider.cloneOffset; // VERTICAL: if (vertical && !carousel) { @@ -701,12 +701,12 @@ if (slider.vars.smoothHeight) methods.smoothHeight(); }, (type === "init") ? 100 : 0); } - } else { // FADE: + } else { // FADE: slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"}); if (type === "init") { if (!touch) { //slider.slides.eq(slider.currentSlide).fadeIn(slider.vars.animationSpeed, slider.vars.easing); - slider.slides.css({ "opacity": 0, "display": "block", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2}).animate({"opacity": 1},slider.vars.animationSpeed,slider.vars.easing); + slider.slides.css({ "opacity": 0, "display": "block", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2}).animate({"opacity": 1},slider.vars.animationSpeed,slider.vars.easing); } else { slider.slides.css({ "opacity": 0, "display": "block", "webkitTransition": "opacity " + slider.vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2}); } @@ -718,14 +718,14 @@ // CANDIDATE: active slide if (!carousel) slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide"); } - + slider.doMath = function() { var slide = slider.slides.first(), slideMargin = slider.vars.itemMargin, minItems = slider.vars.minItems, maxItems = slider.vars.maxItems; - + slider.w = slider.width(); slider.h = slide.height(); slider.boxPadding = slide.outerWidth() - slide.width(); @@ -753,10 +753,10 @@ slider.computedW = slider.itemW - slider.boxPadding; } - + slider.update = function(pos, action) { slider.doMath(); - + // update currentSlide and slider.animatingTo if necessary if (!carousel) { if (pos < slider.currentSlide) { @@ -766,7 +766,7 @@ } slider.animatingTo = slider.currentSlide; } - + // update controlNav if (slider.vars.controlNav && !slider.manualControls) { if ((action === "add" && !carousel) || slider.pagingCount > slider.controlNav.length) { @@ -781,64 +781,64 @@ } // update directionNav if (slider.vars.directionNav) methods.directionNav.update(); - + } - + slider.addSlide = function(obj, pos) { var $obj = $(obj); - + slider.count += 1; slider.last = slider.count - 1; - + // append new slide if (vertical && reverse) { (pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj); } else { (pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj); } - + // update currentSlide, animatingTo, controlNav, and directionNav slider.update(pos, "add"); - + // update slider.slides slider.slides = $(slider.vars.selector + ':not(.clone)', slider); // re-setup the slider to accomdate new slide slider.setup(); - + //FlexSlider: added() Callback slider.vars.added(slider); } slider.removeSlide = function(obj) { var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj; - + // update count slider.count -= 1; slider.last = slider.count - 1; - + // remove slide if (isNaN(obj)) { $(obj, slider.slides).remove(); } else { (vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove(); } - + // update currentSlide, animatingTo, controlNav, and directionNav slider.doMath(); slider.update(pos, "remove"); - + // update slider.slides slider.slides = $(slider.vars.selector + ':not(.clone)', slider); // re-setup the slider to accomdate new slide slider.setup(); - + // FlexSlider: removed() Callback slider.vars.removed(slider); } - + //FlexSlider: Initialize methods.init(); } - + //FlexSlider: Default Settings $.flexslider.defaults = { namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin @@ -848,27 +848,27 @@ direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" reverse: false, //{NEW} Boolean: Reverse the animation direction animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end - smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode + smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode startAt: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide) slideshow: true, //Boolean: Animate slider automatically slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds animationSpeed: 600, //Integer: Set the speed of animations, in milliseconds initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds randomize: false, //Boolean: Randomize slide order - + // Usability features pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended. pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering useCSS: true, //{NEW} Boolean: Slider will use CSS3 transitions if available touch: true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices video: false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches - + // Primary Controls controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false) prevText: "Previous", //String: Set the text for the "previous" directionNav item nextText: "Next", //String: Set the text for the "next" directionNav item - + // Secondary Navigation keyboard: true, //Boolean: Allow slider navigating via keyboard left/right keys multipleKeyboard: false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present. @@ -876,20 +876,20 @@ pausePlay: false, //Boolean: Create pause/play dynamic element pauseText: "Pause", //String: Set the text for the "pause" pausePlay item playText: "Play", //String: Set the text for the "play" pausePlay item - + // Special properties controlsContainer: "", //{UPDATED} jQuery Object/Selector: Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be $(".flexslider-container"). Property is ignored if given element is not found. manualControls: "", //{UPDATED} jQuery Object/Selector: Declare custom control navigation. Examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs. sync: "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care. asNavFor: "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider - + // Carousel Options itemWidth: 0, //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding. itemMargin: 0, //{NEW} Integer: Margin between carousel items. minItems: 0, //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this. maxItems: 0, //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit. move: 0, //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items. - + // Callback API start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation @@ -903,7 +903,7 @@ //FlexSlider: Plugin Function $.fn.flexslider = function(options) { if (options === undefined) options = {}; - + if (typeof options === "object") { return this.each(function() { var $this = $(this), From 14c0250920c346db99aab78cc302096226884950 Mon Sep 17 00:00:00 2001 From: Matty Date: Mon, 11 Feb 2013 13:04:49 +0200 Subject: [PATCH 12/48] Merged #443. --- flexslider.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flexslider.css b/flexslider.css index e31aad8f..07ad1718 100644 --- a/flexslider.css +++ b/flexslider.css @@ -55,7 +55,7 @@ html[xmlns] .slides {display: block;} .flexslider:hover .flex-next {opacity: 0.8; right: 5px;} .flexslider:hover .flex-prev {opacity: 0.8; left: 5px;} .flexslider:hover .flex-next:hover, .flexslider:hover .flex-prev:hover {opacity: 1;} -.flex-direction-nav .flex-disabled {opacity: .3!important; filter:alpha(opacity=30); cursor: default;} +.flex-direction-nav .flex-disabled {opacity: 0!important; filter:alpha(opacity=0); cursor: default;} /* Control Nav */ .flex-control-nav {width: 100%; position: absolute; bottom: -40px; text-align: center;} From 6160a0dc9ea05afa7e4b6779f2c4fb18656c5cb3 Mon Sep 17 00:00:00 2001 From: Matty Date: Tue, 12 Feb 2013 11:06:04 +0200 Subject: [PATCH 13/48] Merged #472. Adds feature to pause the slideshow if the window loses focus. --- jquery.flexslider.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jquery.flexslider.js b/jquery.flexslider.js index ff38abc1..b6db5e26 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -25,6 +25,7 @@ fade = slider.vars.animation === "fade", asNav = slider.vars.asNavFor !== "", methods = {}; + focused = true; // Store a reference to the slider object $.data(el, "flexslider", slider); @@ -573,7 +574,7 @@ // SLIDESHOW: slider.animateSlides = function() { - if (!slider.animating) slider.flexAnimate(slider.getTarget("next")); + if (!slider.animating && focused ) slider.flexAnimate(slider.getTarget("next")); } // SLIDESHOW: slider.pause = function() { @@ -839,6 +840,13 @@ methods.init(); } + // Ensure the slider isn't focussed if the window loses focus. + $( window ).blur( function ( e ) { + focused = false; + }).focus( function ( e ) { + focused = true; + }); + //FlexSlider: Default Settings $.flexslider.defaults = { namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin From b1c9f7464df04a25832586f4f6faa110f76464d3 Mon Sep 17 00:00:00 2001 From: Matty Date: Tue, 12 Feb 2013 11:24:31 +0200 Subject: [PATCH 14/48] Merged #392. Adds check for left position from container for first slide, if attempting to scroll from the first slide to itself when asNavFor is in use. --- jquery.flexslider.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jquery.flexslider.js b/jquery.flexslider.js index b6db5e26..e0097089 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -146,7 +146,10 @@ e.preventDefault(); var $slide = $(this), target = $slide.index(); - if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass(namespace + "active-slide")) { + var posFromLeft = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container + if( posFromLeft <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) { + slider.flexAnimate(slider.getTarget("prev"), true); + } else if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass(namespace + "active-slide")) { slider.direction = (slider.currentItem < target) ? "next" : "prev"; slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true); } From 088afe32bd7f7571f3632a06dffca9b14af949bf Mon Sep 17 00:00:00 2001 From: Chris Canal Date: Tue, 12 Feb 2013 17:30:49 +0000 Subject: [PATCH 15/48] Adds AMD support --- jquery.flexslider-min.js | 35 +---------------------------------- jquery.flexslider.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/jquery.flexslider-min.js b/jquery.flexslider-min.js index 84bf497d..27ebe715 100644 --- a/jquery.flexslider-min.js +++ b/jquery.flexslider-min.js @@ -3,37 +3,4 @@ * Copyright 2012 WooThemes * Contributing Author: Tyler Smith */ - ;(function(c){c.flexslider=function(j,l){var a=c(j);a.vars=c.extend({},c.flexslider.defaults,l);var d=a.vars.namespace,s=("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&a.vars.touch,g="",t,n="vertical"===a.vars.direction,p=a.vars.reverse,k=0e?a.getTarget("next"):a.getTarget("prev"); -a.flexAnimate(c,a.vars.pauseOnAction)});a.vars.pausePlay&&f.pausePlay.setup();a.vars.slideshow&&(a.vars.pauseOnHover&&a.hover(function(){!a.manualPlay&&!a.manualPause&&a.pause()},function(){!a.manualPause&&!a.manualPlay&&a.play()}),0');if(1':""+b+"",a.controlNavScaffold.append("
    1. "+e+"
    2. "),b++;a.controlsContainer?c(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold);f.controlNav.set();f.controlNav.active();a.controlNavScaffold.delegate("a, img", -"click touchend",function(b){b.preventDefault();if(""===g||g===b.type){var e=c(this),h=a.controlNav.index(e);e.hasClass(d+"active")||(a.direction=h>a.currentSlide?"next":"prev",a.flexAnimate(h,a.vars.pauseOnAction))}""===g&&(g=b.type);f.setToClearWatchedEvent()})},setupManual:function(){a.controlNav=a.manualControls;f.controlNav.active();a.controlNav.bind("click touchend",function(b){b.preventDefault();if(""===g||g===b.type){var e=c(this),h=a.controlNav.index(e);e.hasClass(d+"active")||(h>a.currentSlide? -a.direction="next":a.direction="prev",a.flexAnimate(h,a.vars.pauseOnAction))}""===g&&(g=b.type);f.setToClearWatchedEvent()})},set:function(){a.controlNav=c("."+d+"control-nav li "+("thumbnails"===a.vars.controlNav?"img":"a"),a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(d+"active").eq(a.animatingTo).addClass(d+"active")},update:function(b,e){1"+a.count+"")):1===a.pagingCount?a.controlNavScaffold.find("li").remove(): -a.controlNav.eq(e).closest("li").remove();f.controlNav.set();1
    3. '+a.vars.prevText+'
    4. '+a.vars.nextText+"
    5. ");a.controlsContainer?(c(a.controlsContainer).append(b),a.directionNav=c("."+d+"direction-nav li a",a.controlsContainer)):(a.append(b),a.directionNav= -c("."+d+"direction-nav li a",a));f.directionNav.update();a.directionNav.bind("click touchend",function(b){b.preventDefault();var h;if(""===g||g===b.type)h=c(this).hasClass(d+"next")?a.getTarget("next"):a.getTarget("prev"),a.flexAnimate(h,a.vars.pauseOnAction);""===g&&(g=b.type);f.setToClearWatchedEvent()})},update:function(){var b=d+"disabled";1===a.pagingCount?a.directionNav.addClass(b):a.vars.animationLoop?a.directionNav.removeClass(b):0===a.animatingTo?a.directionNav.removeClass(b).filter("."+ -d+"prev").addClass(b):a.animatingTo===a.last?a.directionNav.removeClass(b).filter("."+d+"next").addClass(b):a.directionNav.removeClass(b)}},pausePlay:{setup:function(){var b=c('
      ');a.controlsContainer?(a.controlsContainer.append(b),a.pausePlay=c("."+d+"pauseplay a",a.controlsContainer)):(a.append(b),a.pausePlay=c("."+d+"pauseplay a",a));f.pausePlay.update(a.vars.slideshow?d+"pause":d+"play");a.pausePlay.bind("click touchend",function(b){b.preventDefault();if(""=== -g||g===b.type)c(this).hasClass(d+"pause")?(a.manualPause=!0,a.manualPlay=!1,a.pause()):(a.manualPause=!1,a.manualPlay=!0,a.play());""===g&&(g=b.type);f.setToClearWatchedEvent()})},update:function(b){"play"===b?a.pausePlay.removeClass(d+"pause").addClass(d+"play").text(a.vars.playText):a.pausePlay.removeClass(d+"play").addClass(d+"pause").text(a.vars.pauseText)}},touch:function(){function b(b){m=n?c-b.touches[0].pageY:c-b.touches[0].pageX;r=n?Math.abs(m)m||a.currentSlide===a.last&&0Number(new Date)-l&&50g/2)?a.flexAnimate(n,a.vars.pauseOnAction): -q||a.flexAnimate(a.currentSlide,a.vars.pauseOnAction,!0)}j.removeEventListener("touchend",e,!1);f=m=d=c=null}var c,d,f,g,m,l,r=!1;j.addEventListener("touchstart",function(m){a.animating?m.preventDefault():1===m.touches.length&&(a.pause(),g=n?a.h:a.w,l=Number(new Date),f=k&&p&&a.animatingTo===a.last?0:k&&p?a.limit-(a.itemW+a.vars.itemMargin)*a.move*a.animatingTo:k&&a.currentSlide===a.last?a.limit:k?(a.itemW+a.vars.itemMargin)*a.move*a.currentSlide:p?(a.last-a.currentSlide+a.cloneOffset)*g:(a.currentSlide+ -a.cloneOffset)*g,c=n?m.touches[0].pageY:m.touches[0].pageX,d=n?m.touches[0].pageX:m.touches[0].pageY,j.addEventListener("touchmove",b,!1),j.addEventListener("touchend",e,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(k||a.doMath(),q?f.smoothHeight():k?(a.slides.width(a.computedW),a.update(a.pagingCount),a.setProps()):n?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(a.vars.smoothHeight&&f.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(b){if(!n|| -q){var e=q?a:a.viewport;b?e.animate({height:a.slides.eq(a.animatingTo).height()},b):e.height(a.slides.eq(a.animatingTo).height())}},sync:function(b){var e=c(a.vars.sync).data("flexslider"),d=a.animatingTo;switch(b){case "animate":e.flexAnimate(d,a.vars.pauseOnAction,!1,!0);break;case "play":!e.playing&&!e.asNav&&e.play();break;case "pause":e.pause()}},setToClearWatchedEvent:function(){clearTimeout(t);t=setTimeout(function(){g=""},3E3)}};a.flexAnimate=function(b,e,h,g,j){r&&1===a.pagingCount&&(a.direction= -a.currentItema.limit&&1!==a.visible?a.limit:b):b=0===a.currentSlide&&b===a.count-1&&a.vars.animationLoop&&"next"!==a.direction?p?(a.count+a.cloneOffset)*l:0:a.currentSlide===a.last&&0===b&&a.vars.animationLoop&& -"prev"!==a.direction?p?0:(a.count+1)*l:p?(a.count-1-b+a.cloneOffset)*l:(b+a.cloneOffset)*l;a.setProps(b,"",a.vars.animationSpeed);if(a.transitions){if(!a.vars.animationLoop||!a.atEnd)a.animating=!1,a.currentSlide=a.animatingTo;a.container.unbind("webkitTransitionEnd transitionend");a.container.bind("webkitTransitionEnd transitionend",function(){a.wrapup(l)})}else a.container.animate(a.args,a.vars.animationSpeed,a.vars.easing,function(){a.wrapup(l)})}a.vars.smoothHeight&&f.smoothHeight(a.vars.animationSpeed)}}; -a.wrapup=function(b){!q&&!k&&(0===a.currentSlide&&a.animatingTo===a.last&&a.vars.animationLoop?a.setProps(b,"jumpEnd"):a.currentSlide===a.last&&(0===a.animatingTo&&a.vars.animationLoop)&&a.setProps(b,"jumpStart"));a.animating=!1;a.currentSlide=a.animatingTo;a.vars.after(a)};a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))};a.pause=function(){clearInterval(a.animatedSlides);a.playing=!1;a.vars.pausePlay&&f.pausePlay.update("play");a.syncExists&&f.sync("pause")};a.play=function(){a.animatedSlides= -setInterval(a.animateSlides,a.vars.slideshowSpeed);a.playing=!0;a.vars.pausePlay&&f.pausePlay.update("pause");a.syncExists&&f.sync("play")};a.canAdvance=function(b,e){var c=r?a.pagingCount-1:a.last;return e?!0:r&&a.currentItem===a.count-1&&0===b&&"prev"===a.direction?!0:r&&0===a.currentItem&&b===a.pagingCount-1&&"next"!==a.direction?!1:b===a.currentSlide&&!r?!1:a.vars.animationLoop?!0:a.atEnd&&0===a.currentSlide&&b===c&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===c&&0===b&&"next"===a.direction? -!1:!0};a.getTarget=function(b){a.direction=b;return"next"===b?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1};a.setProps=function(b,e,c){var d,f=b?b:(a.itemW+a.vars.itemMargin)*a.move*a.animatingTo;d=-1*function(){if(k)return"setTouch"===e?b:p&&a.animatingTo===a.last?0:p?a.limit-(a.itemW+a.vars.itemMargin)*a.move*a.animatingTo:a.animatingTo===a.last?a.limit:f;switch(e){case "setTotal":return p?(a.count-1-a.currentSlide+a.cloneOffset)*b:(a.currentSlide+a.cloneOffset)* -b;case "setTouch":return b;case "jumpEnd":return p?b:a.count*b;case "jumpStart":return p?a.count*b:b;default:return b}}()+"px";a.transitions&&(d=n?"translate3d(0,"+d+",0)":"translate3d("+d+",0,0)",c=void 0!==c?c/1E3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",c));a.args[a.prop]=d;(a.transitions||void 0===c)&&a.container.css(a.args)};a.setup=function(b){if(q)a.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===b&&(s?a.slides.css({opacity:0,display:"block", -webkitTransition:"opacity "+a.vars.animationSpeed/1E3+"s ease",zIndex:1}).eq(a.currentSlide).css({opacity:1,zIndex:2}):a.slides.css({opacity:0,display:"block",zIndex:1}).eq(a.currentSlide).css({zIndex:2}).animate({opacity:1},a.vars.animationSpeed,a.vars.easing)),a.vars.smoothHeight&&f.smoothHeight();else{var e,h;"init"===b&&(a.viewport=c('
      ').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=0,p&&(h=c.makeArray(a.slides).reverse(), -a.slides=c(h),a.container.empty().append(a.slides)));a.vars.animationLoop&&!k&&(a.cloneCount=2,a.cloneOffset=1,"init"!==b&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone")));a.newSlides=c(a.vars.selector,a);e=p?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset;n&&!k?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){a.newSlides.css({display:"block"}); -a.doMath();a.viewport.height(a.h);a.setProps(e*a.h,"init")},"init"===b?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(e*a.computedW,"init"),setTimeout(function(){a.doMath();a.newSlides.css({width:a.computedW,"float":"left",display:"block"});a.vars.smoothHeight&&f.smoothHeight()},"init"===b?100:0))}k||a.slides.removeClass(d+"active-slide").eq(a.currentSlide).addClass(d+"active-slide")};a.doMath=function(){var b=a.slides.first(),e=a.vars.itemMargin,c=a.vars.minItems,d=a.vars.maxItems; -a.w=a.width();a.h=b.height();a.boxPadding=b.outerWidth()-b.width();k?(a.itemT=a.vars.itemWidth+e,a.minW=c?c*a.itemT:a.w,a.maxW=d?d*a.itemT-e:a.w,a.itemW=a.minW>a.w?(a.w-e*(c-1))/c:a.maxWa.w?a.w:a.vars.itemWidth,a.visible=Math.floor(a.w/a.itemW),a.move=0a.w?a.itemW*(a.count-1)+e*(a.count- -1):(a.itemW+e)*a.count-a.w-e):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1);a.computedW=a.itemW-a.boxPadding};a.update=function(b,c){a.doMath();k||(ba.controlNav.length)f.controlNav.update("add");else if("remove"===c&&!k||a.pagingCounta.last&&(a.currentSlide-=1,a.animatingTo-= -1),f.controlNav.update("remove",a.last);a.vars.directionNav&&f.directionNav.update()};a.addSlide=function(b,e){var d=c(b);a.count+=1;a.last=a.count-1;n&&p?void 0!==e?a.slides.eq(a.count-e).after(d):a.container.prepend(d):void 0!==e?a.slides.eq(e).before(d):a.container.append(d);a.update(e,"add");a.slides=c(a.vars.selector+":not(.clone)",a);a.setup();a.vars.added(a)};a.removeSlide=function(b){var d=isNaN(b)?a.slides.index(c(b)):b;a.count-=1;a.last=a.count-1;isNaN(b)?c(b,a.slides).remove():n&&p?a.slides.eq(a.last).remove(): -a.slides.eq(b).remove();a.doMath();a.update(d,"remove");a.slides=c(a.vars.selector+":not(.clone)",a);a.setup();a.vars.removed(a)};f.init()};c.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7E3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous", -nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};c.fn.flexslider=function(j){void 0===j&&(j={});if("object"===typeof j)return this.each(function(){var a=c(this),d=a.find(j.selector?j.selector:".slides > li");1=== -d.length?(d.fadeIn(400),j.start&&j.start(a)):void 0===a.data("flexslider")&&new c.flexslider(this,j)});var l=c(this).data("flexslider");switch(j){case "play":l.play();break;case "pause":l.pause();break;case "next":l.flexAnimate(l.getTarget("next"),!0);break;case "prev":case "previous":l.flexAnimate(l.getTarget("prev"),!0);break;default:"number"===typeof j&&l.flexAnimate(j,!0)}}})(jQuery); \ No newline at end of file + (function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(e){e.flexslider=function(t,n){var r=e(t);r.vars=e.extend({},e.flexslider.defaults,n);var i=r.vars.namespace,s=("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&r.vars.touch,o="click touchend",u="",a,f=r.vars.direction==="vertical",l=r.vars.reverse,c=r.vars.itemWidth>0,h=r.vars.animation==="fade",p=r.vars.asNavFor!=="",d={};focused=true;e.data(t,"flexslider",r);d={init:function(){r.animating=false;r.currentSlide=r.vars.startAt;r.animatingTo=r.currentSlide;r.atEnd=r.currentSlide===0||r.currentSlide===r.last;r.containerSelector=r.vars.selector.substr(0,r.vars.selector.search(" "));r.slides=e(r.vars.selector,r);r.container=e(r.containerSelector,r);r.count=r.slides.length;r.syncExists=e(r.vars.sync).length>0;if(r.vars.animation==="slide")r.vars.animation="swing";r.prop=f?"top":"marginLeft";r.args={};r.manualPause=false;r.stopped=false;r.transitions=!r.vars.video&&!h&&r.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var n in t){if(e.style[t[n]]!==undefined){r.pfx=t[n].replace("Perspective","").toLowerCase();r.prop="-"+r.pfx+"-transform";return true}}return false}();if(r.vars.controlsContainer!=="")r.controlsContainer=e(r.vars.controlsContainer).length>0&&e(r.vars.controlsContainer);if(r.vars.manualControls!=="")r.manualControls=e(r.vars.manualControls).length>0&&e(r.vars.manualControls);if(r.vars.randomize){r.slides.sort(function(){return Math.round(Math.random())-.5});r.container.empty().append(r.slides)}r.doMath();if(p)d.asNav.setup();r.setup("init");if(r.vars.controlNav)d.controlNav.setup();if(r.vars.directionNav)d.directionNav.setup();if(r.vars.keyboard&&(e(r.containerSelector).length===1||r.vars.multipleKeyboard)){e(document).bind("keyup",function(e){var t=e.keyCode;if(!r.animating&&(t===39||t===37)){var n=t===39?r.getTarget("next"):t===37?r.getTarget("prev"):false;r.flexAnimate(n,r.vars.pauseOnAction)}})}if(r.vars.mousewheel){r.bind("mousewheel",function(e,t,n,i){e.preventDefault();var s=t<0?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(s,r.vars.pauseOnAction)})}if(r.vars.pausePlay)d.pausePlay.setup();if(r.vars.slideshow){if(r.vars.pauseOnHover){r.hover(function(){if(!r.manualPlay&&!r.manualPause)r.pause()},function(){if(!r.manualPause&&!r.manualPlay&&!r.stopped)r.play()})}r.vars.initDelay>0?setTimeout(r.play,r.vars.initDelay):r.play()}if(s&&r.vars.touch)d.touch();if(!h||h&&r.vars.smoothHeight)e(window).bind("resize focus",d.resize);setTimeout(function(){r.vars.start(r)},200)},asNav:{setup:function(){r.asNav=true;r.animatingTo=Math.floor(r.currentSlide/r.move);r.currentItem=r.currentSlide;r.slides.removeClass(i+"active-slide").eq(r.currentItem).addClass(i+"active-slide");r.slides.click(function(t){t.preventDefault();var n=e(this),s=n.index();var o=n.offset().left-e(r).scrollLeft();if(o<=0&&n.hasClass(i+"active-slide")){r.flexAnimate(r.getTarget("prev"),true)}else if(!e(r.vars.asNavFor).data("flexslider").animating&&!n.hasClass(i+"active-slide")){r.direction=r.currentItem');if(r.pagingCount>1){for(var a=0;a':""+n+"";r.controlNavScaffold.append("
    6. "+s+"
    7. ");n++}}r.controlsContainer?e(r.controlsContainer).append(r.controlNavScaffold):r.append(r.controlNavScaffold);d.controlNav.set();d.controlNav.active();r.controlNavScaffold.delegate("a, img",o,function(t){t.preventDefault();if(u===""||u===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){r.direction=s>r.currentSlide?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction)}}if(u===""){u=t.type}d.setToClearWatchedEvent()})},setupManual:function(){r.controlNav=r.manualControls;d.controlNav.active();r.controlNav.bind(o,function(t){t.preventDefault();if(u===""||u===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){s>r.currentSlide?r.direction="next":r.direction="prev";r.flexAnimate(s,r.vars.pauseOnAction)}}if(u===""){u=t.type}d.setToClearWatchedEvent()})},set:function(){var t=r.vars.controlNav==="thumbnails"?"img":"a";r.controlNav=e("."+i+"control-nav li "+t,r.controlsContainer?r.controlsContainer:r)},active:function(){r.controlNav.removeClass(i+"active").eq(r.animatingTo).addClass(i+"active")},update:function(t,n){if(r.pagingCount>1&&t==="add"){r.controlNavScaffold.append(e("
    8. "+r.count+"
    9. "))}else if(r.pagingCount===1){r.controlNavScaffold.find("li").remove()}else{r.controlNav.eq(n).closest("li").remove()}d.controlNav.set();r.pagingCount>1&&r.pagingCount!==r.controlNav.length?r.update(n,t):d.controlNav.active()}},directionNav:{setup:function(){var t=e('");if(r.controlsContainer){e(r.controlsContainer).append(t);r.directionNav=e("."+i+"direction-nav li a",r.controlsContainer)}else{r.append(t);r.directionNav=e("."+i+"direction-nav li a",r)}d.directionNav.update();r.directionNav.bind(o,function(t){t.preventDefault();var n;if(u===""||u===t.type){n=e(this).hasClass(i+"next")?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(n,r.vars.pauseOnAction)}if(u===""){u=t.type}d.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";if(r.pagingCount===1){r.directionNav.addClass(e).attr("tabindex","-1")}else if(!r.vars.animationLoop){if(r.animatingTo===0){r.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1")}else if(r.animatingTo===r.last){r.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1")}else{r.directionNav.removeClass(e).removeAttr("tabindex")}}else{r.directionNav.removeClass(e).removeAttr("tabindex")}}},pausePlay:{setup:function(){var t=e('
      ');if(r.controlsContainer){r.controlsContainer.append(t);r.pausePlay=e("."+i+"pauseplay a",r.controlsContainer)}else{r.append(t);r.pausePlay=e("."+i+"pauseplay a",r)}d.pausePlay.update(r.vars.slideshow?i+"pause":i+"play");r.pausePlay.bind(o,function(t){t.preventDefault();if(u===""||u===t.type){if(e(this).hasClass(i+"pause")){r.manualPause=true;r.manualPlay=false;r.pause()}else{r.manualPause=false;r.manualPlay=true;r.play()}}if(u===""){u=t.type}d.setToClearWatchedEvent()})},update:function(e){e==="play"?r.pausePlay.removeClass(i+"pause").addClass(i+"play").text(r.vars.playText):r.pausePlay.removeClass(i+"play").addClass(i+"pause").text(r.vars.pauseText)}},touch:function(){function p(o){if(r.animating){o.preventDefault()}else if(o.touches.length===1){r.pause();s=f?r.h:r.w;u=Number(new Date);i=c&&l&&r.animatingTo===r.last?0:c&&l?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:c&&r.currentSlide===r.last?r.limit:c?(r.itemW+r.vars.itemMargin)*r.move*r.currentSlide:l?(r.last-r.currentSlide+r.cloneOffset)*s:(r.currentSlide+r.cloneOffset)*s;e=f?o.touches[0].pageY:o.touches[0].pageX;n=f?o.touches[0].pageX:o.touches[0].pageY;t.addEventListener("touchmove",d,false);t.addEventListener("touchend",v,false)}}function d(t){o=f?e-t.touches[0].pageY:e-t.touches[0].pageX;a=f?Math.abs(o)500){t.preventDefault();if(!h&&r.transitions){if(!r.vars.animationLoop){o=o/(r.currentSlide===0&&o<0||r.currentSlide===r.last&&o>0?Math.abs(o)/s+2:1)}r.setProps(i+o,"setTouch")}}}function v(f){t.removeEventListener("touchmove",d,false);if(r.animatingTo===r.currentSlide&&!a&&!(o===null)){var c=l?-o:o,p=c>0?r.getTarget("next"):r.getTarget("prev");if(r.canAdvance(p)&&(Number(new Date)-u<550&&Math.abs(c)>50||Math.abs(c)>s/2)){r.flexAnimate(p,r.vars.pauseOnAction)}else{if(!h)r.flexAnimate(r.currentSlide,r.vars.pauseOnAction,true)}}t.removeEventListener("touchend",v,false);e=null;n=null;o=null;i=null}var e,n,i,s,o,u,a=false;t.addEventListener("touchstart",p,false)},resize:function(){if(!r.animating&&r.is(":visible")){if(!c)r.doMath();if(h){d.smoothHeight()}else if(c){r.slides.width(r.computedW);r.update(r.pagingCount);r.setProps()}else if(f){r.viewport.height(r.h);r.setProps(r.h,"setTotal")}else{if(r.vars.smoothHeight)d.smoothHeight();r.newSlides.width(r.computedW);r.setProps(r.computedW,"setTotal")}}},smoothHeight:function(e){if(!f||h){var t=h?r:r.viewport;e?t.animate({height:r.slides.eq(r.animatingTo).height()},e):t.height(r.slides.eq(r.animatingTo).height())}},sync:function(t){var n=e(r.vars.sync).data("flexslider"),i=r.animatingTo;switch(t){case"animate":n.flexAnimate(i,r.vars.pauseOnAction,false,true);break;case"play":if(!n.playing&&!n.asNav){n.play()}break;case"pause":n.pause();break}},setToClearWatchedEvent:function(){clearTimeout(a);a=setTimeout(function(){u=""},3e3)}};r.flexAnimate=function(t,n,o,u,a){if(p&&r.pagingCount===1)r.direction=r.currentItemr.limit&&r.visible!==1?r.limit:b}else if(r.currentSlide===0&&t===r.count-1&&r.vars.animationLoop&&r.direction!=="next"){y=l?(r.count+r.cloneOffset)*m:0}else if(r.currentSlide===r.last&&t===0&&r.vars.animationLoop&&r.direction!=="prev"){y=l?0:(r.count+1)*m}else{y=l?(r.count-1-t+r.cloneOffset)*m:(t+r.cloneOffset)*m}r.setProps(y,"",r.vars.animationSpeed);if(r.transitions){if(!r.vars.animationLoop||!r.atEnd){r.animating=false;r.currentSlide=r.animatingTo}r.container.unbind("webkitTransitionEnd transitionend");r.container.bind("webkitTransitionEnd transitionend",function(){r.wrapup(m)})}else{r.container.animate(r.args,r.vars.animationSpeed,r.vars.easing,function(){r.wrapup(m)})}}else{if(!s){r.slides.eq(r.currentSlide).css({zIndex:1}).animate({opacity:0},r.vars.animationSpeed,r.vars.easing);r.slides.eq(t).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing,r.wrapup)}else{r.slides.eq(r.currentSlide).css({opacity:0,zIndex:1});r.slides.eq(t).css({opacity:1,zIndex:2});r.animating=false;r.currentSlide=r.animatingTo}}if(r.vars.smoothHeight)d.smoothHeight(r.vars.animationSpeed)}};r.wrapup=function(e){if(!h&&!c){if(r.currentSlide===0&&r.animatingTo===r.last&&r.vars.animationLoop){r.setProps(e,"jumpEnd")}else if(r.currentSlide===r.last&&r.animatingTo===0&&r.vars.animationLoop){r.setProps(e,"jumpStart")}}r.animating=false;r.currentSlide=r.animatingTo;r.vars.after(r)};r.animateSlides=function(){if(!r.animating&&focused)r.flexAnimate(r.getTarget("next"))};r.pause=function(){clearInterval(r.animatedSlides);r.animatedSlides=null;r.playing=false;if(r.vars.pausePlay)d.pausePlay.update("play");if(r.syncExists)d.sync("pause")};r.play=function(){r.animatedSlides=r.animatedSlides||setInterval(r.animateSlides,r.vars.slideshowSpeed);r.playing=true;if(r.vars.pausePlay)d.pausePlay.update("pause");if(r.syncExists)d.sync("play")};r.stop=function(){r.pause();r.stopped=true};r.canAdvance=function(e,t){var n=p?r.pagingCount-1:r.last;return t?true:p&&r.currentItem===r.count-1&&e===0&&r.direction==="prev"?true:p&&r.currentItem===0&&e===r.pagingCount-1&&r.direction!=="next"?false:e===r.currentSlide&&!p?false:r.vars.animationLoop?true:r.atEnd&&r.currentSlide===0&&e===n&&r.direction!=="next"?false:r.atEnd&&r.currentSlide===n&&e===0&&r.direction==="next"?false:true};r.getTarget=function(e){r.direction=e;if(e==="next"){return r.currentSlide===r.last?0:r.currentSlide+1}else{return r.currentSlide===0?r.last:r.currentSlide-1}};r.setProps=function(e,t,n){var i=function(){var n=e?e:(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo,i=function(){if(c){return t==="setTouch"?e:l&&r.animatingTo===r.last?0:l?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:r.animatingTo===r.last?r.limit:n}else{switch(t){case"setTotal":return l?(r.count-1-r.currentSlide+r.cloneOffset)*e:(r.currentSlide+r.cloneOffset)*e;case"setTouch":return l?e:e;case"jumpEnd":return l?e:r.count*e;case"jumpStart":return l?r.count*e:e;default:return e}}}();return i*-1+"px"}();if(r.transitions){i=f?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)";n=n!==undefined?n/1e3+"s":"0s";r.container.css("-"+r.pfx+"-transition-duration",n)}r.args[r.prop]=i;if(r.transitions||n===undefined)r.container.css(r.args)};r.setup=function(t){if(!h){var n,o;if(t==="init"){r.viewport=e('
      ').css({overflow:"hidden",position:"relative"}).appendTo(r).append(r.container);r.cloneCount=0;r.cloneOffset=0;if(l){o=e.makeArray(r.slides).reverse();r.slides=e(o);r.container.empty().append(r.slides)}}if(r.vars.animationLoop&&!c){r.cloneCount=2;r.cloneOffset=1;if(t!=="init")r.container.find(".clone").remove();r.container.append(r.slides.first().clone().addClass("clone").attr("aria-hidden","true")).prepend(r.slides.last().clone().addClass("clone").attr("aria-hidden","true"))}r.newSlides=e(r.vars.selector,r);n=l?r.count-1-r.currentSlide+r.cloneOffset:r.currentSlide+r.cloneOffset;if(f&&!c){r.container.height((r.count+r.cloneCount)*200+"%").css("position","absolute").width("100%");setTimeout(function(){r.newSlides.css({display:"block"});r.doMath();r.viewport.height(r.h);r.setProps(n*r.h,"init")},t==="init"?100:0)}else{r.container.width((r.count+r.cloneCount)*200+"%");r.setProps(n*r.computedW,"init");setTimeout(function(){r.doMath();r.newSlides.css({width:r.computedW,"float":"left",display:"block"});if(r.vars.smoothHeight)d.smoothHeight()},t==="init"?100:0)}}else{r.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"});if(t==="init"){if(!s){r.slides.css({opacity:0,display:"block",zIndex:1}).eq(r.currentSlide).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing)}else{r.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+r.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(r.currentSlide).css({opacity:1,zIndex:2})}}if(r.vars.smoothHeight)d.smoothHeight()}if(!c)r.slides.removeClass(i+"active-slide").eq(r.currentSlide).addClass(i+"active-slide")};r.doMath=function(){var e=r.slides.first(),t=r.vars.itemMargin,n=r.vars.minItems,i=r.vars.maxItems;r.w=r.width();r.h=e.height();r.boxPadding=e.outerWidth()-e.width();if(c){r.itemT=r.vars.itemWidth+t;r.minW=n?n*r.itemT:r.w;r.maxW=i?i*r.itemT-t:r.w;r.itemW=r.minW>r.w?(r.w-t*(n-1))/n:r.maxWr.w?r.w:r.vars.itemWidth;r.visible=Math.floor(r.w/r.itemW);r.move=r.vars.move>0&&r.vars.mover.w?r.itemW*(r.count-1)+t*(r.count-1):(r.itemW+t)*r.count-r.w-t}else{r.itemW=r.w;r.pagingCount=r.count;r.last=r.count-1}r.computedW=r.itemW-r.boxPadding};r.update=function(e,t){r.doMath();if(!c){if(er.controlNav.length){d.controlNav.update("add")}else if(t==="remove"&&!c||r.pagingCountr.last){r.currentSlide-=1;r.animatingTo-=1}d.controlNav.update("remove",r.last)}}if(r.vars.directionNav)d.directionNav.update()};r.addSlide=function(t,n){var i=e(t);r.count+=1;r.last=r.count-1;if(f&&l){n!==undefined?r.slides.eq(r.count-n).after(i):r.container.prepend(i)}else{n!==undefined?r.slides.eq(n).before(i):r.container.append(i)}r.update(n,"add");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.added(r)};r.removeSlide=function(t){var n=isNaN(t)?r.slides.index(e(t)):t;r.count-=1;r.last=r.count-1;if(isNaN(t)){e(t,r.slides).remove()}else{f&&l?r.slides.eq(r.last).remove():r.slides.eq(t).remove()}r.doMath();r.update(n,"remove");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.removed(r)};d.init()};e(window).blur(function(e){focused=false}).focus(function(e){focused=true});e.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:false,animationLoop:true,smoothHeight:false,startAt:0,slideshow:true,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:false,pauseOnAction:true,pauseOnHover:false,useCSS:true,touch:true,video:false,controlNav:true,directionNav:true,prevText:"Previous",nextText:"Next",keyboard:true,multipleKeyboard:false,mousewheel:false,pausePlay:false,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};e.fn.flexslider=function(t){if(t===undefined)t={};if(typeof t==="object"){return this.each(function(){var n=e(this),r=t.selector?t.selector:".slides > li",i=n.find(r);if(i.length===1){i.fadeIn(400);if(t.start)t.start(n)}else if(n.data("flexslider")===undefined){new e.flexslider(this,t)}})}else{var n=e(this).data("flexslider");switch(t){case"play":n.play();break;case"pause":n.pause();break;case"stop":n.stop();break;case"next":n.flexAnimate(n.getTarget("next"),true);break;case"prev":case"previous":n.flexAnimate(n.getTarget("prev"),true);break;default:if(typeof t==="number")n.flexAnimate(t,true)}}}})(jQuery) \ No newline at end of file diff --git a/jquery.flexslider.js b/jquery.flexslider.js index e0097089..954657c2 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -3,7 +3,16 @@ * Copyright 2012 WooThemes * Contributing Author: Tyler Smith */ -;(function ($) { +; +(function(factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { //FlexSlider: Object Instance $.flexslider = function(el, options) { @@ -942,4 +951,4 @@ } } } -})(jQuery); \ No newline at end of file +}))(jQuery); \ No newline at end of file From 49977bf9446ab88a922536a3069f6712b7fa74be Mon Sep 17 00:00:00 2001 From: Matty Date: Thu, 14 Feb 2013 12:40:15 +0200 Subject: [PATCH 16/48] Alpha pass at supporting IE10 touch events. --- jquery.flexslider.js | 53 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/jquery.flexslider.js b/jquery.flexslider.js index e0097089..c8a805a6 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -347,32 +347,64 @@ startT, scrolling = false; + var localX = 0; + var localY = 0; + el.addEventListener('touchstart', onTouchStart, false); + // Cater for Windows-device touch events. + if (window.navigator.msPointerEnabled) { + el.addEventListener('MSPointerDown', onTouchStart, false); + } function onTouchStart(e) { if (slider.animating) { e.preventDefault(); - } else if (e.touches.length === 1) { + } else if ( e.touches.length === 1 || ( window.navigator.msPointerEnabled && e.isPrimary ) ) { slider.pause(); // CAROUSEL: cwidth = (vertical) ? slider.h : slider. w; startT = Number(new Date()); // CAROUSEL: + + // Local vars for X and Y points. + localX = e.touches[0].pageX; + localY = e.touches[0].pageY; + // Cater for Windows-device touch events. + if (window.navigator.msPointerEnabled) { + localX = e.pageX; + localY = e.pageY; + } + offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 : (carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : (carousel && slider.currentSlide === slider.last) ? slider.limit : (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide : (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth; - startX = (vertical) ? e.touches[0].pageY : e.touches[0].pageX; - startY = (vertical) ? e.touches[0].pageX : e.touches[0].pageY; + startX = (vertical) ? localY : localX; + startY = (vertical) ? localX : localY; el.addEventListener('touchmove', onTouchMove, false); el.addEventListener('touchend', onTouchEnd, false); + + // Cater for Windows-device touch events. + if (window.navigator.msPointerEnabled) { + el.addEventListener('MSPointerMove', onTouchMove, false); + el.addEventListener('MSPointerUp', onTouchEnd, false); + } } } function onTouchMove(e) { - dx = (vertical) ? startX - e.touches[0].pageY : startX - e.touches[0].pageX; - scrolling = (vertical) ? (Math.abs(dx) < Math.abs(e.touches[0].pageX - startY)) : (Math.abs(dx) < Math.abs(e.touches[0].pageY - startY)); + // Local vars for X and Y points. + localX = e.touches[0].pageX; + localY = e.touches[0].pageY; + // Cater for Windows-device touch events. + if (window.navigator.msPointerEnabled) { + localX = e.pageX; + localY = e.pageY; + } + + dx = (vertical) ? startX - localY : startX - localX; + scrolling = (vertical) ? (Math.abs(dx) < Math.abs(localX - startY)) : (Math.abs(dx) < Math.abs(localY - startY)); if (!scrolling || Number(new Date()) - startT > 500) { e.preventDefault(); @@ -388,6 +420,10 @@ function onTouchEnd(e) { // finish the touch by undoing the touch session el.removeEventListener('touchmove', onTouchMove, false); + // Cater for Windows-device touch events. + if (window.navigator.msPointerEnabled) { + el.removeEventListener('MSPointerMove', onTouchMove, false); + } if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) { var updateDx = (reverse) ? -dx : dx, @@ -400,6 +436,10 @@ } } el.removeEventListener('touchend', onTouchEnd, false); + // Cater for Windows-device touch events. + if (window.navigator.msPointerEnabled) { + el.removeEventListener('MSPointerUp', onTouchEnd, false); + } startX = null; startY = null; dx = null; @@ -552,8 +592,7 @@ } else { slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 }); slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 }); - slider.animating = false; - slider.currentSlide = slider.animatingTo; + slider.wrapup(dimension); } } // SMOOTH HEIGHT: From c95edd9c90f66d6ce6505a19ee639571cdfd4ae9 Mon Sep 17 00:00:00 2001 From: Matty Date: Thu, 14 Feb 2013 13:44:12 +0200 Subject: [PATCH 17/48] Merged #405. --- jquery.flexslider.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jquery.flexslider.js b/jquery.flexslider.js index 50fa8c7f..69570de5 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -504,6 +504,10 @@ // public methods slider.flexAnimate = function(target, pause, override, withSync, fromNav) { + if (target !== slider.currentSlide) { + slider.direction = (target > slider.currentSlide) ? "next" : "prev"; + } + if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev"; if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) { From d302d8979d6d41f68191ecbae059adb6da0148ca Mon Sep 17 00:00:00 2001 From: Cobus Date: Fri, 15 Feb 2013 11:00:28 +0200 Subject: [PATCH 18/48] {DEV} FlexSlider 2013.02.15 - Version 2.0 * Added changelog.txt --- changelog.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog.txt diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 00000000..c5dd8c94 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,4 @@ +FLEXSLIDER CHANGELOG + +2013.02.15 - Version 2.0 + * Added changelog.txt \ No newline at end of file From 286a927967fcb1ced49a623ed79e41e1123333fe Mon Sep 17 00:00:00 2001 From: Matty Date: Fri, 15 Feb 2013 11:26:06 +0200 Subject: [PATCH 19/48] Removes AMD support, as was breaking other code and preventing it from functioning on some devices. --- jquery.flexslider.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/jquery.flexslider.js b/jquery.flexslider.js index 69570de5..292f7acc 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -4,15 +4,7 @@ * Contributing Author: Tyler Smith */ ; -(function(factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['jquery'], factory); - } else { - // Browser globals - factory(jQuery); - } -}(function ($) { +(function ($) { //FlexSlider: Object Instance $.flexslider = function(el, options) { @@ -994,4 +986,4 @@ } } } -}))(jQuery); +})(jQuery); From 39eac5d1dcdd36b2366bd9bdefb3e78c483087dd Mon Sep 17 00:00:00 2001 From: Matty Date: Fri, 15 Feb 2013 11:38:03 +0200 Subject: [PATCH 20/48] Merged #467. Resize slider smoothHeight on orientation change. --- jquery.flexslider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.flexslider.js b/jquery.flexslider.js index 292f7acc..d350791e 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -129,7 +129,7 @@ if (touch && slider.vars.touch) methods.touch(); // FADE&&SMOOTHHEIGHT || SLIDE: - if (!fade || (fade && slider.vars.smoothHeight)) $(window).bind("resize focus", methods.resize); + if (!fade || (fade && slider.vars.smoothHeight)) $(window).bind("resize orientationchange focus", methods.resize); // API: start() Callback From dffa87f29afac726b027fbc22426f0cca2b51570 Mon Sep 17 00:00:00 2001 From: Matty Date: Fri, 15 Feb 2013 12:11:31 +0200 Subject: [PATCH 21/48] Merged #507. Adds thumbnail caption support. --- jquery.flexslider.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/jquery.flexslider.js b/jquery.flexslider.js index d350791e..3edcabb6 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -168,13 +168,19 @@ setupPaging: function() { var type = (slider.vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging', j = 1, - item; + item, + slide; slider.controlNavScaffold = $('
        '); if (slider.pagingCount > 1) { for (var i = 0; i < slider.pagingCount; i++) { - item = (slider.vars.controlNav === "thumbnails") ? '' : '' + j + ''; + slide = slider.slides.eq(i); + item = (slider.vars.controlNav === "thumbnails") ? '' : '' + j + ''; + if ( 'thumbnails' === slider.vars.controlNav && true === slider.vars.thumbCaptions ) { + var captn = slide.attr( 'data-thumbcaption' ); + if ( '' != captn && undefined != captn ) item += '' + captn + ''; + } slider.controlNavScaffold.append('
      1. ' + item + '
      2. '); j++; } @@ -899,10 +905,10 @@ namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril animation: "fade", //String: Select your animation type, "fade" or "slide" - easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported! + easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported! direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" reverse: false, //{NEW} Boolean: Reverse the animation direction - animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end + animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode startAt: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide) slideshow: true, //Boolean: Animate slider automatically @@ -910,6 +916,7 @@ animationSpeed: 600, //Integer: Set the speed of animations, in milliseconds initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds randomize: false, //Boolean: Randomize slide order + thumbCaptions: false, //Boolean: Whether or not to put captions on thumbnails when using the "thumbnails" controlNav. // Usability features pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended. From 317ea578af15bf7b28b31c646676b9e89e718a61 Mon Sep 17 00:00:00 2001 From: Matty Date: Fri, 15 Feb 2013 14:46:49 +0200 Subject: [PATCH 22/48] Adds thumbnail captions support. Checks for presence of MSPointerDown event to enable touch mode. --- jquery.flexslider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.flexslider.js b/jquery.flexslider.js index 3edcabb6..718b2dce 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -14,10 +14,10 @@ slider.vars = $.extend({}, $.flexslider.defaults, options); var namespace = slider.vars.namespace, - touch = (("ontouchstart" in window) || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch, + touch = (( "ontouchstart" in window ) || ( "MSPointerDown" in window ) || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch, // depricating this idea, as devices are being released with both of these events //eventType = (touch) ? "touchend" : "click", - eventType = "click touchend", + eventType = "click touchend MSPointerUp", watchedEvent = "", watchedEventClearTimer, vertical = slider.vars.direction === "vertical", From 0a8120a52caf2a2f62d03f968ddfc297bbed7601 Mon Sep 17 00:00:00 2001 From: Warren Holmes Date: Fri, 15 Feb 2013 15:43:52 +0200 Subject: [PATCH 23/48] Wistia --- demo/video-wistia.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/demo/video-wistia.html b/demo/video-wistia.html index d008d942..2a087f7a 100644 --- a/demo/video-wistia.html +++ b/demo/video-wistia.html @@ -15,8 +15,12 @@ + + + + - + @@ -134,10 +138,6 @@

        Video

        - - - - From 0b8410798e6d109d7d52c0fc45813039275f22d3 Mon Sep 17 00:00:00 2001 From: Matty Date: Mon, 18 Feb 2013 09:03:46 +0200 Subject: [PATCH 24/48] Adds a second pass at touch events on Windows Phone devices, specifically in IE10 (thanks @fxalvarezd). --- jquery.flexslider.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/jquery.flexslider.js b/jquery.flexslider.js index 718b2dce..8f11206a 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -14,7 +14,7 @@ slider.vars = $.extend({}, $.flexslider.defaults, options); var namespace = slider.vars.namespace, - touch = (( "ontouchstart" in window ) || ( "MSPointerDown" in window ) || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch, + touch = (( "ontouchstart" in window ) || ( window.navigator.msPointerEnabled ) || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch, // depricating this idea, as devices are being released with both of these events //eventType = (touch) ? "touchend" : "click", eventType = "click touchend MSPointerUp", @@ -365,7 +365,7 @@ function onTouchStart(e) { if (slider.animating) { e.preventDefault(); - } else if ( e.touches.length === 1 || ( window.navigator.msPointerEnabled && e.isPrimary ) ) { + } else if ( ( window.navigator.msPointerEnabled ) || e.touches.length === 1 ) { slider.pause(); // CAROUSEL: cwidth = (vertical) ? slider.h : slider. w; @@ -395,25 +395,32 @@ // Cater for Windows-device touch events. if (window.navigator.msPointerEnabled) { el.addEventListener('MSPointerMove', onTouchMove, false); - el.addEventListener('MSPointerUp', onTouchEnd, false); + el.addEventListener('MSPointerOut', onTouchEnd, false); } } } function onTouchMove(e) { // Local vars for X and Y points. - localX = e.touches[0].pageX; - localY = e.touches[0].pageY; // Cater for Windows-device touch events. - if (window.navigator.msPointerEnabled) { + if ( window.navigator.msPointerEnabled ) { localX = e.pageX; localY = e.pageY; + } else { + localX = e.touches[0].pageX; + localY = e.touches[0].pageY; } dx = (vertical) ? startX - localY : startX - localX; scrolling = (vertical) ? (Math.abs(dx) < Math.abs(localX - startY)) : (Math.abs(dx) < Math.abs(localY - startY)); - if (!scrolling || Number(new Date()) - startT > 500) { + if ( window.navigator.msPointerEnabled ) { + var fxms = 100; + } else { + var fxms = 500; + } + + if ( ! scrolling || Number( new Date() ) - startT > fxms ) { e.preventDefault(); if (!fade && slider.transitions) { if (!slider.vars.animationLoop) { @@ -445,7 +452,7 @@ el.removeEventListener('touchend', onTouchEnd, false); // Cater for Windows-device touch events. if (window.navigator.msPointerEnabled) { - el.removeEventListener('MSPointerUp', onTouchEnd, false); + el.removeEventListener('MSPointerOut', onTouchEnd, false); } startX = null; startY = null; From 586eec47aba93492ef374da72b4eadbacd17ad3b Mon Sep 17 00:00:00 2001 From: Cobus Date: Mon, 18 Feb 2013 12:53:37 +0200 Subject: [PATCH 25/48] FlexSlider - Replaced icons with font-face files - Compressed SyntaxHighlighter CSS and added to css/demo.css (deleted original files) - Browser test new font-face icons - Responsive layout tweaks - New responsive navigation - Clean up CSS --- demo/basic-carousel.html | 18 +- demo/carousel-min-max.html | 15 +- demo/css/demo.css | 399 +++++++++++++++++++---------- demo/css/shCore.css | 226 ---------------- demo/css/shThemeDefault.css | 117 --------- demo/dynamic-carousel-min-max.html | 18 +- demo/images/logo.png | Bin 7683 -> 3575 bytes demo/index.html | 18 +- demo/thumbnail-controlnav.html | 18 +- demo/thumbnail-slider.html | 18 +- demo/video-wistia.html | 18 +- demo/video.html | 18 +- flexslider.css | 56 ++-- fonts/flexslider-icon.eot | Bin 0 -> 2082 bytes fonts/flexslider-icon.svg | 19 ++ fonts/flexslider-icon.ttf | Bin 0 -> 1892 bytes fonts/flexslider-icon.woff | Bin 0 -> 1268 bytes images/bg_direction_nav.png | Bin 760 -> 0 bytes images/bg_play_pause.png | Bin 0 -> 1546 bytes 19 files changed, 359 insertions(+), 599 deletions(-) delete mode 100644 demo/css/shCore.css delete mode 100644 demo/css/shThemeDefault.css create mode 100644 fonts/flexslider-icon.eot create mode 100644 fonts/flexslider-icon.svg create mode 100644 fonts/flexslider-icon.ttf create mode 100644 fonts/flexslider-icon.woff delete mode 100644 images/bg_direction_nav.png create mode 100644 images/bg_play_pause.png diff --git a/demo/basic-carousel.html b/demo/basic-carousel.html index 126162fb..0ec5c14c 100644 --- a/demo/basic-carousel.html +++ b/demo/basic-carousel.html @@ -5,9 +5,6 @@ FlexSlider 2 - - - @@ -18,26 +15,21 @@ -
        - - - WooThemes - - -
        -
        +

        FlexSlider 2

        The best responsive slider. Period.

        Download Flexslider +

        Other Examples