Produced by Araxis Merge on 2/1/2017 2:57:42 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\Araxis_Merge_Comprasion\Pub_un\BTSSS_CIF_122016.zip\BTSSS_CIF_12_20_16\clean\CRM Portal\trunk\BTSSSPortal\Areas\Products\js | jquery.elastislide.js | Tue Dec 20 19:50:57 2016 UTC |
| 2 | Wed Feb 1 19:57:42 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 822 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /* | |||||
| 2 | jQuery Ela stislide v 1.1.0 | |||||
| 3 | http://www .codrops.c om | |||||
| 4 | ||||||
| 5 | Copyright (c) 2012 C odrops | |||||
| 6 | ||||||
| 7 | Permission is hereby granted, free of ch arge, to a ny person obtaining a copy of this softw are and as sociated d ocumentati on files ( the "Softw are"), to deal in th e Software without r estriction , includin g without limitation the right s to use, copy, modi fy, merge, publish, distribute , sublicen se, and/or sell copi es of the Software, and to per mit person s to whom the Softwa re is furn ished to d o so, subj ect to the following condition s: | |||||
| 8 | ||||||
| 9 | The above copyright notice and this perm ission not ice shall be include d in all c opies or s ubstantial portions of the Sof tware. | |||||
| 10 | ||||||
| 11 | THE SOFTWA RE IS PROV IDED "AS I S", WITHOU T WARRANTY OF ANY KI ND, EXPRES S OR IMPLI ED, INCLUD ING BUT NO T LIMITED TO THE WAR RANTIES OF MERCHANTA BILITY, FI TNESS FOR A PARTICUL AR PURPOSE AND NONIN FRINGEMENT . IN NO EV ENT SHALL THE AUTHOR S OR COPYR IGHT HOLDE RS BE LIAB LE FOR ANY CLAIM, DA MAGES OR O THER LIABI LITY, WHET HER IN AN ACTION OF CONTRACT, TORT OR OT HERWISE, A RISING FRO M, OUT OF OR IN CONN ECTION WIT H THE SOFT WARE OR TH E USE OR O THER DEALI NGS IN THE SOFTWARE. | |||||
| 12 | */ | |||||
| 13 | ||||||
| 14 | ;( functio n( $, wind ow, undefi ned ) { | |||||
| 15 | ||||||
| 16 | 'u se strict' ; | |||||
| 17 | ||||||
| 18 | /* | |||||
| 19 | * debouncedr esize: spe cial jQuer y event th at happens once afte r a window resize | |||||
| 20 | * | |||||
| 21 | * latest ver sion and c omplete RE ADME avail able on Gi thub: | |||||
| 22 | * https://gi thub.com/l ouisremi/j query-smar tresize/bl ob/master/ jquery.deb ouncedresi ze.js | |||||
| 23 | * | |||||
| 24 | * Copyright 2011 @loui s_remi | |||||
| 25 | * Licensed u nder the M IT license . | |||||
| 26 | */ | |||||
| 27 | va r $event = $.event, | |||||
| 28 | $s pecial, | |||||
| 29 | re sizeTimeou t; | |||||
| 30 | ||||||
| 31 | $s pecial = $ event.spec ial.deboun cedresize = { | |||||
| 32 | setu p: functio n() { | |||||
| 33 | $( thi s ).on( "r esize", $s pecial.han dler ); | |||||
| 34 | }, | |||||
| 35 | tear down: func tion() { | |||||
| 36 | $( thi s ).off( " resize", $ special.ha ndler ); | |||||
| 37 | }, | |||||
| 38 | hand ler: funct ion( event , execAsap ) { | |||||
| 39 | // Sav e the cont ext | |||||
| 40 | var co ntext = th is, | |||||
| 41 | args = a rguments, | |||||
| 42 | dispatch = functio n() { | |||||
| 43 | // set cor rect event type | |||||
| 44 | event.type = "deboun cedresize" ; | |||||
| 45 | $event.dis patch.appl y( context , args ); | |||||
| 46 | }; | |||||
| 47 | ||||||
| 48 | if ( r esizeTimeo ut ) { | |||||
| 49 | clearTim eout( resi zeTimeout ); | |||||
| 50 | } | |||||
| 51 | ||||||
| 52 | execAs ap ? | |||||
| 53 | dispatch () : | |||||
| 54 | resizeTi meout = se tTimeout( dispatch, $special.t hreshold ) ; | |||||
| 55 | }, | |||||
| 56 | thre shold: 150 | |||||
| 57 | }; | |||||
| 58 | ||||||
| 59 | // ========= ========== ==== image sLoaded Pl ugin ===== ========== ========== ====== | |||||
| 60 | // https://g ithub.com/ desandro/i magesloade d | |||||
| 61 | ||||||
| 62 | // $('#my-co ntainer'). imagesLoad ed(myFunct ion) | |||||
| 63 | // execute a callback when all i mages have loaded. | |||||
| 64 | // needed be cause .loa d() doesn' t work on cached ima ges | |||||
| 65 | ||||||
| 66 | // callback function g ets image collection as argume nt | |||||
| 67 | // this is the contai ner | |||||
| 68 | ||||||
| 69 | // original: mit licen se. paul i rish. 2010 . | |||||
| 70 | // contribut ors: Oren Solomianik , David De Sandro, Yi annis Chat zikonstant inou | |||||
| 71 | ||||||
| 72 | // blank ima ge data-ur i bypasses webkit lo g warning (thx doug jones) | |||||
| 73 | va r BLANK = 'data:imag e/gif;base 64,R0lGODl hAQABAIAAA AAAAP///yw AAAAAAQABA AACAUwAOw= ='; | |||||
| 74 | ||||||
| 75 | $. fn.imagesL oaded = fu nction( ca llback ) { | |||||
| 76 | var $this = th is, | |||||
| 77 | deferr ed = $.isF unction($. Deferred) ? $.Deferr ed() : 0, | |||||
| 78 | hasNot ify = $.is Function(d eferred.no tify), | |||||
| 79 | $image s = $this. find('img' ).add( $th is.filter( 'img') ), | |||||
| 80 | loaded = [], | |||||
| 81 | proper = [], | |||||
| 82 | broken = []; | |||||
| 83 | ||||||
| 84 | // R egister de ferred cal lbacks | |||||
| 85 | if ( $.isPlainO bject(call back)) { | |||||
| 86 | $.each (callback, function (key, valu e) { | |||||
| 87 | if (key === 'callb ack') { | |||||
| 88 | callback = value; | |||||
| 89 | } else i f (deferre d) { | |||||
| 90 | deferred[k ey](value) ; | |||||
| 91 | } | |||||
| 92 | }); | |||||
| 93 | } | |||||
| 94 | ||||||
| 95 | func tion doneL oading() { | |||||
| 96 | var $p roper = $( proper), | |||||
| 97 | $broken = $(broken ); | |||||
| 98 | ||||||
| 99 | if ( d eferred ) { | |||||
| 100 | if ( bro ken.length ) { | |||||
| 101 | deferred.r eject( $im ages, $pro per, $brok en ); | |||||
| 102 | } else { | |||||
| 103 | deferred.r esolve( $i mages ); | |||||
| 104 | } | |||||
| 105 | } | |||||
| 106 | ||||||
| 107 | if ( $ .isFunctio n( callbac k ) ) { | |||||
| 108 | callback .call( $th is, $image s, $proper , $broken ); | |||||
| 109 | } | |||||
| 110 | } | |||||
| 111 | ||||||
| 112 | func tion imgLo aded( img, isBroken ) { | |||||
| 113 | // don 't proceed if BLANK image, or image is a lready loa ded | |||||
| 114 | if ( i mg.src === BLANK || $.inArray( img, load ed ) !== - 1 ) { | |||||
| 115 | return; | |||||
| 116 | } | |||||
| 117 | ||||||
| 118 | // sto re element in loaded images ar ray | |||||
| 119 | loaded .push( img ); | |||||
| 120 | ||||||
| 121 | // kee p track of broken an d properly loaded im ages | |||||
| 122 | if ( i sBroken ) { | |||||
| 123 | broken.p ush( img ) ; | |||||
| 124 | } else { | |||||
| 125 | proper.p ush( img ) ; | |||||
| 126 | } | |||||
| 127 | ||||||
| 128 | // cac he image a nd its sta te for fut ure calls | |||||
| 129 | $.data ( img, 'im agesLoaded ', { isBro ken: isBro ken, src: img.src } ); | |||||
| 130 | ||||||
| 131 | // tri gger defer red progre ss method if present | |||||
| 132 | if ( h asNotify ) { | |||||
| 133 | deferred .notifyWit h( $(img), [ isBroke n, $images , $(proper ), $(broke n) ] ); | |||||
| 134 | } | |||||
| 135 | ||||||
| 136 | // cal l doneLoad ing and cl ean listen ers if all images ar e loaded | |||||
| 137 | if ( $ images.len gth === lo aded.lengt h ){ | |||||
| 138 | setTimeo ut( doneLo ading ); | |||||
| 139 | $images. unbind( '. imagesLoad ed' ); | |||||
| 140 | } | |||||
| 141 | } | |||||
| 142 | ||||||
| 143 | // i f no image s, trigger immediate ly | |||||
| 144 | if ( !$images. length ) { | |||||
| 145 | doneLo ading(); | |||||
| 146 | } el se { | |||||
| 147 | $image s.bind( 'l oad.images Loaded err or.imagesL oaded', fu nction( ev ent ){ | |||||
| 148 | // trigg er imgLoad ed | |||||
| 149 | imgLoade d( event.t arget, eve nt.type == = 'error' ); | |||||
| 150 | }).eac h( functio n( i, el ) { | |||||
| 151 | var src = el.src; | |||||
| 152 | ||||||
| 153 | // find out if thi s image ha s been alr eady check ed for sta tus | |||||
| 154 | // if it was, and src has no t changed, call imgL oaded on i t | |||||
| 155 | var cach ed = $.dat a( el, 'im agesLoaded ' ); | |||||
| 156 | if ( cac hed && cac hed.src == = src ) { | |||||
| 157 | imgLoaded( el, cache d.isBroken ); | |||||
| 158 | return; | |||||
| 159 | } | |||||
| 160 | ||||||
| 161 | // if co mplete is true and b rowser sup ports natu ral sizes, try | |||||
| 162 | // to ch eck for im age status manually | |||||
| 163 | if ( el. complete & & el.natur alWidth != = undefine d ) { | |||||
| 164 | imgLoaded( el, el.na turalWidth === 0 || el.natural Height === 0 ); | |||||
| 165 | return; | |||||
| 166 | } | |||||
| 167 | ||||||
| 168 | // cache d images d on't fire load somet imes, so w e reset sr c, but onl y when | |||||
| 169 | // deali ng with IE , or image is comple te (loaded ) and fail ed manual check | |||||
| 170 | // webki t hack fro m http://g roups.goog le.com/gro up/jquery- dev/browse _thread/th read/eee6a b7b2da50e1 f | |||||
| 171 | if ( el. readyState || el.com plete ) { | |||||
| 172 | el.src = B LANK; | |||||
| 173 | el.src = s rc; | |||||
| 174 | } | |||||
| 175 | }); | |||||
| 176 | } | |||||
| 177 | ||||||
| 178 | retu rn deferre d ? deferr ed.promise ( $this ) : $this; | |||||
| 179 | }; | |||||
| 180 | ||||||
| 181 | // global | |||||
| 182 | va r $window = $( windo w ), | |||||
| 183 | Mode rnizr = wi ndow.Moder nizr; | |||||
| 184 | ||||||
| 185 | $. Elastislid e = functi on( option s, element ) { | |||||
| 186 | ||||||
| 187 | this .$el = $( element ); | |||||
| 188 | this ._init( op tions ); | |||||
| 189 | ||||||
| 190 | }; | |||||
| 191 | ||||||
| 192 | $. Elastislid e.defaults = { | |||||
| 193 | // o rientation 'horizont al' || 've rtical' | |||||
| 194 | orie ntation : 'horizonta l', | |||||
| 195 | // s liding spe ed | |||||
| 196 | spee d : 500, | |||||
| 197 | // s liding eas ing | |||||
| 198 | easi ng : 'ease -in-out', | |||||
| 199 | // t he minimum number of items to show. | |||||
| 200 | // w hen we res ize the wi ndow, this will make sure minI tems are a lways show n | |||||
| 201 | // ( unless of course min Items is h igher than the total number of elements) | |||||
| 202 | minI tems : 3, | |||||
| 203 | // i ndex of th e current item (left most item of the ca rousel) | |||||
| 204 | star t : 0, | |||||
| 205 | // c lick item callback | |||||
| 206 | onCl ick : func tion( el, position, evt ) { re turn false ; }, | |||||
| 207 | onRe ady : func tion() { r eturn fals e; }, | |||||
| 208 | onBe foreSlide : function () { retur n false; } , | |||||
| 209 | onAf terSlide : function( ) { return false; } | |||||
| 210 | }; | |||||
| 211 | ||||||
| 212 | $. Elastislid e.prototyp e = { | |||||
| 213 | ||||||
| 214 | _ini t : functi on( option s ) { | |||||
| 215 | ||||||
| 216 | // opt ions | |||||
| 217 | this.o ptions = $ .extend( t rue, {}, $ .Elastisli de.default s, options ); | |||||
| 218 | ||||||
| 219 | // htt ps://githu b.com/twit ter/bootst rap/issues /2870 | |||||
| 220 | var se lf = this, | |||||
| 221 | transEnd EventNames = { | |||||
| 222 | 'WebkitTra nsition' : 'webkitTr ansitionEn d', | |||||
| 223 | 'MozTransi tion' : 't ransitione nd', | |||||
| 224 | 'OTransiti on' : 'oTr ansitionEn d', | |||||
| 225 | 'msTransit ion' : 'MS Transition End', | |||||
| 226 | 'transitio n' : 'tran sitionend' | |||||
| 227 | }; | |||||
| 228 | ||||||
| 229 | this.t ransEndEve ntName = t ransEndEve ntNames[ M odernizr.p refixed( ' transition ' ) ]; | |||||
| 230 | ||||||
| 231 | // sup ort for cs s transfor ms and css transitio ns | |||||
| 232 | this.s upport = M odernizr.c sstransiti ons && Mod ernizr.css transforms ; | |||||
| 233 | ||||||
| 234 | // cur rent item' s index | |||||
| 235 | this.c urrent = t his.option s.start; | |||||
| 236 | ||||||
| 237 | // con trol if it 's sliding | |||||
| 238 | this.i sSliding = false; | |||||
| 239 | ||||||
| 240 | this.$ items = th is.$el.chi ldren( 'li ' ); | |||||
| 241 | // tot al number of items | |||||
| 242 | this.i temsCount = this.$it ems.length ; | |||||
| 243 | if( th is.itemsCo unt === 0 ) { | |||||
| 244 | ||||||
| 245 | return f alse; | |||||
| 246 | ||||||
| 247 | } | |||||
| 248 | this._ validate() ; | |||||
| 249 | // rem ove white space | |||||
| 250 | this.$ items.deta ch(); | |||||
| 251 | this.$ el.empty() ; | |||||
| 252 | this.$ el.append( this.$ite ms ); | |||||
| 253 | ||||||
| 254 | // mai n wrapper | |||||
| 255 | this.$ el.wrap( ' <div class ="elastisl ide-wrappe r elastisl ide-loadin g elastisl ide-' + th is.options .orientati on + '"></ div>' ); | |||||
| 256 | ||||||
| 257 | // che ck if we a pplied a t ransition to the <ul > | |||||
| 258 | this.h asTransiti on = false ; | |||||
| 259 | ||||||
| 260 | // add transitio n for the <ul> | |||||
| 261 | this.h asTransiti onTimeout = setTimeo ut( functi on() { | |||||
| 262 | ||||||
| 263 | self._ad dTransitio n(); | |||||
| 264 | ||||||
| 265 | }, 100 ); | |||||
| 266 | ||||||
| 267 | // pre load the i mages | |||||
| 268 | ||||||
| 269 | this.$ el.imagesL oaded( fun ction() { | |||||
| 270 | ||||||
| 271 | self.$el .show(); | |||||
| 272 | ||||||
| 273 | self._la yout(); | |||||
| 274 | self._co nfigure(); | |||||
| 275 | ||||||
| 276 | if( self .hasTransi tion ) { | |||||
| 277 | ||||||
| 278 | // slide t o current' s position | |||||
| 279 | self._remo veTransiti on(); | |||||
| 280 | self._slid eToItem( s elf.curren t ); | |||||
| 281 | ||||||
| 282 | self.$el.o n( self.tr ansEndEven tName, fun ction() { | |||||
| 283 | ||||||
| 284 | se lf.$el.off ( self.tra nsEndEvent Name ); | |||||
| 285 | se lf._setWra pperSize() ; | |||||
| 286 | // add trans ition for the <ul> | |||||
| 287 | se lf._addTra nsition(); | |||||
| 288 | se lf._initEv ents(); | |||||
| 289 | ||||||
| 290 | } ); | |||||
| 291 | ||||||
| 292 | } | |||||
| 293 | else { | |||||
| 294 | ||||||
| 295 | clearTimeo ut( self.h asTransiti onTimeout ); | |||||
| 296 | self._setW rapperSize (); | |||||
| 297 | self._init Events(); | |||||
| 298 | // slide t o current' s position | |||||
| 299 | self._slid eToItem( s elf.curren t ); | |||||
| 300 | setTimeout ( function () { self. _addTransi tion(); }, 25 ); | |||||
| 301 | ||||||
| 302 | } | |||||
| 303 | ||||||
| 304 | self.opt ions.onRea dy(); | |||||
| 305 | ||||||
| 306 | } ); | |||||
| 307 | ||||||
| 308 | }, | |||||
| 309 | _val idate : fu nction() { | |||||
| 310 | ||||||
| 311 | if( th is.options .speed < 0 ) { | |||||
| 312 | ||||||
| 313 | this.opt ions.speed = 500; | |||||
| 314 | ||||||
| 315 | } | |||||
| 316 | if( th is.options .minItems < 1 || thi s.options. minItems > this.item sCount ) { | |||||
| 317 | ||||||
| 318 | this.opt ions.minIt ems = 1; | |||||
| 319 | ||||||
| 320 | } | |||||
| 321 | if( th is.options .start < 0 || this.o ptions.sta rt > this. itemsCount - 1 ) { | |||||
| 322 | ||||||
| 323 | this.opt ions.start = 0; | |||||
| 324 | ||||||
| 325 | } | |||||
| 326 | if( th is.options .orientati on != 'hor izontal' & & this.opt ions.orien tation != 'vertical' ) { | |||||
| 327 | ||||||
| 328 | this.opt ions.orien tation = ' horizontal '; | |||||
| 329 | ||||||
| 330 | } | |||||
| 331 | ||||||
| 332 | }, | |||||
| 333 | _lay out : func tion() { | |||||
| 334 | ||||||
| 335 | this.$ el.wrap( ' <div class ="elastisl ide-carous el"></div> ' ); | |||||
| 336 | ||||||
| 337 | this.$ carousel = this.$el. parent(); | |||||
| 338 | this.$ wrapper = this.$caro usel.paren t().remove Class( 'el astislide- loading' ) ; | |||||
| 339 | ||||||
| 340 | // sav e original image siz es | |||||
| 341 | var $i mg = this. $items.fin d( 'img:fi rst' ); | |||||
| 342 | this.i mgSize = { width : $ img.outerW idth( true ), height : $img.ou terHeight( true ) }; | |||||
| 343 | ||||||
| 344 | this._ setItemsSi ze(); | |||||
| 345 | this.o ptions.ori entation = == 'horizo ntal' ? th is.$el.css ( 'max-hei ght', this .imgSize.h eight ) : this.$el.c ss( 'heigh t', this.o ptions.min Items * th is.imgSize .height ); | |||||
| 346 | ||||||
| 347 | // add the contr ols | |||||
| 348 | this._ addControl s(); | |||||
| 349 | ||||||
| 350 | }, | |||||
| 351 | _add Transition : functio n() { | |||||
| 352 | ||||||
| 353 | if( th is.support ) { | |||||
| 354 | ||||||
| 355 | this.$el .css( 'tra nsition', 'all ' + t his.option s.speed + 'ms ' + th is.options .easing ); | |||||
| 356 | ||||||
| 357 | } | |||||
| 358 | this.h asTransiti on = true; | |||||
| 359 | ||||||
| 360 | }, | |||||
| 361 | _rem oveTransit ion : func tion() { | |||||
| 362 | ||||||
| 363 | if( th is.support ) { | |||||
| 364 | ||||||
| 365 | this.$el .css( 'tra nsition', 'all 0s' ) ; | |||||
| 366 | ||||||
| 367 | } | |||||
| 368 | this.h asTransiti on = false ; | |||||
| 369 | ||||||
| 370 | }, | |||||
| 371 | _add Controls : function( ) { | |||||
| 372 | ||||||
| 373 | var se lf = this; | |||||
| 374 | ||||||
| 375 | // add navigatio n elements | |||||
| 376 | this.$ navigation = $( '<na v><span cl ass="elast islide-pre v">Previou s</span><s pan class= "elastisli de-next">N ext</span> </nav>' ) | |||||
| 377 | .appendT o( this.$w rapper ); | |||||
| 378 | ||||||
| 379 | ||||||
| 380 | this.$ navPrev = this.$navi gation.fin d( 'span.e lastislide -prev' ).o n( 'moused own.elasti slide', fu nction( ev ent ) { | |||||
| 381 | ||||||
| 382 | self._sl ide( 'prev ' ); | |||||
| 383 | return f alse; | |||||
| 384 | ||||||
| 385 | } ); | |||||
| 386 | ||||||
| 387 | this.$ navNext = this.$navi gation.fin d( 'span.e lastislide -next' ).o n( 'moused own.elasti slide', fu nction( ev ent ) { | |||||
| 388 | ||||||
| 389 | self._sl ide( 'next ' ); | |||||
| 390 | return f alse; | |||||
| 391 | ||||||
| 392 | } ); | |||||
| 393 | ||||||
| 394 | }, | |||||
| 395 | _set ItemsSize : function () { | |||||
| 396 | ||||||
| 397 | // wid th for the items (%) | |||||
| 398 | var w = this.opt ions.orien tation === 'horizont al' ? ( Ma th.floor( this.$caro usel.width () / this. options.mi nItems ) * 100 ) / t his.$carou sel.width( ) : 100; | |||||
| 399 | ||||||
| 400 | this.$ items.css( { | |||||
| 401 | 'width' : w + '%', | |||||
| 402 | 'max-wid th' : this .imgSize.w idth, | |||||
| 403 | 'max-hei ght' : thi s.imgSize. height | |||||
| 404 | } ); | |||||
| 405 | ||||||
| 406 | if( th is.options .orientati on === 've rtical' ) { | |||||
| 407 | ||||||
| 408 | this.$wr apper.css( 'max-widt h', this.i mgSize.wid th + parse Int( this. $wrapper.c ss( 'paddi ng-left' ) ) + parse Int( this. $wrapper.c ss( 'paddi ng-right' ) ) ); | |||||
| 409 | ||||||
| 410 | } | |||||
| 411 | ||||||
| 412 | }, | |||||
| 413 | _set WrapperSiz e : functi on() { | |||||
| 414 | ||||||
| 415 | if( th is.options .orientati on === 've rtical' ) { | |||||
| 416 | ||||||
| 417 | this.$wr apper.css( { | |||||
| 418 | 'height' : this.opti ons.minIte ms * this. imgSize.he ight + par seInt( thi s.$wrapper .css( 'pad ding-top' ) ) + pars eInt( this .$wrapper. css( 'padd ing-bottom ' ) ) | |||||
| 419 | } ); | |||||
| 420 | ||||||
| 421 | } | |||||
| 422 | ||||||
| 423 | }, | |||||
| 424 | _con figure : f unction() { | |||||
| 425 | ||||||
| 426 | // che ck how man y items fi t in the c arousel (v isible are a -> this. $carousel. width() ) | |||||
| 427 | this.f itCount = this.optio ns.orienta tion === ' horizontal ' ? | |||||
| 428 | this.$ carousel.w idth() < t his.option s.minItems * this.im gSize.widt h ? this.o ptions.min Items : Ma th.floor( this.$caro usel.width () / this. imgSize.wi dth ) : | |||||
| 429 | this.$ carousel.h eight() < this.optio ns.minItem s * this.i mgSize.hei ght ? this .options.m inItems : Math.floor ( this.$ca rousel.hei ght() / th is.imgSize .height ); | |||||
| 430 | ||||||
| 431 | }, | |||||
| 432 | _ini tEvents : function() { | |||||
| 433 | ||||||
| 434 | var se lf = this; | |||||
| 435 | ||||||
| 436 | $windo w.on( 'deb ouncedresi ze.elastis lide', fun ction() { | |||||
| 437 | ||||||
| 438 | self._se tItemsSize (); | |||||
| 439 | self._co nfigure(); | |||||
| 440 | self._sl ideToItem( self.curr ent ); | |||||
| 441 | ||||||
| 442 | } ); | |||||
| 443 | ||||||
| 444 | this.$ el.on( thi s.transEnd EventName, function( ) { | |||||
| 445 | ||||||
| 446 | self._on EndTransit ion(); | |||||
| 447 | ||||||
| 448 | } ); | |||||
| 449 | ||||||
| 450 | if( th is.options .orientati on === 'ho rizontal' ) { | |||||
| 451 | ||||||
| 452 | this.$el .on( { | |||||
| 453 | swipeleft : function () { | |||||
| 454 | ||||||
| 455 | se lf._slide( 'next' ); | |||||
| 456 | ||||||
| 457 | }, | |||||
| 458 | swiperight : functio n() { | |||||
| 459 | ||||||
| 460 | se lf._slide( 'prev' ); | |||||
| 461 | ||||||
| 462 | } | |||||
| 463 | } ); | |||||
| 464 | ||||||
| 465 | } | |||||
| 466 | else { | |||||
| 467 | ||||||
| 468 | this.$el .on( { | |||||
| 469 | swipeup : function() { | |||||
| 470 | ||||||
| 471 | se lf._slide( 'next' ); | |||||
| 472 | ||||||
| 473 | }, | |||||
| 474 | swipedown : function () { | |||||
| 475 | ||||||
| 476 | se lf._slide( 'prev' ); | |||||
| 477 | ||||||
| 478 | } | |||||
| 479 | } ); | |||||
| 480 | ||||||
| 481 | } | |||||
| 482 | ||||||
| 483 | // ite m click ev ent | |||||
| 484 | this.$ el.on( 'cl ick.elasti slide', 'l i', functi on( event ) { | |||||
| 485 | ||||||
| 486 | var $ite m = $( thi s ); | |||||
| 487 | ||||||
| 488 | self.opt ions.onCli ck( $item, $item.ind ex(), even t ); | |||||
| 489 | ||||||
| 490 | }); | |||||
| 491 | ||||||
| 492 | }, | |||||
| 493 | _des troy : fun ction( cal lback ) { | |||||
| 494 | ||||||
| 495 | this.$ el.off( th is.transEn dEventName ).off( 's wipeleft s wiperight swipeup sw ipedown .e lastislide ' ); | |||||
| 496 | $windo w.off( '.e lastislide ' ); | |||||
| 497 | ||||||
| 498 | this.$ el.css( { | |||||
| 499 | 'max-hei ght' : 'no ne', | |||||
| 500 | 'transit ion' : 'no ne' | |||||
| 501 | } ).un wrap( this .$carousel ).unwrap( this.$wra pper ); | |||||
| 502 | ||||||
| 503 | this.$ items.css( { | |||||
| 504 | 'width' : 'auto', | |||||
| 505 | 'max-wid th' : 'non e', | |||||
| 506 | 'max-hei ght' : 'no ne' | |||||
| 507 | } ); | |||||
| 508 | ||||||
| 509 | this.$ navigation .remove(); | |||||
| 510 | this.$ wrapper.re move(); | |||||
| 511 | ||||||
| 512 | if( ca llback ) { | |||||
| 513 | ||||||
| 514 | callback .call(); | |||||
| 515 | ||||||
| 516 | } | |||||
| 517 | ||||||
| 518 | }, | |||||
| 519 | _tog gleControl s : functi on( dir, d isplay ) { | |||||
| 520 | ||||||
| 521 | if( di splay ) { | |||||
| 522 | ||||||
| 523 | ( dir == = 'next' ) ? this.$n avNext.sho w() : this .$navPrev. show(); | |||||
| 524 | ||||||
| 525 | } | |||||
| 526 | else { | |||||
| 527 | ||||||
| 528 | ( dir == = 'next' ) ? this.$n avNext.hid e() : this .$navPrev. hide(); | |||||
| 529 | ||||||
| 530 | } | |||||
| 531 | ||||||
| 532 | }, | |||||
| 533 | _sli de : funct ion( dir, tvalue ) { | |||||
| 534 | ||||||
| 535 | if( th is.isSlidi ng ) { | |||||
| 536 | ||||||
| 537 | return f alse; | |||||
| 538 | ||||||
| 539 | } | |||||
| 540 | ||||||
| 541 | this.o ptions.onB eforeSlide (); | |||||
| 542 | ||||||
| 543 | this.i sSliding = true; | |||||
| 544 | ||||||
| 545 | var se lf = this, | |||||
| 546 | translat ion = this .translati on || 0, | |||||
| 547 | // width /height of an item ( <li> ) | |||||
| 548 | itemSpac e = this.o ptions.ori entation = == 'horizo ntal' ? th is.$items. outerWidth ( true ) : this.$ite ms.outerHe ight( true ), | |||||
| 549 | // total width/hei ght of the <ul> | |||||
| 550 | totalSpa ce = this. itemsCount * itemSpa ce, | |||||
| 551 | // visib le width/h eight | |||||
| 552 | visibleS pace = thi s.options. orientatio n === 'hor izontal' ? this.$car ousel.widt h() : this .$carousel .height(); | |||||
| 553 | ||||||
| 554 | if( tv alue === u ndefined ) { | |||||
| 555 | ||||||
| 556 | var amou nt = this. fitCount * itemSpace ; | |||||
| 557 | ||||||
| 558 | if( amou nt < 0 ) { | |||||
| 559 | ||||||
| 560 | return fal se; | |||||
| 561 | ||||||
| 562 | } | |||||
| 563 | ||||||
| 564 | if( dir === 'next' && totalS pace - ( M ath.abs( t ranslation ) + amoun t ) < visi bleSpace ) { | |||||
| 565 | ||||||
| 566 | amount = t otalSpace - ( Math.a bs( transl ation ) + visibleSpa ce ); | |||||
| 567 | ||||||
| 568 | // show / hide navig ation butt ons | |||||
| 569 | this._togg leControls ( 'next', false ); | |||||
| 570 | this._togg leControls ( 'prev', true ); | |||||
| 571 | ||||||
| 572 | } | |||||
| 573 | else if( dir === ' prev' && M ath.abs( t ranslation ) - amoun t < 0 ) { | |||||
| 574 | ||||||
| 575 | amount = M ath.abs( t ranslation ); | |||||
| 576 | ||||||
| 577 | // show / hide navig ation butt ons | |||||
| 578 | this._togg leControls ( 'next', true ); | |||||
| 579 | this._togg leControls ( 'prev', false ); | |||||
| 580 | ||||||
| 581 | } | |||||
| 582 | else { | |||||
| 583 | ||||||
| 584 | // future translatio n value | |||||
| 585 | var ftv = dir === 'n ext' ? Mat h.abs( tra nslation ) + Math.ab s( amount ) : Math.a bs( transl ation ) - Math.abs( amount ); | |||||
| 586 | ||||||
| 587 | // show / hide navig ation butt ons | |||||
| 588 | ftv > 0 ? this._togg leControls ( 'prev', true ) : t his._toggl eControls( 'prev', f alse ); | |||||
| 589 | ftv < tota lSpace - v isibleSpac e ? this._ toggleCont rols( 'nex t', true ) : this._t oggleContr ols( 'next ', false ) ; | |||||
| 590 | ||||||
| 591 | } | |||||
| 592 | ||||||
| 593 | tvalue = dir === ' next' ? tr anslation - amount : translati on + amoun t; | |||||
| 594 | ||||||
| 595 | } | |||||
| 596 | else { | |||||
| 597 | ||||||
| 598 | var amou nt = Math. abs( tvalu e ); | |||||
| 599 | ||||||
| 600 | if( Math .max( tota lSpace, vi sibleSpace ) - amoun t < visibl eSpace ) { | |||||
| 601 | ||||||
| 602 | tvalue = - ( Math.m ax( totalS pace, visi bleSpace ) - visible Space ); | |||||
| 603 | ||||||
| 604 | } | |||||
| 605 | ||||||
| 606 | // show / hide nav igation bu ttons | |||||
| 607 | amount > 0 ? this. _toggleCon trols( 'pr ev', true ) : this._ toggleCont rols( 'pre v', false ); | |||||
| 608 | Math.max ( totalSpa ce, visibl eSpace ) - visibleSp ace > amou nt ? this. _toggleCon trols( 'ne xt', true ) : this._ toggleCont rols( 'nex t', false ); | |||||
| 609 | ||||||
| 610 | } | |||||
| 611 | ||||||
| 612 | this.t ranslation = tvalue; | |||||
| 613 | ||||||
| 614 | if( tr anslation === tvalue ) { | |||||
| 615 | ||||||
| 616 | this._on EndTransit ion(); | |||||
| 617 | return f alse; | |||||
| 618 | ||||||
| 619 | } | |||||
| 620 | ||||||
| 621 | if( th is.support ) { | |||||
| 622 | ||||||
| 623 | this.opt ions.orien tation === 'horizont al' ? this .$el.css( 'transform ', 'transl ateX(' + t value + 'p x)' ) : th is.$el.css ( 'transfo rm', 'tran slateY(' + tvalue + 'px)' ); | |||||
| 624 | ||||||
| 625 | } | |||||
| 626 | else { | |||||
| 627 | ||||||
| 628 | $.fn.app lyStyle = this.hasTr ansition ? $.fn.anim ate : $.fn .css; | |||||
| 629 | var styl eCSS = thi s.options. orientatio n === 'hor izontal' ? { left : tvalue } : { top : t value }; | |||||
| 630 | ||||||
| 631 | this.$el .stop().ap plyStyle( styleCSS, $.extend( true, [], { duration : this.op tions.spee d, complet e : functi on() { | |||||
| 632 | ||||||
| 633 | self._onEn dTransitio n(); | |||||
| 634 | ||||||
| 635 | } } ) ); | |||||
| 636 | ||||||
| 637 | } | |||||
| 638 | ||||||
| 639 | if( !t his.hasTra nsition ) { | |||||
| 640 | ||||||
| 641 | this._on EndTransit ion(); | |||||
| 642 | ||||||
| 643 | } | |||||
| 644 | ||||||
| 645 | }, | |||||
| 646 | _onE ndTransiti on : funct ion() { | |||||
| 647 | ||||||
| 648 | this.i sSliding = false; | |||||
| 649 | this.o ptions.onA fterSlide( ); | |||||
| 650 | ||||||
| 651 | }, | |||||
| 652 | _sli deTo : fun ction( pos ) { | |||||
| 653 | ||||||
| 654 | var po s = pos || this.curr ent, | |||||
| 655 | translat ion = Math .abs( this .translati on ) || 0, | |||||
| 656 | itemSpac e = this.o ptions.ori entation = == 'horizo ntal' ? th is.$items. outerWidth ( true ) : this.$ite ms.outerHe ight( true ), | |||||
| 657 | posR = t ranslation + this.$c arousel.wi dth(), | |||||
| 658 | ftv = Ma th.abs( po s * itemSp ace ); | |||||
| 659 | ||||||
| 660 | if( ft v + itemSp ace > posR || ftv < translatio n ) { | |||||
| 661 | ||||||
| 662 | this._sl ideToItem( pos ); | |||||
| 663 | ||||||
| 664 | } | |||||
| 665 | ||||||
| 666 | }, | |||||
| 667 | _sli deToItem : function( pos ) { | |||||
| 668 | ||||||
| 669 | // how much to s lide? | |||||
| 670 | var am ount = this.opt ions.orien tation === 'horizont al' ? pos * this.$it ems.outerW idth( true ) : pos * this.$ite ms.outerHe ight( true ); | |||||
| 671 | this._ slide( '', -amount ) ; | |||||
| 672 | ||||||
| 673 | }, | |||||
| 674 | // p ublic meth od: adds n ew items t o the caro usel | |||||
| 675 | /* | |||||
| 676 | ||||||
| 677 | how to use: | |||||
| 678 | var carouselEl = $( '#ca rousel' ), | |||||
| 679 | carous el = carou selEl.elas tislide(); | |||||
| 680 | ... | |||||
| 681 | ||||||
| 682 | // a ppend or p repend new items: | |||||
| 683 | caro uselEl.pre pend('<li> <a href="# "><img src ="images/l arge/2.jpg " alt="ima ge02" /></ a></li>'); | |||||
| 684 | ||||||
| 685 | // c all the ad d method: | |||||
| 686 | es.a dd(); | |||||
| 687 | ||||||
| 688 | */ | |||||
| 689 | add : function ( callback ) { | |||||
| 690 | ||||||
| 691 | var se lf = this, | |||||
| 692 | oldcurre nt = this. current, | |||||
| 693 | $current Item = thi s.$items.e q( this.cu rrent ); | |||||
| 694 | ||||||
| 695 | // add s new item s to the c arousel | |||||
| 696 | this.$ items = th is.$el.chi ldren( 'li ' ); | |||||
| 697 | this.i temsCount = this.$it ems.length ; | |||||
| 698 | this.c urrent = $ currentIte m.index(); | |||||
| 699 | this._ setItemsSi ze(); | |||||
| 700 | this._ configure( ); | |||||
| 701 | this._ removeTran sition(); | |||||
| 702 | oldcur rent < thi s.current ? this._sl ideToItem( this.curr ent ) : th is._slide( 'next', t his.transl ation ); | |||||
| 703 | setTim eout( func tion() { s elf._addTr ansition() ; }, 25 ); | |||||
| 704 | ||||||
| 705 | if ( c allback ) { | |||||
| 706 | ||||||
| 707 | callback .call(); | |||||
| 708 | ||||||
| 709 | } | |||||
| 710 | ||||||
| 711 | }, | |||||
| 712 | // p ublic meth od: sets a new eleme nt as the current. s lides to t hat positi on | |||||
| 713 | setC urrent : f unction( i dx, callba ck ) { | |||||
| 714 | ||||||
| 715 | this.c urrent = i dx; | |||||
| 716 | ||||||
| 717 | this._ slideTo(); | |||||
| 718 | ||||||
| 719 | if ( c allback ) { | |||||
| 720 | ||||||
| 721 | callback .call(); | |||||
| 722 | ||||||
| 723 | } | |||||
| 724 | ||||||
| 725 | }, | |||||
| 726 | // p ublic meth od: slides to the ne xt set of items | |||||
| 727 | next : functio n() { | |||||
| 728 | ||||||
| 729 | self._ slide( 'ne xt' ); | |||||
| 730 | ||||||
| 731 | }, | |||||
| 732 | // p ublic meth od: slides to the pr evious set of items | |||||
| 733 | prev ious : fun ction() { | |||||
| 734 | ||||||
| 735 | self._ slide( 'pr ev' ); | |||||
| 736 | ||||||
| 737 | }, | |||||
| 738 | // p ublic meth od: slides to the fi rst item | |||||
| 739 | slid eStart : f unction() { | |||||
| 740 | ||||||
| 741 | this._ slideTo( 0 ); | |||||
| 742 | ||||||
| 743 | }, | |||||
| 744 | // p ublic meth od: slides to the la st item | |||||
| 745 | slid eEnd : fun ction() { | |||||
| 746 | ||||||
| 747 | this._ slideTo( t his.itemsC ount - 1 ) ; | |||||
| 748 | ||||||
| 749 | }, | |||||
| 750 | // p ublic meth od: destro ys the ela stislide i nstance | |||||
| 751 | dest roy : func tion( call back ) { | |||||
| 752 | ||||||
| 753 | this._ destroy( c allback ); | |||||
| 754 | ||||||
| 755 | } | |||||
| 756 | ||||||
| 757 | }; | |||||
| 758 | ||||||
| 759 | va r logError = functio n( message ) { | |||||
| 760 | ||||||
| 761 | if ( window.co nsole ) { | |||||
| 762 | ||||||
| 763 | window .console.e rror( mess age ); | |||||
| 764 | ||||||
| 765 | } | |||||
| 766 | ||||||
| 767 | }; | |||||
| 768 | ||||||
| 769 | $. fn.elastis lide = fun ction( opt ions ) { | |||||
| 770 | ||||||
| 771 | var self = $.d ata( this, 'elastisl ide' ); | |||||
| 772 | ||||||
| 773 | if ( typeof op tions === 'string' ) { | |||||
| 774 | ||||||
| 775 | var ar gs = Array .prototype .slice.cal l( argumen ts, 1 ); | |||||
| 776 | ||||||
| 777 | this.e ach(functi on() { | |||||
| 778 | ||||||
| 779 | if ( !se lf ) { | |||||
| 780 | ||||||
| 781 | logError( "cannot ca ll methods on elasti slide prio r to initi alization; " + | |||||
| 782 | "attempted to call m ethod '" + options + "'" ); | |||||
| 783 | return; | |||||
| 784 | ||||||
| 785 | } | |||||
| 786 | ||||||
| 787 | if ( !$. isFunction ( self[opt ions] ) || options.c harAt(0) = == "_" ) { | |||||
| 788 | ||||||
| 789 | logError( "no such m ethod '" + options + "' for el astislide self" ); | |||||
| 790 | return; | |||||
| 791 | ||||||
| 792 | } | |||||
| 793 | ||||||
| 794 | self[ op tions ].ap ply( self, args ); | |||||
| 795 | ||||||
| 796 | }); | |||||
| 797 | ||||||
| 798 | } | |||||
| 799 | else { | |||||
| 800 | ||||||
| 801 | this.e ach(functi on() { | |||||
| 802 | ||||||
| 803 | if ( sel f ) { | |||||
| 804 | ||||||
| 805 | self._init (); | |||||
| 806 | ||||||
| 807 | } | |||||
| 808 | else { | |||||
| 809 | ||||||
| 810 | self = $.d ata( this, 'elastisl ide', new $.Elastisl ide( optio ns, this ) ); | |||||
| 811 | ||||||
| 812 | } | |||||
| 813 | ||||||
| 814 | }); | |||||
| 815 | ||||||
| 816 | } | |||||
| 817 | ||||||
| 818 | retu rn self; | |||||
| 819 | ||||||
| 820 | }; | |||||
| 821 | ||||||
| 822 | } )( jQuer y, window ); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.