jquery.themepunch.revolution.js 104 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286
  1. /**************************************************************************
  2. * jquery.themepunch.revolution.js - jQuery Plugin for Revolution Slider
  3. * @version: 5.4.8 (10.06.2018)
  4. * @requires jQuery v1.7 or later (tested on 1.9)
  5. * @author ThemePunch
  6. **************************************************************************/
  7. ;(function(jQuery,undefined){
  8. "use strict";
  9. var version = {
  10. core : "5.4.8",
  11. "revolution.extensions.actions.min.js":"2.1.0",
  12. "revolution.extensions.carousel.min.js":"1.2.1",
  13. "revolution.extensions.kenburn.min.js":"1.3.1",
  14. "revolution.extensions.layeranimation.min.js":"3.6.5",
  15. "revolution.extensions.navigation.min.js":"1.3.5",
  16. "revolution.extensions.parallax.min.js":"2.2.3",
  17. "revolution.extensions.slideanims.min.js":"1.8",
  18. "revolution.extensions.video.min.js":"2.2.2"
  19. };
  20. jQuery.fn.extend({
  21. revolution: function(options) {
  22. // SET DEFAULT VALUES OF ITEM //
  23. var defaults = {
  24. delay:9000,
  25. responsiveLevels:4064, // Single or Array for Responsive Levels i.e.: 4064 or i.e. [2048, 1024, 768, 480]
  26. visibilityLevels:[2048,1024,778,480], // Single or Array for Responsive Visibility Levels i.e.: 4064 or i.e. [2048, 1024, 768, 480]
  27. gridwidth:960, // Single or Array i.e. 960 or [960, 840,760,460]
  28. gridheight:500, // Single or Array i.e. 500 or [500, 450,400,350]
  29. minHeight:0,
  30. autoHeight:"off",
  31. sliderType : "standard", // standard, carousel, hero
  32. sliderLayout : "auto", // auto, fullwidth, fullscreen
  33. fullScreenAutoWidth:"off", // Turns the FullScreen Slider to be a FullHeight but auto Width Slider
  34. fullScreenAlignForce:"off",
  35. fullScreenOffsetContainer:"", // Size for FullScreen Slider minimising Calculated on the Container sizes
  36. fullScreenOffset:"0", // Size for FullScreen Slider minimising
  37. hideCaptionAtLimit:0, // It Defines if a caption should be shown under a Screen Resolution ( Basod on The Width of Browser)
  38. hideAllCaptionAtLimit:0, // Hide all The Captions if Width of Browser is less then this value
  39. hideSliderAtLimit:0, // Hide the whole slider, and stop also functions if Width of Browser is less than this value
  40. disableProgressBar:"off", // Hides Progress Bar if is set to "on"
  41. stopAtSlide:-1, // Stop Timer if Slide "x" has been Reached. If stopAfterLoops set to 0, then it stops already in the first Loop at slide X which defined. -1 means do not stop at any slide. stopAfterLoops has no sinn in this case.
  42. stopAfterLoops:-1, // Stop Timer if All slides has been played "x" times. IT will stop at THe slide which is defined via stopAtSlide:x, if set to -1 slide never stop automatic
  43. shadow:0, //0 = no Shadow, 1,2,3 = 3 Different Art of Shadows (No Shadow in Fullwidth Version !)
  44. dottedOverlay:"none", //twoxtwo, threexthree, twoxtwowhite, threexthreewhite
  45. startDelay:0, // Delay before the first Animation starts.
  46. lazyType : "smart", //full, smart, single
  47. spinner:"spinner0",
  48. shuffle:"off", // Random Order of Slides,
  49. viewPort:{
  50. enable:false, // if enabled, slider wait with start or wait at first slide.
  51. outof:"wait", // wait,pause
  52. visible_area:"60%", // Start Animation when 60% of Slider is visible
  53. presize:false // Presize the Height of the Slider Container for Internal Link Positions
  54. },
  55. fallbacks:{
  56. isJoomla:false,
  57. panZoomDisableOnMobile:"off",
  58. simplifyAll:"on",
  59. nextSlideOnWindowFocus:"off",
  60. disableFocusListener:true,
  61. ignoreHeightChanges:"off", // off, mobile, always
  62. ignoreHeightChangesSize:0,
  63. allowHTML5AutoPlayOnAndroid:true
  64. },
  65. parallax : {
  66. type : "off", // off, mouse, scroll, mouse+scroll
  67. levels: [10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85],
  68. origo:"enterpoint", // slidercenter or enterpoint
  69. speed:400,
  70. bgparallax : "off",
  71. opacity:"on",
  72. disable_onmobile:"off",
  73. ddd_shadow:"on",
  74. ddd_bgfreeze:"off",
  75. ddd_overflow:"visible",
  76. ddd_layer_overflow:"visible",
  77. ddd_z_correction:65,
  78. ddd_path:"mouse"
  79. },
  80. scrolleffect: {
  81. fade:"off",
  82. blur:"off",
  83. scale:"off",
  84. grayscale:"off",
  85. maxblur:10,
  86. on_layers:"off",
  87. on_slidebg:"off",
  88. on_static_layers:"off",
  89. on_parallax_layers:"off",
  90. on_parallax_static_layers:"off",
  91. direction:"both",
  92. multiplicator:1.35,
  93. multiplicator_layers:0.5,
  94. tilt:30,
  95. disable_on_mobile:"on"
  96. },
  97. carousel : {
  98. easing:punchgs.Power3.easeInOut,
  99. speed:800,
  100. showLayersAllTime : "off",
  101. horizontal_align : "center",
  102. vertical_align : "center",
  103. infinity : "on",
  104. space : 0,
  105. maxVisibleItems : 3,
  106. stretch:"off",
  107. fadeout:"on",
  108. maxRotation:0,
  109. minScale:0,
  110. vary_fade:"off",
  111. vary_rotation:"on",
  112. vary_scale:"off",
  113. border_radius:"0px",
  114. padding_top:0,
  115. padding_bottom:0
  116. },
  117. navigation : {
  118. keyboardNavigation:"off",
  119. keyboard_direction:"horizontal", // horizontal - left/right arrows, vertical - top/bottom arrows
  120. mouseScrollNavigation:"off", // on, off, carousel
  121. onHoverStop:"on", // Stop Banner Timet at Hover on Slide on/off
  122. touch:{
  123. touchenabled:"off", // Enable Swipe Function : on/off
  124. touchOnDesktop:"off", // Enable Tuoch on Desktop Systems also
  125. swipe_treshold : 75, // The number of pixels that the user must move their finger by before it is considered a swipe.
  126. swipe_min_touches : 1, // Min Finger (touch) used for swipe
  127. drag_block_vertical:false, // Prevent Vertical Scroll during Swipe
  128. swipe_direction:"horizontal"
  129. },
  130. arrows: {
  131. style:"",
  132. enable:false,
  133. hide_onmobile:false,
  134. hide_onleave:true,
  135. hide_delay:200,
  136. hide_delay_mobile:1200,
  137. hide_under:0,
  138. hide_over:9999,
  139. tmp:'',
  140. rtl:false,
  141. left : {
  142. h_align:"left",
  143. v_align:"center",
  144. h_offset:20,
  145. v_offset:0,
  146. container:"slider",
  147. },
  148. right : {
  149. h_align:"right",
  150. v_align:"center",
  151. h_offset:20,
  152. v_offset:0,
  153. container:"slider",
  154. }
  155. },
  156. bullets: {
  157. container:"slider",
  158. rtl:false,
  159. style:"",
  160. enable:false,
  161. hide_onmobile:false,
  162. hide_onleave:true,
  163. hide_delay:200,
  164. hide_delay_mobile:1200,
  165. hide_under:0,
  166. hide_over:9999,
  167. direction:"horizontal",
  168. h_align:"left",
  169. v_align:"center",
  170. space:0,
  171. h_offset:20,
  172. v_offset:0,
  173. tmp:'<span class="tp-bullet-image"></span><span class="tp-bullet-title"></span>'
  174. },
  175. thumbnails: {
  176. container:"slider",
  177. rtl:false,
  178. style:"",
  179. enable:false,
  180. width:100,
  181. height:50,
  182. min_width:100,
  183. wrapper_padding:2,
  184. wrapper_color:"#f5f5f5",
  185. wrapper_opacity:1,
  186. tmp:'<span class="tp-thumb-image"></span><span class="tp-thumb-title"></span>',
  187. visibleAmount:5,
  188. hide_onmobile:false,
  189. hide_onleave:true,
  190. hide_delay:200,
  191. hide_delay_mobile:1200,
  192. hide_under:0,
  193. hide_over:9999,
  194. direction:"horizontal",
  195. span:false,
  196. position:"inner",
  197. space:2,
  198. h_align:"left",
  199. v_align:"center",
  200. h_offset:20,
  201. v_offset:0
  202. },
  203. tabs: {
  204. container:"slider",
  205. rtl:false,
  206. style:"",
  207. enable:false,
  208. width:100,
  209. min_width:100,
  210. height:50,
  211. wrapper_padding:10,
  212. wrapper_color:"#f5f5f5",
  213. wrapper_opacity:1,
  214. tmp:'<span class="tp-tab-image"></span>',
  215. visibleAmount:5,
  216. hide_onmobile:false,
  217. hide_onleave:true,
  218. hide_delay:200,
  219. hide_delay_mobile:1200,
  220. hide_under:0,
  221. hide_over:9999,
  222. direction:"horizontal",
  223. span:false,
  224. space:0,
  225. position:"inner",
  226. h_align:"left",
  227. v_align:"center",
  228. h_offset:20,
  229. v_offset:0
  230. }
  231. },
  232. extensions:"extensions/", //example extensions/ or extensions/source/
  233. extensions_suffix:".min.js",
  234. //addons:[{fileprefix:"revolution.addon.whiteboard",init:"initWhiteBoard",params:"opt",handel:"whiteboard"}],
  235. debugMode:false
  236. };
  237. // Merge of Defaults
  238. options = jQuery.extend(true,{},defaults, options);
  239. return this.each(function() {
  240. var c = jQuery(this);
  241. // Prepare maxHeight
  242. options.minHeight = options.minHeight!=undefined ? parseInt(options.minHeight,0) : options.minHeight;
  243. options.scrolleffect.on = options.scrolleffect.fade==="on" || options.scrolleffect.scale==="on" || options.scrolleffect.blur==="on" || options.scrolleffect.grayscale==="on";
  244. //REMOVE SLIDES IF SLIDER IS HERO
  245. if (options.sliderType=="hero") {
  246. c.find('>ul>li').each(function(i) {
  247. if (i>0) jQuery(this).remove();
  248. })
  249. }
  250. options.jsFileLocation = options.jsFileLocation || getScriptLocation("themepunch.revolution.min.js");
  251. options.jsFileLocation = options.jsFileLocation + options.extensions;
  252. options.scriptsneeded = getNeededScripts(options,c);
  253. options.curWinRange = 0;
  254. options.rtl = true; //jQuery('body').hasClass("rtl");
  255. if (options.navigation!=undefined && options.navigation.touch!=undefined)
  256. options.navigation.touch.swipe_min_touches = options.navigation.touch.swipe_min_touches >5 ? 1 : options.navigation.touch.swipe_min_touches;
  257. jQuery(this).on("scriptsloaded",function() {
  258. if (options.modulesfailing ) {
  259. c.html('<div style="margin:auto;line-height:40px;font-size:14px;color:#fff;padding:15px;background:#e74c3c;margin:20px 0px;">!! Error at loading Slider Revolution 5.0 Extrensions.'+options.errorm+'</div>').show();
  260. return false;
  261. }
  262. // CHECK FOR MIGRATION
  263. if (_R.migration!=undefined) options = _R.migration(c,options);
  264. punchgs.force3D = true;
  265. if (options.simplifyAll!=="on") punchgs.TweenLite.lagSmoothing(1000,16);
  266. prepareOptions(c,options);
  267. initSlider(c,options);
  268. });
  269. c[0].opt = options;
  270. waitForScripts(c,options);
  271. })
  272. },
  273. //Get All Loaded Version
  274. getRSVersion : function(silent) {
  275. if (silent===true) {
  276. return jQuery('body').data('tp_rs_version');
  277. } else {
  278. var v = jQuery('body').data('tp_rs_version'),
  279. t = "";
  280. t += ("---------------------------------------------------------")+"\n";
  281. t += (" Currently Loaded Slider Revolution & SR Modules :")+"\n";
  282. t += ("---------------------------------------------------------")+"\n";
  283. for (var key in v) {
  284. t += (v[key].alias+": "+v[key].ver)+"\n";
  285. }
  286. t +=("---------------------------------------------------------")+"\n";
  287. return t;
  288. };
  289. },
  290. // Remove a Slide from the Slider
  291. revremoveslide : function(sindex) {
  292. return this.each(function() {
  293. var container=jQuery(this),
  294. opt = container[0].opt;
  295. if (sindex<0 || sindex>opt.slideamount) return;
  296. if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) {
  297. if (opt && opt.li.length>0) {
  298. if (sindex>0 || sindex<=opt.li.length) {
  299. var li = jQuery(opt.li[sindex]),
  300. ref = li.data("index"),
  301. nextslideafter = false;
  302. opt.slideamount = opt.slideamount-1;
  303. opt.realslideamount = opt.realslideamount-1;
  304. removeNavWithLiref('.tp-bullet',ref,opt);
  305. removeNavWithLiref('.tp-tab',ref,opt);
  306. removeNavWithLiref('.tp-thumb',ref,opt);
  307. if (li.hasClass('active-revslide'))
  308. nextslideafter = true;
  309. li.remove();
  310. opt.li = removeArray(opt.li,sindex);
  311. if (opt.carousel && opt.carousel.slides)
  312. opt.carousel.slides = removeArray(opt.carousel.slides,sindex)
  313. opt.thumbs = removeArray(opt.thumbs,sindex);
  314. if (_R.updateNavIndexes) _R.updateNavIndexes(opt);
  315. if (nextslideafter) container.revnext();
  316. punchgs.TweenLite.set(opt.li,{minWidth:"99%"});
  317. punchgs.TweenLite.set(opt.li,{minWidth:"100%"});
  318. }
  319. }
  320. }
  321. });
  322. },
  323. // Add a New Call Back to some Module
  324. revaddcallback: function(callback) {
  325. return this.each(function() {
  326. if (this.opt) {
  327. if (this.opt.callBackArray === undefined)
  328. this.opt.callBackArray = new Array();
  329. this.opt.callBackArray.push(callback);
  330. }
  331. })
  332. },
  333. // Get Current Parallax Proc
  334. revgetparallaxproc : function() {
  335. return jQuery(this)[0].opt.scrollproc;
  336. },
  337. // ENABLE DEBUG MODE
  338. revdebugmode: function() {
  339. return this.each(function() {
  340. var c=jQuery(this);
  341. c[0].opt.debugMode = true;
  342. containerResized(c,c[0].opt);
  343. })
  344. },
  345. // METHODE SCROLL
  346. revscroll: function(oy) {
  347. return this.each(function() {
  348. var c=jQuery(this);
  349. jQuery('body,html').animate({scrollTop:(c.offset().top+(c.height())-oy)+"px"},{duration:400});
  350. });
  351. },
  352. // METHODE PAUSE
  353. revredraw: function(oy) {
  354. return this.each(function() {
  355. var c=jQuery(this);
  356. containerResized(c,c[0].opt);
  357. })
  358. },
  359. // METHODE PAUSE
  360. revkill: function(oy) {
  361. var self = this,
  362. container=jQuery(this);
  363. punchgs.TweenLite.killDelayedCallsTo(_R.showHideNavElements);
  364. if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) {
  365. container.data('conthover',1);
  366. container.data('conthover-changed',1);
  367. container.trigger('revolution.slide.onpause');
  368. var bt = container.parent().find('.tp-bannertimer'),
  369. opt = container[0].opt;
  370. opt.tonpause = true;
  371. container.trigger('stoptimer');
  372. var resizid = "resize.revslider-"+container.attr('id');
  373. jQuery(window).unbind(resizid);
  374. punchgs.TweenLite.killTweensOf(container.find('*'),false);
  375. punchgs.TweenLite.killTweensOf(container,false);
  376. container.unbind('hover, mouseover, mouseenter,mouseleave, resize');
  377. var resizid = "resize.revslider-"+container.attr('id');
  378. jQuery(window).off(resizid);
  379. container.find('*').each(function() {
  380. var el = jQuery(this);
  381. el.unbind('on, hover, mouseenter,mouseleave,mouseover, resize,restarttimer, stoptimer');
  382. el.off('on, hover, mouseenter,mouseleave,mouseover, resize');
  383. el.data('mySplitText',null);
  384. el.data('ctl',null);
  385. if (el.data('tween')!=undefined)
  386. el.data('tween').kill();
  387. if (el.data('kenburn')!=undefined)
  388. el.data('kenburn').kill();
  389. if (el.data('timeline_out')!=undefined)
  390. el.data('timeline_out').kill();
  391. if (el.data('timeline')!=undefined)
  392. el.data('timeline').kill();
  393. el.remove();
  394. el.empty();
  395. el=null;
  396. })
  397. punchgs.TweenLite.killTweensOf(container.find('*'),false);
  398. punchgs.TweenLite.killTweensOf(container,false);
  399. bt.remove();
  400. try{container.closest('.forcefullwidth_wrapper_tp_banner').remove();} catch(e) {}
  401. try{container.closest('.rev_slider_wrapper').remove()} catch(e) {}
  402. try{container.remove();} catch(e) {}
  403. container.empty();
  404. container.html();
  405. container = null;
  406. opt = null;
  407. delete(self.c);
  408. delete(self.opt);
  409. delete(self.container);
  410. return true;
  411. } else {
  412. return false;
  413. }
  414. },
  415. // METHODE PAUSE
  416. revpause: function() {
  417. return this.each(function() {
  418. var c=jQuery(this);
  419. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  420. c.data('conthover',1);
  421. c.data('conthover-changed',1);
  422. c.trigger('revolution.slide.onpause');
  423. c[0].opt.tonpause = true;
  424. c.trigger('stoptimer');
  425. }
  426. })
  427. },
  428. // METHODE RESUME
  429. revresume: function() {
  430. return this.each(function() {
  431. var c=jQuery(this);
  432. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  433. c.data('conthover',0);
  434. c.data('conthover-changed',1);
  435. c.trigger('revolution.slide.onresume');
  436. c[0].opt.tonpause = false;
  437. c.trigger('starttimer');
  438. }
  439. })
  440. },
  441. revstart: function() {
  442. //return this.each(function() {
  443. var c=jQuery(this);
  444. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0 && c[0].opt!==undefined) {
  445. if (!c[0].opt.sliderisrunning) {
  446. // fixes revapi.revstart();
  447. c[0].opt.c=c;
  448. c[0].opt.ul = c.find('>ul');
  449. runSlider(c,c[0].opt);
  450. return true;
  451. }
  452. else {
  453. console.log("Slider Is Running Already");
  454. return false;
  455. }
  456. }
  457. //})
  458. },
  459. // METHODE NEXT
  460. revnext: function() {
  461. return this.each(function() {
  462. // CATCH THE CONTAINER
  463. var c=jQuery(this);
  464. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  465. _R.callingNewSlide(c,1);
  466. }
  467. })
  468. },
  469. // METHODE RESUME
  470. revprev: function() {
  471. return this.each(function() {
  472. // CATCH THE CONTAINER
  473. var c=jQuery(this);
  474. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  475. _R.callingNewSlide(c,-1);
  476. }
  477. })
  478. },
  479. // METHODE LENGTH
  480. revmaxslide: function() {
  481. // CATCH THE CONTAINER
  482. return jQuery(this).find('.tp-revslider-mainul >li').length;
  483. },
  484. // METHODE CURRENT
  485. revcurrentslide: function() {
  486. // CATCH THE CONTAINER
  487. var c=jQuery(this);
  488. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  489. return parseInt(c[0].opt.act,0)+1;
  490. }
  491. },
  492. // METHODE CURRENT
  493. revlastslide: function() {
  494. // CATCH THE CONTAINER
  495. return jQuery(this).find('.tp-revslider-mainul >li').length;
  496. },
  497. // METHODE JUMP TO SLIDE
  498. revshowslide: function(slide) {
  499. return this.each(function() {
  500. // CATCH THE CONTAINER
  501. var c=jQuery(this);
  502. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  503. _R.callingNewSlide(c,"to"+(slide-1));
  504. }
  505. })
  506. },
  507. revcallslidewithid: function(slide) {
  508. return this.each(function() {
  509. // CATCH THE CONTAINER
  510. var c=jQuery(this);
  511. if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) {
  512. _R.callingNewSlide(c,slide);
  513. }
  514. })
  515. }
  516. });
  517. //////////////////////////////////////////////////////////////
  518. // - REVOLUTION FUNCTION EXTENSIONS FOR GLOBAL USAGE - //
  519. //////////////////////////////////////////////////////////////
  520. var _R = jQuery.fn.revolution;
  521. jQuery.extend(true, _R, {
  522. getversion : function() {
  523. return version;
  524. },
  525. compare_version : function(extension) {
  526. var v = jQuery('body').data('tp_rs_version');
  527. v = v === undefined ? new Object() : v;
  528. if (v.Core===undefined) {
  529. v.Core = new Object();
  530. v.Core.alias = "Slider Revolution Core";
  531. v.Core.name = "jquery.themepunch.revolution.min.js";
  532. v.Core.ver = _R.getversion().core;
  533. }
  534. if (extension.check!="stop") {
  535. // CHECK FOR CORRECT CORE AND EXTENSION VERSION
  536. if (_R.getversion().core<extension.min_core) {
  537. if (extension.check===undefined) {
  538. console.log("%c"+"Slider Revolution Warning (Core:"+_R.getversion().core+")",'color:#c0392b;font-weight:bold;');
  539. console.log("%c"+" Core is older than expected ("+extension.min_core+") from "+extension.alias,'color:#333');
  540. console.log("%c"+" Please update Slider Revolution to the latest version.",'color:#333');
  541. console.log("%c"+" It might be required to purge and clear Server/Client side Caches.",'color:#333');
  542. }
  543. extension.check="stop";
  544. } else
  545. if (_R.getversion()[extension.name]!=undefined && extension.version <_R.getversion()[extension.name]) {
  546. if (extension.check===undefined) {
  547. console.log("%c"+"Slider Revolution Warning (Core:"+_R.getversion().core+")",'color:#c0392b;font-weight:bold;');
  548. console.log("%c"+" "+extension.alias+" ("+extension.version+") is older than requiered ("+_R.getversion()[extension.name]+")",'color:#333');
  549. console.log("%c"+" Please update Slider Revolution to the latest version.",'color:#333');
  550. console.log("%c"+" It might be required to purge and clear Server/Client side Caches.",'color:#333');
  551. }
  552. extension.check="stop";
  553. }
  554. }
  555. if (v[extension.alias]===undefined) {
  556. v[extension.alias] = new Object();
  557. v[extension.alias].alias = extension.alias;
  558. v[extension.alias].ver = extension.version;
  559. v[extension.alias].name = extension.name;
  560. }
  561. jQuery('body').data('tp_rs_version',v);
  562. return extension;
  563. },
  564. currentSlideIndex : function(opt) {
  565. var ai = opt.c.find('.active-revslide').index();
  566. ai = ai == -1 ? 0 : ai;
  567. return ai;
  568. },
  569. simp : function(a,b,basic) {
  570. var c = Math.abs(a) - (Math.floor(Math.abs(a / b))*b);
  571. if (basic)
  572. return c;
  573. else
  574. return a<0 ? -1*c : c;
  575. },
  576. // - IS IOS VERSION OLDER THAN 5 ??
  577. iOSVersion : function() {
  578. var oldios = false;
  579. if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
  580. if (navigator.userAgent.match(/OS 4_\d like Mac OS X/i)) {
  581. oldios = true;
  582. }
  583. } else {
  584. oldios = false;
  585. }
  586. return oldios;
  587. },
  588. // - CHECK IF BROWSER IS IE -
  589. isIE : function( version, comparison ){
  590. var $div = jQuery('<div style="display:none;"/>').appendTo(jQuery('body'));
  591. $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');
  592. var ieTest = $div.find('a').length;
  593. $div.remove();
  594. return ieTest;
  595. },
  596. // - IS MOBILE ??
  597. is_mobile : function() {
  598. var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];
  599. var ismobile=false;
  600. for(var i in agents) {
  601. if (navigator.userAgent.split(agents[i]).length>1) {
  602. ismobile = true;
  603. }
  604. }
  605. return ismobile;
  606. },
  607. is_android : function() {
  608. var agents = ['android', 'Android'];
  609. var isandroid=false;
  610. for(var i in agents) {
  611. if (navigator.userAgent.split(agents[i]).length>1) {
  612. isandroid = true;
  613. }
  614. }
  615. return isandroid;
  616. },
  617. // - CALL BACK HANDLINGS - //
  618. callBackHandling : function(opt,type,position) {
  619. try{
  620. if (opt.callBackArray)
  621. jQuery.each(opt.callBackArray,function(i,c) {
  622. if (c) {
  623. if (c.inmodule && c.inmodule === type)
  624. if (c.atposition && c.atposition === position)
  625. if (c.callback)
  626. c.callback.call();
  627. }
  628. });
  629. } catch(e) {
  630. console.log("Call Back Failed");
  631. }
  632. },
  633. get_browser : function(){
  634. var N=navigator.appName, ua=navigator.userAgent, tem;
  635. var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
  636. if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
  637. M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?'];
  638. return M[0];
  639. },
  640. get_browser_version : function(){
  641. var N=navigator.appName, ua=navigator.userAgent, tem;
  642. var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
  643. if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
  644. M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?'];
  645. return M[1];
  646. },
  647. /*
  648. Jason / Safari 11 Video autoplay fix
  649. */
  650. isSafari11: function() {
  651. var browser = jQuery.trim(_R.get_browser().toLowerCase());
  652. if(jQuery.trim(navigator.userAgent.toLowerCase()).search('edge') !== -1 || browser === 'msie') return false;
  653. return browser.match(/safari|chrome/);
  654. },
  655. // GET THE HORIZONTAL OFFSET OF SLIDER BASED ON THE THU`MBNAIL AND TABS LEFT AND RIGHT SIDE
  656. getHorizontalOffset : function(container,side) {
  657. var thumbloff = gWiderOut(container,'.outer-left'),
  658. thumbroff = gWiderOut(container,'.outer-right');
  659. switch (side) {
  660. case "left":
  661. return thumbloff;
  662. break;
  663. case "right":
  664. return thumbroff;
  665. break;
  666. case "both":
  667. return thumbloff+thumbroff;
  668. break;
  669. }
  670. },
  671. // - CALLING THE NEW SLIDE - //
  672. callingNewSlide : function(container,direction) {
  673. var aindex = container.find('.next-revslide').length>0 ? container.find('.next-revslide').index() : container.find('.processing-revslide').length>0 ? container.find('.processing-revslide').index() : container.find('.active-revslide').index(),
  674. nindex = 0,
  675. opt = container[0].opt;
  676. container.find('.next-revslide').removeClass("next-revslide");
  677. // IF WE ARE ON AN INVISIBLE SLIDE CURRENTLY
  678. if (container.find('.active-revslide').hasClass("tp-invisible-slide"))
  679. aindex = opt.last_shown_slide;
  680. // SET NEXT DIRECTION
  681. if (direction && jQuery.isNumeric(direction) || direction.match(/to/g)) {
  682. if (direction===1 || direction === -1) {
  683. nindex = aindex + direction;
  684. nindex = nindex<0 ? opt.slideamount-1 : nindex>=opt.slideamount ? 0 : nindex;
  685. } else {
  686. direction=jQuery.isNumeric(direction) ? direction : parseInt(direction.split("to")[1],0);
  687. nindex = direction<0 ? 0 : direction>opt.slideamount-1 ? opt.slideamount-1 : direction;
  688. }
  689. container.find('.tp-revslider-slidesli:eq('+nindex+')').addClass("next-revslide");
  690. } else
  691. if (direction) {
  692. container.find('.tp-revslider-slidesli').each(function() {
  693. var li=jQuery(this);
  694. if (li.data('index')===direction) li.addClass("next-revslide");
  695. })
  696. }
  697. nindex = container.find('.next-revslide').index();
  698. container.trigger("revolution.nextslide.waiting");
  699. if ((aindex===nindex && aindex === opt.last_shown_slide) || (nindex !== aindex && nindex!=-1))
  700. swapSlide(container);
  701. else
  702. container.find('.next-revslide').removeClass("next-revslide");
  703. },
  704. slotSize : function(img,opt) {
  705. opt.slotw=Math.ceil(opt.width/opt.slots);
  706. if (opt.sliderLayout=="fullscreen")
  707. opt.sloth=Math.ceil(jQuery(window).height()/opt.slots);
  708. else
  709. opt.sloth=Math.ceil(opt.height/opt.slots);
  710. if (opt.autoHeight=="on" && img!==undefined && img!=="")
  711. opt.sloth=Math.ceil(img.height()/opt.slots);
  712. },
  713. setSize : function(opt) {
  714. var ofh = (opt.top_outer || 0) + (opt.bottom_outer || 0),
  715. cpt = parseInt((opt.carousel.padding_top||0),0),
  716. cpb = parseInt((opt.carousel.padding_bottom||0),0),
  717. maxhei = opt.gridheight[opt.curWinRange],
  718. __mh = 0,
  719. _actli = opt.nextSlide === -1 || opt.nextSlide===undefined ? 0 : opt.nextSlide;
  720. opt.paddings = opt.paddings === undefined ? {top:(parseInt(opt.c.parent().css("paddingTop"),0) || 0), bottom:(parseInt(opt.c.parent().css("paddingBottom"),0) || 0)} : opt.paddings;
  721. if (opt.rowzones && opt.rowzones.length>0)
  722. for (var a=0;a<opt.rowzones[_actli].length;a++) {
  723. __mh = __mh + opt.rowzones[_actli][a][0].offsetHeight;
  724. }
  725. maxhei = maxhei<opt.minHeight ? opt.minHeight : maxhei;
  726. maxhei = maxhei<__mh ? __mh : maxhei;
  727. if (opt.sliderLayout=="fullwidth" && opt.autoHeight=="off") punchgs.TweenLite.set(opt.c,{maxHeight:maxhei+"px"});
  728. opt.c.css({marginTop:cpt,marginBottom:cpb});
  729. opt.width=opt.ul.width();
  730. opt.height=opt.ul.height();
  731. setScale(opt);
  732. opt.height = Math.round(opt.gridheight[opt.curWinRange] * (opt.width/opt.gridwidth[opt.curWinRange]));
  733. if (opt.height>opt.gridheight[opt.curWinRange] && opt.autoHeight!="on") opt.height=opt.gridheight[opt.curWinRange];
  734. if (opt.sliderLayout=="fullscreen" || opt.infullscreenmode) {
  735. opt.height = opt.bw * opt.gridheight[opt.curWinRange];
  736. var cow = opt.c.parent().width();
  737. var coh = jQuery(window).height();
  738. if (opt.fullScreenOffsetContainer!=undefined) {
  739. try{
  740. var offcontainers = opt.fullScreenOffsetContainer.split(",");
  741. if (offcontainers)
  742. jQuery.each(offcontainers,function(index,searchedcont) {
  743. coh = jQuery(searchedcont).length>0 ? coh - jQuery(searchedcont).outerHeight(true) : coh;
  744. });
  745. } catch(e) {}
  746. try{
  747. if (opt.fullScreenOffset.split("%").length>1 && opt.fullScreenOffset!=undefined && opt.fullScreenOffset.length>0)
  748. coh = coh - (jQuery(window).height()* parseInt(opt.fullScreenOffset,0)/100);
  749. else
  750. if (opt.fullScreenOffset!=undefined && opt.fullScreenOffset.length>0)
  751. coh = coh - parseInt(opt.fullScreenOffset,0);
  752. } catch(e) {}
  753. }
  754. coh = coh<opt.minHeight ? opt.minHeight : coh;
  755. coh = coh - ofh;
  756. opt.c.parent().height(coh);
  757. opt.c.closest('.rev_slider_wrapper').height(coh);
  758. opt.c.css({'height':'100%'});
  759. opt.height=coh;
  760. if (opt.minHeight!=undefined && opt.height<opt.minHeight)
  761. opt.height = opt.minHeight;
  762. opt.height = parseInt(__mh,0)>parseInt(opt.height,0) ? __mh : opt.height;
  763. } else {
  764. if (opt.minHeight!=undefined && opt.height<opt.minHeight)
  765. opt.height = opt.minHeight;
  766. opt.height = parseInt(__mh,0)>parseInt(opt.height,0) ? __mh : opt.height;
  767. opt.c.height(opt.height);
  768. }
  769. var si = { height:(cpt+cpb+ofh+opt.height+opt.paddings.top+opt.paddings.bottom)};
  770. opt.c.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').css(si);
  771. opt.c.closest('.rev_slider_wrapper').css(si);
  772. setScale(opt);
  773. },
  774. enterInViewPort : function(opt) {
  775. // START COUNTER IF VP ENTERED, AND COUNTDOWN WAS NOT ON YET
  776. if (opt.waitForCountDown) {
  777. countDown(opt.c,opt);
  778. opt.waitForCountDown=false;
  779. }
  780. // START FIRST SLIDE IF NOT YET STARTED AND VP ENTERED
  781. if (opt.waitForFirstSlide) {
  782. swapSlide(opt.c);
  783. opt.waitForFirstSlide=false;
  784. setTimeout(function() {
  785. opt.c.removeClass("tp-waitforfirststart");
  786. },500);
  787. }
  788. if (opt.sliderlaststatus == "playing" || opt.sliderlaststatus==undefined) {
  789. opt.c.trigger("starttimer");
  790. }
  791. if (opt.lastplayedvideos != undefined && opt.lastplayedvideos.length>0) {
  792. jQuery.each(opt.lastplayedvideos,function(i,_nc) {
  793. _R.playVideo(_nc,opt);
  794. });
  795. }
  796. },
  797. leaveViewPort : function(opt) {
  798. opt.sliderlaststatus = opt.sliderstatus;
  799. opt.c.trigger("stoptimer");
  800. if (opt.playingvideos != undefined && opt.playingvideos.length>0) {
  801. opt.lastplayedvideos = jQuery.extend(true,[],opt.playingvideos);
  802. if (opt.playingvideos)
  803. jQuery.each(opt.playingvideos,function(i,_nc) {
  804. opt.leaveViewPortBasedStop = true;
  805. if (_R.stopVideo) _R.stopVideo(_nc,opt);
  806. });
  807. }
  808. },
  809. unToggleState : function(a) {
  810. if (a!=undefined && a.length>0)
  811. jQuery.each(a,function(i,layer) {
  812. layer.removeClass("rs-toggle-content-active");
  813. });
  814. },
  815. toggleState : function(a) {
  816. if (a!=undefined && a.length>0)
  817. jQuery.each(a,function(i,layer) {
  818. layer.addClass("rs-toggle-content-active");
  819. });
  820. },
  821. swaptoggleState : function(a) {
  822. if (a!=undefined && a.length>0)
  823. jQuery.each(a,function(i,layer) {
  824. if (jQuery(layer).hasClass("rs-toggle-content-active"))
  825. jQuery(layer).removeClass("rs-toggle-content-active");
  826. else
  827. jQuery(layer).addClass("rs-toggle-content-active");
  828. });
  829. },
  830. lastToggleState : function(a) {
  831. var state = 0;
  832. if (a!=undefined && a.length>0)
  833. jQuery.each(a,function(i,layer) {
  834. state = layer.hasClass("rs-toggle-content-active");
  835. });
  836. return state;
  837. }
  838. });
  839. var _ISM = _R.is_mobile(),
  840. _ANDROID = _R.is_android();
  841. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  842. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  843. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  844. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  845. var checkIDS = function(opt,item) {
  846. opt.anyid = opt.anyid === undefined ? [] : opt.anyid;
  847. var ind = jQuery.inArray(item.attr('id'),opt.anyid);
  848. if (ind!=-1) {
  849. var newid = item.attr('id')+"_"+Math.round(Math.random()*9999);
  850. item.attr('id',newid);
  851. }
  852. opt.anyid.push(item.attr('id'));
  853. }
  854. var removeArray = function(arr,i) {
  855. var newarr = [];
  856. jQuery.each(arr,function(a,b) {
  857. if (a!=i) newarr.push(b);
  858. })
  859. return newarr;
  860. }
  861. var removeNavWithLiref = function(a,ref,opt) {
  862. opt.c.find(a).each(function() {
  863. var a = jQuery(this);
  864. if (a.data('liref')===ref)
  865. a.remove();
  866. })
  867. }
  868. var lAjax = function(s,o) {
  869. if (jQuery('body').data(s)) return false;
  870. if (o.filesystem) {
  871. if (o.errorm===undefined)
  872. o.errorm = "<br>Local Filesystem Detected !<br>Put this to your header:";
  873. console.warn('Local Filesystem detected !');
  874. o.errorm = o.errorm+'<br>&lt;script type="text/javascript" src="'+o.jsFileLocation+s+o.extensions_suffix+'"&gt;&lt;/script&gt;';
  875. console.warn(o.jsFileLocation+s+o.extensions_suffix+' could not be loaded !');
  876. console.warn('Please use a local Server or work online or make sure that you load all needed Libraries manually in your Document.');
  877. console.log(" ");
  878. o.modulesfailing = true;
  879. return false;
  880. }
  881. jQuery.ajax({
  882. url:o.jsFileLocation+s+o.extensions_suffix+'?version='+version.core,
  883. 'dataType':'script',
  884. 'cache':true,
  885. "error":function(e) {
  886. console.warn("Slider Revolution 5.0 Error !")
  887. console.error("Failure at Loading:"+s+o.extensions_suffix+" on Path:"+o.jsFileLocation)
  888. console.info(e);
  889. }
  890. });
  891. jQuery('body').data(s,true);
  892. }
  893. var getNeededScripts = function(o,c) {
  894. var n = new Object(),
  895. _n = o.navigation;
  896. n.kenburns = false;
  897. n.parallax = false;
  898. n.carousel = false;
  899. n.navigation = false;
  900. n.videos = false;
  901. n.actions = false;
  902. n.layeranim = false;
  903. n.migration = false;
  904. // MIGRATION EXTENSION
  905. if (!c.data('version') || !c.data('version').toString().match(/5./gi)) {
  906. n.kenburns = true;
  907. n.parallax = true;
  908. n.carousel = false;
  909. n.navigation = true;
  910. n.videos = true;
  911. n.actions = true;
  912. n.layeranim = true;
  913. n.migration = true;
  914. }
  915. else {
  916. // KEN BURN MODUL
  917. c.find('img').each(function(){
  918. if (jQuery(this).data('kenburns')=="on") n.kenburns = true;
  919. });
  920. // NAVIGATION EXTENSTION
  921. if (o.sliderType =="carousel" || _n.keyboardNavigation=="on" || _n.mouseScrollNavigation=="on" || _n.touch.touchenabled=="on" || _n.arrows.enable || _n.bullets.enable || _n.thumbnails.enable || _n.tabs.enable )
  922. n.navigation = true;
  923. // LAYERANIM, VIDEOS, ACTIONS EXTENSIONS
  924. c.find('.tp-caption, .tp-static-layer, .rs-background-video-layer').each(function(){
  925. var _nc = jQuery(this);
  926. if ((_nc.data('ytid')!=undefined || _nc.find('iframe').length>0 && _nc.find('iframe').attr('src').toLowerCase().indexOf('youtube')>0))
  927. n.videos = true;
  928. if ((_nc.data('vimeoid')!=undefined || _nc.find('iframe').length>0 && _nc.find('iframe').attr('src').toLowerCase().indexOf('vimeo')>0))
  929. n.videos = true;
  930. if (_nc.data('actions')!==undefined)
  931. n.actions = true;
  932. n.layeranim = true;
  933. });
  934. c.find('li').each(function() {
  935. if (jQuery(this).data('link') && jQuery(this).data('link')!=undefined) {
  936. n.layeranim = true;
  937. n.actions = true;
  938. }
  939. })
  940. // VIDEO EXTENSION
  941. if (!n.videos && (c.find('.rs-background-video-layer').length>0 || c.find(".tp-videolayer").length>0 || c.find(".tp-audiolayer").length>0 || c.find('iframe').length>0 || c.find('video').length>0))
  942. n.videos = true;
  943. // VIDEO EXTENSION
  944. if (o.sliderType =="carousel")
  945. n.carousel = true;
  946. if (o.parallax.type!=="off" || o.viewPort.enable || o.viewPort.enable=="true" || o.scrolleffect.on==="true" || o.scrolleffect.on)
  947. n.parallax = true;
  948. }
  949. if (o.sliderType=="hero") {
  950. n.carousel = false;
  951. n.navigation = false;
  952. }
  953. if (window.location.href.match(/file:/gi)) {
  954. n.filesystem = true;
  955. o.filesystem = true;
  956. }
  957. // LOAD THE NEEDED LIBRARIES
  958. if (n.videos && typeof _R.isVideoPlaying=='undefined') lAjax('revolution.extension.video',o);
  959. if (n.carousel && typeof _R.prepareCarousel=='undefined') lAjax('revolution.extension.carousel',o);
  960. if (!n.carousel && typeof _R.animateSlide=='undefined') lAjax('revolution.extension.slideanims',o);
  961. if (n.actions && typeof _R.checkActions=='undefined') lAjax('revolution.extension.actions',o);
  962. if (n.layeranim && typeof _R.handleStaticLayers=='undefined') lAjax('revolution.extension.layeranimation',o);
  963. if (n.kenburns && typeof _R.stopKenBurn=='undefined') lAjax('revolution.extension.kenburn',o);
  964. if (n.navigation && typeof _R.createNavigation=='undefined') lAjax('revolution.extension.navigation',o);
  965. if (n.migration && typeof _R.migration=='undefined') lAjax('revolution.extension.migration',o);
  966. if (n.parallax && typeof _R.checkForParallax=='undefined') lAjax('revolution.extension.parallax',o);
  967. if (o.addons!=undefined && o.addons.length>0) {
  968. jQuery.each(o.addons, function(i,obj) {
  969. if (typeof obj === "object" && obj.fileprefix!=undefined)
  970. lAjax(obj.fileprefix,o);
  971. })
  972. }
  973. return n;
  974. }
  975. ///////////////////////////////////
  976. // - WAIT FOR SCRIPT LOADS - //
  977. ///////////////////////////////////
  978. var waitForScripts = function(c,o) {
  979. // CHECK KEN BURN DEPENDENCIES
  980. var addonsloaded = true,
  981. n = o.scriptsneeded;
  982. // CHECK FOR ADDONS
  983. if (o.addons!=undefined && o.addons.length>0) {
  984. jQuery.each(o.addons, function(i,obj) {
  985. if (typeof obj === "object" && obj.init!=undefined) {
  986. if (_R[obj.init]===undefined) addonsloaded = false;
  987. }
  988. })
  989. }
  990. if (n.filesystem ||
  991. (typeof punchgs !== 'undefined' &&
  992. (addonsloaded) &&
  993. (!n.kenburns || (n.kenburns && typeof _R.stopKenBurn !== 'undefined')) &&
  994. (!n.navigation || (n.navigation && typeof _R.createNavigation !== 'undefined')) &&
  995. (!n.carousel || (n.carousel && typeof _R.prepareCarousel !== 'undefined')) &&
  996. (!n.videos || (n.videos && typeof _R.resetVideo !== 'undefined')) &&
  997. (!n.actions || (n.actions && typeof _R.checkActions !== 'undefined')) &&
  998. (!n.layeranim || (n.layeranim && typeof _R.handleStaticLayers !== 'undefined')) &&
  999. (!n.migration || (n.migration && typeof _R.migration !== 'undefined')) &&
  1000. (!n.parallax || (n.parallax && typeof _R.checkForParallax !== 'undefined')) &&
  1001. (n.carousel || (!n.carousel && typeof _R.animateSlide !== 'undefined'))
  1002. ))
  1003. c.trigger("scriptsloaded");
  1004. else
  1005. setTimeout(function() {
  1006. waitForScripts(c,o);
  1007. },50);
  1008. }
  1009. //////////////////////////////////
  1010. // - GET SCRIPT LOCATION - //
  1011. //////////////////////////////////
  1012. var getScriptLocation = function(a) {
  1013. var srcexp = new RegExp("themepunch.revolution.min.js","gi"),
  1014. ret = "";
  1015. jQuery("script").each(function() {
  1016. var src = jQuery(this).attr("src");
  1017. if (src && src.match(srcexp))
  1018. ret = src;
  1019. });
  1020. ret = ret.replace('jquery.themepunch.revolution.min.js', '');
  1021. ret = ret.replace('jquery.themepunch.revolution.js', '');
  1022. ret = ret.split("?")[0];
  1023. return ret;
  1024. }
  1025. //////////////////////////////////////////
  1026. // - ADVANCED RESPONSIVE LEVELS - //
  1027. //////////////////////////////////////////
  1028. var setCurWinRange = function(opt,vis) {
  1029. var curlevel = 0,
  1030. curwidth = 9999,
  1031. lastmaxlevel = 0,
  1032. lastmaxid = 0,
  1033. curid = 0,
  1034. winw = jQuery(window).width(),
  1035. l = vis && opt.responsiveLevels==9999 ? opt.visibilityLevels : opt.responsiveLevels;
  1036. if (l && l.length)
  1037. jQuery.each(l,function(index,level) {
  1038. if (winw<level) {
  1039. if (lastmaxlevel==0 || lastmaxlevel>level) {
  1040. curwidth = level;
  1041. curid = index;
  1042. lastmaxlevel = level;
  1043. }
  1044. }
  1045. if (winw>level && lastmaxlevel<level) {
  1046. lastmaxlevel = level;
  1047. lastmaxid = index;
  1048. }
  1049. });
  1050. if (lastmaxlevel<curwidth)
  1051. curid = lastmaxid;
  1052. if (!vis)
  1053. opt.curWinRange = curid;
  1054. else
  1055. opt.forcedWinRange = curid;
  1056. }
  1057. //////////////////////////////////////////
  1058. // - INITIALISATION OF OPTIONS - //
  1059. //////////////////////////////////////////
  1060. var prepareOptions = function(container,opt) {
  1061. opt.carousel.maxVisibleItems = opt.carousel.maxVisibleItems < 1 ? 999 : opt.carousel.maxVisibleItems; // === 1 ? 2 : opt.carousel.maxVisibleItems;
  1062. opt.carousel.vertical_align = opt.carousel.vertical_align === "top" ? "0%" : opt.carousel.vertical_align==="bottom" ? "100%" : "50%";
  1063. }
  1064. var gWiderOut = function(c,cl) {
  1065. var r = 0;
  1066. c.find(cl).each(function() {
  1067. var a = jQuery(this);
  1068. if (!a.hasClass("tp-forcenotvisible") && r<a.outerWidth())
  1069. r = a.outerWidth();
  1070. });
  1071. return r;
  1072. }
  1073. //////////////////////////////////////////
  1074. // - INITIALISATION OF SLIDER - //
  1075. //////////////////////////////////////////
  1076. var initSlider = function (container,opt) {
  1077. if (container==undefined) return false;
  1078. // CHECK FOR ALTERNATIVE IMAGE, AND IFRAM EXIST, AND WE ARE IN IE8, MOBILE, DRAW IT SIMPLE
  1079. if (container.data('aimg')!=undefined)
  1080. if ((container.data('aie8')=="enabled" && _R.isIE(8)) || (container.data('amobile')=="enabled" && _ISM))
  1081. container.html('<img class="tp-slider-alternative-image" src="'+container.data("aimg")+'">');
  1082. // PREPRARE SOME CLASSES AND VARIABLES
  1083. container.find('>ul').addClass("tp-revslider-mainul");
  1084. // CREATE SOME DEFAULT OPTIONS FOR LATER
  1085. opt.c=container;
  1086. opt.ul = container.find('.tp-revslider-mainul');
  1087. // Remove Not Needed Slides for Mobile Devices
  1088. opt.ul.find('>li').each(function(i) {
  1089. var li = jQuery(this);
  1090. if (li.data('hideslideonmobile')=="on" && _ISM) li.remove();
  1091. if (li.data('invisible') || li.data('invisible')===true) {
  1092. li.addClass("tp-invisible-slide");
  1093. li.appendTo(opt.ul);
  1094. }
  1095. });
  1096. if (opt.addons!=undefined && opt.addons.length>0) {
  1097. jQuery.each(opt.addons, function(i,obj) {
  1098. if (typeof obj === "object" && obj.init!=undefined) {
  1099. _R[obj.init](eval(obj.params));
  1100. }
  1101. })
  1102. }
  1103. opt.cid = container.attr('id');
  1104. opt.ul.css({visibility:"visible"});
  1105. opt.slideamount = opt.ul.find('>li').not('.tp-invisible-slide').length;
  1106. opt.realslideamount = opt.ul.find('>li').length;
  1107. opt.slayers = container.find('.tp-static-layers');
  1108. opt.slayers.data('index','staticlayers');
  1109. if (opt.waitForInit == true)
  1110. return;
  1111. else {
  1112. container[0].opt = opt;
  1113. runSlider(container,opt);
  1114. }
  1115. }
  1116. var onFullScreenChange = function() {
  1117. jQuery("body").data('rs-fullScreenMode',!jQuery("body").data('rs-fullScreenMode'));
  1118. if (jQuery("body").data('rs-fullScreenMode')) {
  1119. setTimeout(function() {
  1120. jQuery(window).trigger("resize");
  1121. },200);
  1122. }
  1123. }
  1124. var runSlider = function(container,opt) {
  1125. opt.sliderisrunning = true;
  1126. // Save Original Index of Slides
  1127. opt.ul.find('>li').each(function(i) {
  1128. jQuery(this).data('originalindex',i);
  1129. });
  1130. opt.allli = opt.ul.find('>li');
  1131. // RECORD THUMBS AND SET INDEXES
  1132. jQuery.each(opt.allli,function(index,li) {
  1133. var li = jQuery(li);
  1134. li.data('origindex',li.index());
  1135. });
  1136. opt.li = opt.ul.find('>li').not('.tp-invisible-slide');
  1137. // RANDOMIZE THE SLIDER SHUFFLE MODE
  1138. if (opt.shuffle=="on") {
  1139. var fsa = new Object,
  1140. fli = opt.ul.find('>li:first-child');
  1141. fsa.fstransition = fli.data('fstransition');
  1142. fsa.fsmasterspeed = fli.data('fsmasterspeed');
  1143. fsa.fsslotamount = fli.data('fsslotamount');
  1144. for (var u=0;u<opt.slideamount;u++) {
  1145. var it = Math.round(Math.random()*opt.slideamount);
  1146. opt.ul.find('>li:eq('+it+')').prependTo(opt.ul);
  1147. }
  1148. var newfli = opt.ul.find('>li:first-child');
  1149. newfli.data('fstransition',fsa.fstransition);
  1150. newfli.data('fsmasterspeed',fsa.fsmasterspeed);
  1151. newfli.data('fsslotamount',fsa.fsslotamount);
  1152. // RECOLLECT ALL LI INTO AN ARRAY
  1153. opt.allli = opt.ul.find('>li');
  1154. opt.li = opt.ul.find('>li').not('.tp-invisible-slide');
  1155. }
  1156. opt.inli = opt.ul.find('>li.tp-invisible-slide');
  1157. opt.thumbs = new Array();
  1158. opt.slots=4;
  1159. opt.act=-1;
  1160. opt.firststart=1;
  1161. opt.loadqueue = new Array();
  1162. opt.syncload = 0;
  1163. opt.conw = container.width();
  1164. opt.conh = container.height();
  1165. if (opt.responsiveLevels.length>1)
  1166. opt.responsiveLevels[0] = 9999;
  1167. else
  1168. opt.responsiveLevels = 9999;
  1169. jQuery.each(opt.allli,function(index,li) {
  1170. var li = jQuery(li),
  1171. img = li.find('.rev-slidebg') || li.find('img').first(),
  1172. i = 0;
  1173. li.addClass("tp-revslider-slidesli");
  1174. if (li.data('index')===undefined) li.data('index','rs-'+Math.round(Math.random()*999999));
  1175. var obj = new Object;
  1176. obj.params = new Array();
  1177. obj.id = li.data('index');
  1178. obj.src = li.data('thumb')!==undefined ? li.data('thumb') : img.data('lazyload') !== undefined ? img.data('lazyload') : img.attr('src');
  1179. if (li.data('title') !== undefined) obj.params.push({from:RegExp("\\{\\{title\\}\\}","g"), to:li.data("title")})
  1180. if (li.data('description') !== undefined) obj.params.push({from:RegExp("\\{\\{description\\}\\}","g"), to:li.data("description")})
  1181. for (var i=1;i<=10;i++) {
  1182. if (li.data("param"+i)!==undefined)
  1183. obj.params.push({from:RegExp("\\{\\{param"+i+"\\}\\}","g"), to:li.data("param"+i)})
  1184. }
  1185. opt.thumbs.push(obj);
  1186. // IF LINK ON SLIDE EXISTS, NEED TO CREATE A PROPER LAYER FOR IT.
  1187. if (li.data('link')!=undefined) {
  1188. var link = li.data('link'),
  1189. target= li.data('target') || "_self",
  1190. zindex= li.data('slideindex')==="back" ? 0 : 60,
  1191. linktoslide=li.data('linktoslide'),
  1192. checksl = linktoslide;
  1193. if (linktoslide != undefined)
  1194. if (linktoslide!="next" && linktoslide!="prev")
  1195. opt.allli.each(function() {
  1196. var t = jQuery(this);
  1197. if (t.data('origindex')+1==checksl) linktoslide = t.data('index');
  1198. });
  1199. if (link!="slide") linktoslide="no";
  1200. var apptxt = '<div class="tp-caption slidelink" style="cursor:pointer;width:100%;height:100%;z-index:'+zindex+';" data-x="center" data-y="center" data-basealign="slide" ',
  1201. jts = linktoslide==="scroll_under" ? '[{"event":"click","action":"scrollbelow","offset":"100px","delay":"0"}]' :
  1202. linktoslide==="prev" ? '[{"event":"click","action":"jumptoslide","slide":"prev","delay":"0.2"}]' :
  1203. linktoslide==="next" ? '[{"event":"click","action":"jumptoslide","slide":"next","delay":"0.2"}]' : '[{"event":"click","action":"jumptoslide","slide":"'+linktoslide+'","delay":"0.2"}]',
  1204. frame = ' data-frames=' +"'" + '[{"delay":0,"speed":100,"frame":"0","from":"opacity:0;","to":"o:1;","ease":"Power3.easeInOut"},{"delay":"wait","speed":300,"frame":"999","to":"opacity:0;","ease":"Power3.easeInOut"}]'+"'";
  1205. apptxt = linktoslide=="no" ? apptxt + frame +' >' : apptxt + 'data-actions='+"'"+jts + "'"+frame+' >';
  1206. apptxt = apptxt + '<a style="width:100%;height:100%;display:block"';
  1207. apptxt = link!="slide" ? apptxt + ' target="'+target+'" href="'+link+'"' : apptxt;
  1208. apptxt = apptxt + '><span style="width:100%;height:100%;display:block"></span></a></div>';
  1209. li.append(apptxt);
  1210. }
  1211. });
  1212. // CREATE GRID WIDTH AND HEIGHT ARRAYS
  1213. opt.rle = opt.responsiveLevels.length || 1;
  1214. opt.gridwidth = cArray(opt.gridwidth,opt.rle);
  1215. opt.gridheight = cArray(opt.gridheight,opt.rle);
  1216. // END OF VERSION 5.0 INIT MODIFICATION
  1217. // SIMPLIFY ANIMATIONS ON OLD IOS AND IE8 IF NEEDED
  1218. if (opt.simplifyAll=="on" && (_R.isIE(8) || _R.iOSVersion())) {
  1219. container.find('.tp-caption').each(function() {
  1220. var tc = jQuery(this);
  1221. tc.removeClass("customin customout").addClass("fadein fadeout");
  1222. tc.data('splitin',"");
  1223. tc.data('speed',400);
  1224. })
  1225. opt.allli.each(function() {
  1226. var li= jQuery(this);
  1227. li.data('transition',"fade");
  1228. li.data('masterspeed',500);
  1229. li.data('slotamount',1);
  1230. var img = li.find('.rev-slidebg') || li.find('>img').first();
  1231. img.data('kenburns',"off");
  1232. });
  1233. }
  1234. opt.desktop = !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i);
  1235. // SOME OPTIONS WHICH SHOULD CLOSE OUT SOME OTHER SETTINGS
  1236. opt.autoHeight = opt.sliderLayout=="fullscreen" ? "on" : opt.autoHeight;
  1237. if (opt.sliderLayout=="fullwidth" && opt.autoHeight=="off") container.css({maxHeight:opt.gridheight[opt.curWinRange]+"px"});
  1238. // BUILD A FORCE FULLWIDTH CONTAINER, TO SPAN THE FULL SLIDER TO THE FULL WIDTH OF BROWSER
  1239. if (opt.sliderLayout!="auto" && container.closest('.forcefullwidth_wrapper_tp_banner').length==0) {
  1240. if (opt.sliderLayout!=="fullscreen" || opt.fullScreenAutoWidth!="on") {
  1241. var cp = container.parent(),
  1242. mb = cp.css('marginBottom'),
  1243. mt = cp.css('marginTop'),
  1244. cid = container.attr('id')+"_forcefullwidth";
  1245. mb = mb===undefined ? 0 : mb;
  1246. mt = mt===undefined ? 0 : mt;
  1247. cp.wrap('<div class="forcefullwidth_wrapper_tp_banner" id="'+cid+'" style="position:relative;width:100%;height:auto;margin-top:'+mt+';margin-bottom:'+mb+'"></div>');
  1248. container.closest('.forcefullwidth_wrapper_tp_banner').append('<div class="tp-fullwidth-forcer" style="width:100%;height:'+container.height()+'px"></div>');
  1249. container.parent().css({marginTop:"0px",marginBottom:"0px"});
  1250. //container.css({'backgroundColor':container.parent().css('backgroundColor'),'backgroundImage':container.parent().css('backgroundImage')});
  1251. container.parent().css({position:'absolute'});
  1252. }
  1253. }
  1254. // SHADOW ADD ONS
  1255. if (opt.shadow!==undefined && opt.shadow>0) {
  1256. container.parent().addClass('tp-shadow'+opt.shadow);
  1257. container.parent().append('<div class="tp-shadowcover"></div>');
  1258. container.parent().find('.tp-shadowcover').css({'backgroundColor':container.parent().css('backgroundColor'),'backgroundImage':container.parent().css('backgroundImage')});
  1259. }
  1260. // ESTIMATE THE CURRENT WINDOWS RANGE INDEX
  1261. setCurWinRange(opt);
  1262. setCurWinRange(opt,true);
  1263. // IF THE CONTAINER IS NOT YET INITIALISED, LETS GO FOR IT
  1264. if (!container.hasClass("revslider-initialised")) {
  1265. // MARK THAT THE CONTAINER IS INITIALISED WITH SLIDER REVOLUTION ALREADY
  1266. container.addClass("revslider-initialised");
  1267. // FOR BETTER SELECTION, ADD SOME BASIC CLASS
  1268. container.addClass("tp-simpleresponsive");
  1269. // WE DONT HAVE ANY ID YET ? WE NEED ONE ! LETS GIVE ONE RANDOMLY FOR RUNTIME
  1270. if (container.attr('id')==undefined) {
  1271. container.attr('id',"revslider-"+Math.round(Math.random()*1000+5));
  1272. }
  1273. checkIDS(opt,container);
  1274. // CHECK IF FIREFOX 13 IS ON WAY.. IT HAS A STRANGE BUG, CSS ANIMATE SHOULD NOT BE USED
  1275. opt.firefox13 = false;
  1276. opt.ie = !jQuery.support.opacity;
  1277. opt.ie9 = (document.documentMode == 9);
  1278. opt.origcd=opt.delay;
  1279. // CHECK THE jQUERY VERSION
  1280. var version = jQuery.fn.jquery.split('.'),
  1281. versionTop = parseFloat(version[0]),
  1282. versionMinor = parseFloat(version[1]),
  1283. versionIncrement = parseFloat(version[2] || '0');
  1284. if (versionTop==1 && versionMinor < 7)
  1285. container.html('<div style="text-align:center; padding:40px 0px; font-size:20px; color:#992222;"> The Current Version of jQuery:'+version+' <br>Please update your jQuery Version to min. 1.7 in Case you wish to use the Revolution Slider Plugin</div>');
  1286. if (versionTop>1) opt.ie=false;
  1287. // PREPARE VIDEO PLAYERS
  1288. var addedApis = new Object();
  1289. addedApis.addedyt=0;
  1290. addedApis.addedvim=0;
  1291. addedApis.addedvid=0;
  1292. //PREPARING FADE IN/OUT PARALLAX
  1293. if (opt.scrolleffect.on)
  1294. opt.scrolleffect.layers = new Array();
  1295. //WRAP LAYERS INTO 1 CONTAINER TO AVOID FURTHER ISSUES
  1296. /*container.find('.tp-revslider-slidesli').each(function() {
  1297. jQuery(this).find('.tp-caption').wrapAll('<div class="tp-layers-container"></div>');
  1298. });*/
  1299. container.find('.tp-caption, .rs-background-video-layer').each(function(i) {
  1300. var _nc = jQuery(this),
  1301. _ = _nc.data(),
  1302. an = _.autoplayonlyfirsttime,
  1303. ap = _.autoplay,
  1304. htmlvideo = _.videomp4!==undefined || _.videowebm!==undefined || _.videoogv!==undefined,
  1305. al = _nc.hasClass("tp-audiolayer"),
  1306. loop = _.videoloop,
  1307. addtofadeout = true,
  1308. addToStaticFadeout = false;
  1309. _.startclasses = _nc.attr('class');
  1310. _.isparallaxlayer = _.startclasses.indexOf("rs-parallax")>=0;
  1311. if (_nc.hasClass("tp-static-layer") && _R.handleStaticLayers) {
  1312. _R.handleStaticLayers(_nc,opt);
  1313. if (opt.scrolleffect.on)
  1314. if ((opt.scrolleffect.on_parallax_static_layers==="on" && _.isparallaxlayer) || (opt.scrolleffect.on_static_layers==="on" && !_.isparallaxlayer)) addToStaticFadeout = true;
  1315. addtofadeout=false;
  1316. }
  1317. var pom = _nc.data('noposteronmobile') || _nc.data('noPosterOnMobile') || _nc.data('posteronmobile') || _nc.data('posterOnMobile') || _nc.data('posterOnMObile');
  1318. _nc.data('noposteronmobile',pom);
  1319. // FIX VISIBLE IFRAME BUG IN SAFARI
  1320. var iff = 0;
  1321. _nc.find('iframe').each(function() {
  1322. punchgs.TweenLite.set(jQuery(this),{autoAlpha:0});
  1323. iff++;
  1324. })
  1325. if (iff>0)
  1326. _nc.data('iframes',true)
  1327. if (_nc.hasClass("tp-caption")) {
  1328. // PREPARE LAYERS AND WRAP THEM WITH PARALLAX, LOOP, MASK HELP CONTAINERS
  1329. var ec = _nc.hasClass("slidelink") ? "width:100% !important;height:100% !important;" : "",
  1330. _ndata = _nc.data(),
  1331. specec = "",
  1332. nctype = _ndata.type,
  1333. _pos = nctype==="row" || nctype==="column" ? "relative" : "absolute",
  1334. preclas = "";
  1335. if (nctype==="row") {
  1336. _nc.addClass("rev_row").removeClass("tp-resizeme");
  1337. preclas="rev_row_wrap";
  1338. } else
  1339. if (nctype==="column") {
  1340. specec = _ndata.verticalalign === undefined ? " vertical-align:bottom;" : " vertical-align:"+_ndata.verticalalign+";";
  1341. preclas = "rev_column";
  1342. _nc.addClass("rev_column_inner").removeClass("tp-resizeme");;
  1343. _nc.data('width','auto');
  1344. punchgs.TweenLite.set(_nc,{width:'auto'});
  1345. } else
  1346. if (nctype==="group") {
  1347. _nc.removeClass("tp-resizeme")
  1348. }
  1349. var dmode = "",
  1350. preid = "";
  1351. if (nctype!=="row" && nctype!=="group" && nctype!=="column"){
  1352. dmode = "display:"+_nc.css('display')+";";
  1353. if (_nc.closest('.rev_column').length>0) {
  1354. _nc.addClass("rev_layer_in_column");
  1355. addtofadeout=false;
  1356. } else
  1357. if (_nc.closest('.rev_group').length>0) {
  1358. _nc.addClass("rev_layer_in_group");
  1359. addtofadeout=false;
  1360. }
  1361. } else
  1362. if (nctype==="column") addtofadeout = false;
  1363. if (_ndata.wrapper_class!==undefined) preclas = preclas+" "+_ndata.wrapper_class;
  1364. if (_ndata.wrapper_id!==undefined) preid ='id="'+_ndata.wrapper_id+'"';
  1365. // POINTER EVENTS ADDITION
  1366. var pevents = '';
  1367. if(_nc.hasClass('tp-no-events')) pevents = ';pointer-events:none';
  1368. _nc.wrap('<div '+preid+' class="tp-parallax-wrap '+preclas+'" style="'+specec+' '+ec+'position:'+_pos+';'+dmode+';visibility:hidden'+pevents+'"><div class="tp-loop-wrap" style="'+ec+'position:'+_pos+';'+dmode+';"><div class="tp-mask-wrap" style="'+ec+'position:'+_pos+';'+dmode+';" ></div></div></div>');
  1369. // ONLY ADD LAYERS TO FADEOUT DYNAMIC LIST WHC
  1370. if (addtofadeout && opt.scrolleffect.on)
  1371. if ((opt.scrolleffect.on_parallax_layers==="on" && _.isparallaxlayer) || (opt.scrolleffect.on_layers==="on" && !_.isparallaxlayer))
  1372. opt.scrolleffect.layers.push(_nc.parent());
  1373. if (addToStaticFadeout) opt.scrolleffect.layers.push(_nc.parent());
  1374. // Add BG for Columns
  1375. if (nctype==="column") {
  1376. _nc.append('<div class="rev_column_bg rev_column_bg_man_sized" style="visibility:hidden"></div>');
  1377. _nc.closest('.tp-parallax-wrap').append('<div class="rev_column_bg rev_column_bg_auto_sized"></div>');
  1378. }
  1379. var lar = ['pendulum', 'rotate','slideloop','pulse','wave'],
  1380. _lc = _nc.closest('.tp-loop-wrap');
  1381. jQuery.each(lar,function(i,k) {
  1382. var lw = _nc.find('.rs-'+k),
  1383. f = lw.data() || "";
  1384. if (f!="") {
  1385. _lc.data(f);
  1386. _lc.addClass("rs-"+k);
  1387. lw.children(0).unwrap();
  1388. _nc.data('loopanimation',"on");
  1389. }
  1390. });
  1391. if (_nc.attr('id')===undefined)
  1392. _nc.attr('id','layer-'+Math.round(Math.random()*999999999));
  1393. checkIDS(opt,_nc);
  1394. punchgs.TweenLite.set(_nc,{visibility:"hidden"});
  1395. }
  1396. var as = _nc.data('actions');
  1397. if (as!==undefined) _R.checkActions(_nc,opt,as);
  1398. checkHoverDependencies(_nc,opt);
  1399. if (_R.checkVideoApis)
  1400. addedApis = _R.checkVideoApis(_nc,opt,addedApis);
  1401. // REMOVE VIDEO AUTOPLAYS FOR MOBILE DEVICES
  1402. /*
  1403. if (_ISM && (!opt.fallbacks.allowHTML5AutoPlayOnAndroid || !htmlvideo)) {
  1404. if (an == true || an=="true") {
  1405. _.autoplayonlyfirsttime=false;
  1406. an=false;
  1407. }
  1408. if (ap==true || ap=="true" || ap=="on" || ap=="1sttime") {
  1409. _.autoplay="off";
  1410. ap="off";
  1411. }
  1412. }
  1413. */
  1414. //loop = loop=="none" && _nc.hasClass('rs-background-video-layer') ? "loopandnoslidestop" : loop;
  1415. // PREPARE TIMER BEHAVIOUR BASED ON AUTO PLAYED VIDEOS IN SLIDES
  1416. if (!al && (an == true || an=="true" || ap == "1sttime") && loop !="loopandnoslidestop")
  1417. _nc.closest('li.tp-revslider-slidesli').addClass("rs-pause-timer-once");
  1418. if (!al && (ap==true || ap=="true" || ap == "on" || ap == "no1sttime") && loop !="loopandnoslidestop")
  1419. _nc.closest('li.tp-revslider-slidesli').addClass("rs-pause-timer-always");
  1420. });
  1421. container[0].addEventListener('mouseenter',function() {
  1422. container.trigger('tp-mouseenter');
  1423. opt.overcontainer=true;
  1424. },{passive:true});
  1425. container[0].addEventListener('mouseover',function() {
  1426. container.trigger('tp-mouseover');
  1427. opt.overcontainer=true;
  1428. },{passive:true});
  1429. container[0].addEventListener('mouseleave',function() {
  1430. container.trigger('tp-mouseleft');
  1431. opt.overcontainer=false;
  1432. },{passive:true});
  1433. // REMOVE ANY VIDEO JS SETTINGS OF THE VIDEO IF NEEDED (OLD FALL BACK, AND HELP FOR 3THD PARTY PLUGIN CONFLICTS)
  1434. container.find('.tp-caption video').each(function(i) {
  1435. var v = jQuery(this);
  1436. v.removeClass("video-js vjs-default-skin");
  1437. v.attr("preload","");
  1438. v.css({display:"none"});
  1439. });
  1440. //PREPARE LOADINGS ALL IN SEQUENCE
  1441. if (opt.sliderType!=="standard") opt.lazyType = "all";
  1442. // PRELOAD STATIC LAYERS
  1443. loadImages(container.find('.tp-static-layers'),opt,0,true);
  1444. waitForCurrentImages(container.find('.tp-static-layers'),opt,function() {
  1445. container.find('.tp-static-layers img').each(function() {
  1446. var e = jQuery(this),
  1447. src = e.data('lazyload') != undefined ? e.data('lazyload') : e.attr('src'),
  1448. loadobj = getLoadObj(opt,src);
  1449. e.attr('src',loadobj.src)
  1450. })
  1451. });
  1452. opt.rowzones = [];
  1453. // SET ALL LI AN INDEX AND INIT LAZY LOADING
  1454. opt.allli.each(function(i) {
  1455. var li = jQuery(this);
  1456. punchgs.TweenLite.set(this,{perspective:6000}); //PERSPECTIVE
  1457. opt.rowzones[i] = [];
  1458. li.find('.rev_row_zone').each(function() {
  1459. opt.rowzones[i].push(jQuery(this));
  1460. })
  1461. if (opt.lazyType=="all" || (opt.lazyType=="smart" && (i==0 || i == 1 || i == opt.slideamount || i == opt.slideamount-1))) {
  1462. loadImages(li,opt,i);
  1463. waitForCurrentImages(li,opt,function() {
  1464. //if (opt.sliderType=="carousel")
  1465. //punchgs.TweenLite.to(li,1,{autoAlpha:1,ease:punchgs.Power3.easeInOut});
  1466. });
  1467. }
  1468. });
  1469. // IF DEEPLINK HAS BEEN SET
  1470. var deeplink = getUrlVars("#")[0];
  1471. if (deeplink.length<9) {
  1472. if (deeplink.split('slide').length>1) {
  1473. var dslide=parseInt(deeplink.split('slide')[1],0);
  1474. if (dslide<1) dslide=1;
  1475. if (dslide>opt.slideamount) dslide=opt.slideamount;
  1476. opt.startWithSlide=dslide-1;
  1477. }
  1478. }
  1479. // PREPARE THE SPINNER
  1480. container.append( '<div class="tp-loader '+opt.spinner+'">'+
  1481. '<div class="dot1"></div>'+
  1482. '<div class="dot2"></div>'+
  1483. '<div class="bounce1"></div>'+
  1484. '<div class="bounce2"></div>'+
  1485. '<div class="bounce3"></div>'+
  1486. '</div>');
  1487. opt.loader = container.find('.tp-loader');
  1488. // RESET THE TIMER
  1489. if (container.find('.tp-bannertimer').length===0) container.append('<div class="tp-bannertimer" style="visibility:hidden"></div>');
  1490. container.find('.tp-bannertimer').css({'width':'0%'});
  1491. // PREPARE THE SLIDES
  1492. opt.ul.css({'display':'block'});
  1493. prepareSlides(container,opt);
  1494. if ((opt.parallax.type!=="off" || opt.scrolleffect.on) && _R.checkForParallax) _R.checkForParallax(container,opt);
  1495. // PREPARE SLIDER SIZE
  1496. _R.setSize(opt);
  1497. // Call the Navigation Builder
  1498. if (opt.sliderType!=="hero" && _R.createNavigation) _R.createNavigation(container,opt);
  1499. if (_R.resizeThumbsTabs && _R.resizeThumbsTabs) _R.resizeThumbsTabs(opt);
  1500. contWidthManager(opt);
  1501. var _v = opt.viewPort;
  1502. opt.inviewport = false;
  1503. if (_v !=undefined && _v.enable) {
  1504. if (!jQuery.isNumeric(_v.visible_area))
  1505. if (_v.visible_area.indexOf('%')!==-1)
  1506. _v.visible_area = parseInt(_v.visible_area)/100;
  1507. if (_R.scrollTicker) _R.scrollTicker(opt,container);
  1508. }
  1509. // MAKE SURE CAROUSEL IS NOT YET VISIBE BEFORE IT COMES INTO GAME
  1510. if (opt.sliderType==="carousel" && _R.prepareCarousel) {
  1511. punchgs.TweenLite.set(opt.ul,{opacity:0});
  1512. _R.prepareCarousel(opt,new punchgs.TimelineLite,undefined,0);
  1513. opt.onlyPreparedSlide = true;
  1514. }
  1515. // START THE SLIDER
  1516. setTimeout(function() {
  1517. if (!_v.enable || (_v.enable && opt.inviewport) || (_v.enable && !opt.inviewport && !_v.outof=="wait"))
  1518. swapSlide(container);
  1519. else {
  1520. opt.c.addClass("tp-waitforfirststart");
  1521. opt.waitForFirstSlide = true;
  1522. if (_v.presize) {
  1523. var nextli = jQuery(opt.li[0]);
  1524. // PRELOAD STATIC LAYERS
  1525. loadImages(nextli,opt,0,true);
  1526. waitForCurrentImages(nextli.find('.tp-layers'),opt,function() {
  1527. _R.animateTheCaptions({slide:nextli,opt:opt, preset:true});
  1528. })
  1529. }
  1530. }
  1531. if (_R.manageNavigation) _R.manageNavigation(opt);
  1532. // START COUNTDOWN
  1533. if (opt.slideamount>1) {
  1534. if (!_v.enable || (_v.enable && opt.inviewport))
  1535. countDown(container,opt);
  1536. else
  1537. opt.waitForCountDown = true;
  1538. }
  1539. setTimeout(function() {
  1540. container.trigger('revolution.slide.onloaded');
  1541. },100);
  1542. },opt.startDelay);
  1543. opt.startDelay=0;
  1544. /******************************
  1545. - FULLSCREEN CHANGE -
  1546. ********************************/
  1547. // FULLSCREEN MODE TESTING
  1548. jQuery("body").data('rs-fullScreenMode',false);
  1549. window.addEventListener('fullscreenchange',onFullScreenChange,{passive:true});
  1550. window.addEventListener('mozfullscreenchange',onFullScreenChange,{passive:true});
  1551. window.addEventListener('webkitfullscreenchange',onFullScreenChange,{passive:true});
  1552. var resizid = "resize.revslider-"+container.attr('id');
  1553. // IF RESIZED, NEED TO STOP ACTUAL TRANSITION AND RESIZE ACTUAL IMAGES
  1554. jQuery(window).on(resizid,function() {
  1555. if (container==undefined) return false;
  1556. if (jQuery('body').find(container)!=0)
  1557. contWidthManager(opt);
  1558. var hchange = false;
  1559. if (opt.sliderLayout=="fullscreen") {
  1560. var jwh = jQuery(window).height();
  1561. if ((opt.fallbacks.ignoreHeightChanges=="mobile" && _ISM) || opt.fallbacks.ignoreHeightChanges=="always") {
  1562. opt.fallbacks.ignoreHeightChangesSize = opt.fallbacks.ignoreHeightChangesSize == undefined ? 0 : opt.fallbacks.ignoreHeightChangesSize;
  1563. hchange = (jwh!=opt.lastwindowheight) && (Math.abs(jwh-opt.lastwindowheight) > opt.fallbacks.ignoreHeightChangesSize)
  1564. } else {
  1565. hchange = (jwh!=opt.lastwindowheight)
  1566. }
  1567. }
  1568. if (container.outerWidth(true)!=opt.width || container.is(":hidden") || (hchange)) {
  1569. opt.lastwindowheight = jQuery(window).height();
  1570. containerResized(container,opt);
  1571. }
  1572. });
  1573. hideSliderUnder(container,opt);
  1574. contWidthManager(opt);
  1575. if (!opt.fallbacks.disableFocusListener && opt.fallbacks.disableFocusListener != "true" && opt.fallbacks.disableFocusListener !== true) {
  1576. container.addClass("rev_redraw_on_blurfocus");
  1577. tabBlurringCheck();
  1578. }
  1579. }
  1580. }
  1581. /*************************************
  1582. - CREATE SIMPLE ARRAYS -
  1583. **************************************/
  1584. var cArray = function(b,l) {
  1585. if (!jQuery.isArray(b)) {
  1586. var t = b;
  1587. b = new Array();
  1588. b.push(t);
  1589. }
  1590. if (b.length<l) {
  1591. var t = b[b.length-1];
  1592. for (var i=0;i<(l-b.length)+2;i++)
  1593. b.push(t)
  1594. }
  1595. return b;
  1596. }
  1597. var checkHoverDependencies = function(_nc,opt) {
  1598. var _ = _nc.data(),
  1599. senter = _.start==="sliderenter" || (_.frames!==undefined && _.frames[0]!=undefined && _.frames[0].delay==="sliderenter") ? true : false;
  1600. if (senter) {
  1601. if (opt.layersonhover===undefined) {
  1602. opt.c.on('tp-mouseenter',function() {
  1603. if (opt.layersonhover)
  1604. jQuery.each(opt.layersonhover,function(i,tnc) {
  1605. var cli = tnc.data('closestli') || tnc.closest('.tp-revslider-slidesli'),
  1606. stl = tnc.data('staticli') || tnc.closest('.tp-static-layers');
  1607. if (tnc.data('closestli')===undefined) {
  1608. tnc.data('closestli',cli);
  1609. tnc.data('staticli',stl);
  1610. }
  1611. if ((cli.length>0 && (cli.hasClass("active-revslide")) || cli.hasClass("processing-revslide")) || (stl.length>0)) {
  1612. tnc.data('animdirection',"in");
  1613. if (_R.playAnimationFrame)
  1614. _R.playAnimationFrame({caption:tnc,opt:opt,frame:"frame_0", triggerdirection:"in", triggerframein:"frame_0", triggerframeout:"frame_999"});
  1615. tnc.data('triggerstate',"on");
  1616. }
  1617. });
  1618. });
  1619. opt.c.on('tp-mouseleft',function() {
  1620. if (opt.layersonhover)
  1621. jQuery.each(opt.layersonhover,function(i,tnc) {
  1622. tnc.data('animdirection',"out");
  1623. tnc.data('triggered',true);
  1624. tnc.data('triggerstate',"off");
  1625. if (_R.stopVideo) _R.stopVideo(tnc,opt);
  1626. if (_R.playAnimationFrame) _R.playAnimationFrame({caption:tnc,opt:opt,frame:"frame_999", triggerdirection:"out", triggerframein:"frame_0", triggerframeout:"frame_999"});
  1627. });
  1628. });
  1629. opt.layersonhover = new Array;
  1630. }
  1631. opt.layersonhover.push(_nc);
  1632. }
  1633. }
  1634. var contWidthManager = function(opt) {
  1635. var rl = _R.getHorizontalOffset(opt.c,"left");
  1636. if (opt.sliderLayout!="auto" && (opt.sliderLayout!=="fullscreen" || opt.fullScreenAutoWidth!="on")) {
  1637. var loff = Math.ceil(opt.c.closest('.forcefullwidth_wrapper_tp_banner').offset().left - rl);
  1638. punchgs.TweenLite.set(opt.c.parent(),{'left':(0-loff)+"px",'width':jQuery(window).width()-_R.getHorizontalOffset(opt.c,"both")});
  1639. } else {
  1640. if (opt.sliderLayout=="fullscreen" && opt.fullScreenAutoWidth=="on")
  1641. punchgs.TweenLite.set(opt.ul,{left:0,width:opt.c.width()});
  1642. else
  1643. punchgs.TweenLite.set(opt.ul,{left:rl,width:opt.c.width()-_R.getHorizontalOffset(opt.c,"both")});
  1644. }
  1645. // put Static Layer Wrapper in Position
  1646. if (opt.slayers && (opt.sliderLayout!="fullwidth" && opt.sliderLayout!="fullscreen"))
  1647. punchgs.TweenLite.set(opt.slayers,{left:rl});
  1648. }
  1649. var cv = function(a,d) {
  1650. return a===undefined ? d : a;
  1651. }
  1652. var hideSliderUnder = function(container,opt,resized) {
  1653. // FIRST TIME STOP/START HIDE / SHOW SLIDER
  1654. //REMOVE AND SHOW SLIDER ON DEMAND
  1655. var contpar= container.parent();
  1656. if (jQuery(window).width()<opt.hideSliderAtLimit) {
  1657. container.trigger('stoptimer');
  1658. if (contpar.css('display')!="none")
  1659. contpar.data('olddisplay',contpar.css('display'));
  1660. contpar.css({display:"none"});
  1661. } else {
  1662. if (container.is(":hidden") && resized) {
  1663. if (contpar.data('olddisplay')!=undefined && contpar.data('olddisplay')!="undefined" && contpar.data('olddisplay') != "none")
  1664. contpar.css({display:contpar.data('olddisplay')});
  1665. else
  1666. contpar.css({display:"block"});
  1667. container.trigger('restarttimer');
  1668. setTimeout(function() {
  1669. containerResized(container,opt);
  1670. },150)
  1671. }
  1672. }
  1673. if (_R.hideUnHideNav) _R.hideUnHideNav(opt);
  1674. }
  1675. //////////////////////////
  1676. // CONTAINER RESIZED //
  1677. /////////////////////////
  1678. var containerResized = function (c,opt) {
  1679. c.trigger('revolution.slide.beforeredraw');
  1680. if (opt.infullscreenmode == true)
  1681. opt.minHeight = jQuery(window).height();
  1682. setCurWinRange(opt);
  1683. setCurWinRange(opt,true);
  1684. if (!_R.resizeThumbsTabs || _R.resizeThumbsTabs(opt)===true) {
  1685. hideSliderUnder(c,opt,true);
  1686. contWidthManager(opt);
  1687. if ( opt.sliderType =="carousel") _R.prepareCarousel(opt,true);
  1688. if (c===undefined) return false;
  1689. _R.setSize(opt);
  1690. opt.conw = opt.c.width();
  1691. opt.conh = opt.infullscreenmode ? opt.minHeight : opt.c.height();
  1692. var actsh = c.find('.active-revslide .slotholder'),
  1693. nextsh = c.find('.processing-revslide .slotholder');
  1694. removeSlots(c,opt,c,2);
  1695. if (opt.sliderType==="standard") {
  1696. punchgs.TweenLite.set(nextsh.find('.defaultimg'),{opacity:0});
  1697. actsh.find('.defaultimg').css({'opacity':1});
  1698. }
  1699. if ( opt.sliderType==="carousel" && opt.lastconw != opt.conw) {
  1700. clearTimeout(opt.pcartimer);
  1701. opt.pcartimer = setTimeout(function() {
  1702. _R.prepareCarousel(opt,true);
  1703. // SHOW ALL LAYERS IN ALL SLIDES FOR CAROUSEL
  1704. if (opt.sliderType=="carousel" && opt.carousel.showLayersAllTime==="on")
  1705. jQuery.each(opt.li,function(i) {
  1706. _R.animateTheCaptions({slide:jQuery(opt.li[i]), opt:opt,recall:true});
  1707. })
  1708. },100);
  1709. opt.lastconw = opt.conw;
  1710. }
  1711. if (_R.manageNavigation) _R.manageNavigation(opt);
  1712. if (_R.animateTheCaptions && c.find('.active-revslide').length>0)
  1713. _R.animateTheCaptions({slide:c.find('.active-revslide'), opt:opt,recall:true});
  1714. if (nextsh.data('kenburns')=="on")
  1715. _R.startKenBurn(nextsh,opt,(nextsh.data('kbtl')!==undefined ? nextsh.data('kbtl').progress() : 0));
  1716. if (actsh.data('kenburns')=="on")
  1717. _R.startKenBurn(actsh,opt,(actsh.data('kbtl')!==undefined ? actsh.data('kbtl').progress() : 0));
  1718. // DOUBLE CALL FOR SOME FUNCTION TO AVOID PORTRAIT/LANDSCAPE ISSUES, AND TO AVOID FULLSCREEN/NORMAL SWAP ISSUES
  1719. if (_R.animateTheCaptions && c.find('.processing-revslide').length>0) _R.animateTheCaptions({slide:c.find('.processing-revslide'), opt:opt,recall:true});
  1720. if (_R.manageNavigation) _R.manageNavigation(opt);
  1721. }
  1722. c.trigger('revolution.slide.afterdraw');
  1723. }
  1724. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1725. /////////////////////////////////////////////////////////////////////////////// PREPARING / REMOVING ////////////////////////////////////////////////////////
  1726. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1727. var setScale = function(opt) {
  1728. opt.bw = (opt.width / opt.gridwidth[opt.curWinRange]);
  1729. opt.bh = (opt.height / opt.gridheight[opt.curWinRange]);
  1730. if (opt.bh>opt.bw)
  1731. opt.bh=opt.bw
  1732. else
  1733. opt.bw = opt.bh;
  1734. if (opt.bh>1 || opt.bw>1) { opt.bw=1; opt.bh=1; }
  1735. }
  1736. /////////////////////////////////////////
  1737. // - PREPARE THE SLIDES / SLOTS - //
  1738. ///////////////////////////////////////
  1739. var prepareSlides = function(container,opt) {
  1740. container.find('.tp-caption').each(function() {
  1741. var c = jQuery(this);
  1742. if (c.data('transition')!==undefined) c.addClass(c.data('transition'));
  1743. });
  1744. // PREPARE THE UL CONTAINER TO HAVEING MAX HEIGHT AND HEIGHT FOR ANY SITUATION
  1745. opt.ul.css({overflow:'hidden',width:'100%',height:'100%',maxHeight:container.parent().css('maxHeight')})
  1746. if (opt.autoHeight=="on") {
  1747. opt.ul.css({overflow:'hidden',width:'100%',height:'100%',maxHeight:"none"});
  1748. container.css({'maxHeight':'none'});
  1749. container.parent().css({'maxHeight':'none'});
  1750. }
  1751. //_R.setSize("",opt);
  1752. opt.allli.each(function(j) {
  1753. var li=jQuery(this),
  1754. originalIndex = li.data('originalindex');
  1755. //START WITH CORRECT SLIDE
  1756. if ((opt.startWithSlide !=undefined && originalIndex==opt.startWithSlide) || opt.startWithSlide ===undefined && j==0)
  1757. li.addClass("next-revslide");
  1758. // MAKE LI OVERFLOW HIDDEN FOR FURTHER ISSUES
  1759. li.css({'width':'100%','height':'100%','overflow':'hidden'});
  1760. });
  1761. if (opt.sliderType === "carousel") {
  1762. //SET CAROUSEL
  1763. opt.ul.css({overflow:"visible"}).wrap('<div class="tp-carousel-wrapper" style="width:100%;height:100%;position:absolute;top:0px;left:0px;overflow:hidden;"></div>');
  1764. var apt = '<div style="clear:both;display:block;width:100%;height:1px;position:relative;margin-bottom:-1px"></div>';
  1765. opt.c.parent().prepend(apt);
  1766. opt.c.parent().append(apt);
  1767. _R.prepareCarousel(opt);
  1768. }
  1769. // RESOLVE OVERFLOW HIDDEN OF MAIN CONTAINER
  1770. container.parent().css({'overflow':'visible'});
  1771. opt.allli.find('>img').each(function(j) {
  1772. var img=jQuery(this),
  1773. cli = img.closest('li'),
  1774. bgvid = cli.find('.rs-background-video-layer');
  1775. bgvid.addClass("defaultvid").css({zIndex:30});
  1776. img.addClass('defaultimg');
  1777. // TURN OF KEN BURNS IF WE ARE ON MOBILE AND IT IS WISHED SO
  1778. if (opt.fallbacks.panZoomDisableOnMobile == "on" && _ISM) {
  1779. img.data('kenburns',"off");
  1780. img.data('bgfit',"cover");
  1781. }
  1782. var mediafilter = cli.data('mediafilter');
  1783. mediafilter = mediafilter==="none" || mediafilter===undefined ? "" : mediafilter;
  1784. img.wrap('<div class="slotholder" style="position:absolute; top:0px; left:0px; z-index:0;width:100%;height:100%;"></div>');
  1785. bgvid.appendTo(cli.find('.slotholder'));
  1786. var dts = img.data();
  1787. img.closest('.slotholder').data(dts);
  1788. if (bgvid.length>0 && dts.bgparallax!=undefined) {
  1789. bgvid.data('bgparallax',dts.bgparallax);
  1790. bgvid.data('showcoveronpause',"on");
  1791. }
  1792. if (opt.dottedOverlay!="none" && opt.dottedOverlay!=undefined)
  1793. img.closest('.slotholder').append('<div class="tp-dottedoverlay '+opt.dottedOverlay+'"></div>');
  1794. var src=img.attr('src');
  1795. dts.src = src;
  1796. dts.bgfit = dts.bgfit || "cover";
  1797. dts.bgrepeat = dts.bgrepeat || "no-repeat",
  1798. dts.bgposition = dts.bgposition || "center center";
  1799. var pari = img.closest('.slotholder'),
  1800. bgcolor = img.data('bgcolor'),
  1801. bgstyle="";
  1802. if (bgcolor!==undefined && bgcolor.indexOf('gradient')>=0)
  1803. bgstyle='"background:'+bgcolor+';width:100%;height:100%;"';
  1804. else
  1805. bgstyle='"background-color:'+bgcolor+';background-repeat:'+dts.bgrepeat+';background-image:url('+src+');background-size:'+dts.bgfit+';background-position:'+dts.bgposition+';width:100%;height:100%;"';
  1806. img.data('mediafilter',mediafilter)
  1807. mediafilter = img.data("kenburns")==="on" ? "" : mediafilter;
  1808. var newimg = jQuery('<div class="tp-bgimg defaultimg '+mediafilter+'" data-bgcolor="'+bgcolor+'" style='+bgstyle+'></div>')
  1809. img.parent().append(newimg);
  1810. var comment = document.createComment("Runtime Modification - Img tag is Still Available for SEO Goals in Source - " + img.get(0).outerHTML);
  1811. img.replaceWith(comment);
  1812. newimg.data(dts);
  1813. newimg.attr("src",src);
  1814. if (opt.sliderType === "standard" || opt.sliderType==="undefined")
  1815. newimg.css({'opacity':0});
  1816. })
  1817. if (opt.scrolleffect.on && opt.scrolleffect.on_slidebg==="on") {
  1818. opt.allslotholder = new Array();
  1819. opt.allli.find('.slotholder').each(function() {
  1820. jQuery(this).wrap('<div style="display:block;position:absolute;top:0px;left:0px;width:100%;height:100%" class="slotholder_fadeoutwrap"></div>')
  1821. });
  1822. opt.allslotholder = opt.c.find('.slotholder_fadeoutwrap');
  1823. }
  1824. }
  1825. // REMOVE SLOTS //
  1826. var removeSlots = function(container,opt,where,addon) {
  1827. opt.removePrepare = opt.removePrepare + addon;
  1828. where.find('.slot, .slot-circle-wrapper').each(function() {
  1829. jQuery(this).remove();
  1830. });
  1831. opt.transition = 0;
  1832. opt.removePrepare = 0;
  1833. }
  1834. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1835. /////////////////////////////////////////////////////////////////////////////// SLIDE SWAPS ////////////////////////////////////////////////////////////
  1836. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1837. // THE IMAGE IS LOADED, WIDTH, HEIGHT CAN BE SAVED
  1838. var cutParams = function(a) {
  1839. var b = a;
  1840. if (a!=undefined && a.length>0)
  1841. b = a.split("?")[0];
  1842. return b;
  1843. }
  1844. var relativeRedir = function(redir){
  1845. return location.pathname.replace(/(.*)\/[^/]*/, "$1/"+redir);
  1846. }
  1847. var abstorel = function (base, relative) {
  1848. var stack = base.split("/"),
  1849. parts = relative.split("/");
  1850. stack.pop(); // remove current file name (or empty string)
  1851. // (omit if "base" is the current folder without trailing slash)
  1852. for (var i=0; i<parts.length; i++) {
  1853. if (parts[i] == ".")
  1854. continue;
  1855. if (parts[i] == "..")
  1856. stack.pop();
  1857. else
  1858. stack.push(parts[i]);
  1859. }
  1860. return stack.join("/");
  1861. }
  1862. var imgLoaded = function(img,opt,progress) {
  1863. opt.syncload--;
  1864. if (opt.loadqueue)
  1865. jQuery.each(opt.loadqueue, function(index,queue) {
  1866. var mqsrc = queue.src.replace(/\.\.\/\.\.\//gi,""),
  1867. fullsrc = self.location.href,
  1868. origin = document.location.origin,
  1869. fullsrc_b = fullsrc.substring(0,fullsrc.length-1)+"/"+mqsrc,
  1870. origin_b = origin+"/"+mqsrc,
  1871. absolute = abstorel(self.location.href,queue.src);
  1872. fullsrc = fullsrc.substring(0,fullsrc.length-1)+mqsrc;
  1873. origin = origin+mqsrc;
  1874. if (cutParams(origin) === cutParams(decodeURIComponent(img.src)) ||
  1875. cutParams(fullsrc)=== cutParams(decodeURIComponent(img.src)) ||
  1876. cutParams(absolute)=== cutParams(decodeURIComponent(img.src)) ||
  1877. cutParams(origin_b) === cutParams(decodeURIComponent(img.src)) ||
  1878. cutParams(fullsrc_b)=== cutParams(decodeURIComponent(img.src)) ||
  1879. cutParams(queue.src) === cutParams(decodeURIComponent(img.src)) ||
  1880. cutParams(queue.src).replace(/^.*\/\/[^\/]+/, '') === cutParams(decodeURIComponent(img.src)).replace(/^.*\/\/[^\/]+/, '') ||
  1881. (window.location.origin==="file://" && cutParams(img.src).match(new RegExp(mqsrc)))) {
  1882. queue.progress = progress;
  1883. queue.width = img.width;
  1884. queue.height = img.height;
  1885. }
  1886. });
  1887. progressImageLoad(opt);
  1888. }
  1889. // PRELOAD IMAGES 3 PIECES ON ONE GO, CHECK LOAD PRIORITY
  1890. var progressImageLoad = function(opt) {
  1891. if (opt.syncload == 3) return;
  1892. if (opt.loadqueue)
  1893. jQuery.each(opt.loadqueue, function(index,queue) {
  1894. if (queue.progress.match(/prepared/g)) {
  1895. if (opt.syncload<=3) {
  1896. opt.syncload++;
  1897. if (queue.type=="img") {
  1898. var img = new Image();
  1899. img.onload = function() {
  1900. imgLoaded(this,opt,"loaded");
  1901. queue.error = false;
  1902. };
  1903. img.onerror = function() {
  1904. imgLoaded(this,opt,"failed");
  1905. queue.error = true;
  1906. };
  1907. img.src=queue.src;
  1908. } else {
  1909. jQuery.get(queue.src, function(data) {
  1910. queue.innerHTML = new XMLSerializer().serializeToString(data.documentElement);
  1911. queue.progress="loaded";
  1912. opt.syncload--;
  1913. progressImageLoad(opt);
  1914. }).fail(function() {
  1915. queue.progress="failed";
  1916. opt.syncload--;
  1917. progressImageLoad(opt);
  1918. });
  1919. }
  1920. queue.progress="inload";
  1921. }
  1922. }
  1923. });
  1924. }
  1925. // ADD TO QUEUE THE NOT LOADED IMAGES YES
  1926. var addToLoadQueue = function(src,opt,prio,type,staticlayer) {
  1927. var alreadyexist = false;
  1928. if (opt.loadqueue)
  1929. jQuery.each(opt.loadqueue, function(index,queue) {
  1930. if (queue.src === src) alreadyexist = true;
  1931. });
  1932. if (!alreadyexist) {
  1933. var loadobj = new Object();
  1934. loadobj.src = src;
  1935. loadobj.starttoload = jQuery.now();
  1936. loadobj.type = type || "img";
  1937. loadobj.prio = prio;
  1938. loadobj.progress = "prepared";
  1939. loadobj.static = staticlayer;
  1940. opt.loadqueue.push(loadobj);
  1941. }
  1942. }
  1943. // LOAD THE IMAGES OF THE PREDEFINED CONTAINER
  1944. var loadImages = function(container,opt,prio,staticlayer) {
  1945. container.find('img,.defaultimg, .tp-svg-layer').each(function() {
  1946. var element = jQuery(this),
  1947. src = element.data('lazyload') !== undefined && element.data('lazyload')!=="undefined" ? element.data('lazyload') : element.data('svg_src') !=undefined ? element.data('svg_src') : element.attr('src'),
  1948. type = element.data('svg_src') !=undefined ? "svg" : "img";
  1949. element.data('start-to-load',jQuery.now());
  1950. addToLoadQueue(src,opt,prio,type,staticlayer);
  1951. });
  1952. progressImageLoad(opt);
  1953. }
  1954. // FIND SEARCHED IMAGE/SRC IN THE LOAD QUEUE
  1955. var getLoadObj = function(opt,src) {
  1956. var obj = new Object();
  1957. if (opt.loadqueue)
  1958. jQuery.each(opt.loadqueue, function(index,queue) {
  1959. if (queue.src == src) obj = queue;
  1960. });
  1961. return obj;
  1962. }
  1963. // WAIT PROGRESS TILL THE PREDEFINED CONTAINER HAS ALL IMAGES LOADED INSIDE
  1964. var waitForCurrentImages = function(nextli,opt,callback) {
  1965. var waitforload = false;
  1966. // PRELOAD ALL IMAGES
  1967. nextli.find('img,.defaultimg, .tp-svg-layer').each(function() {
  1968. var element = jQuery(this),
  1969. src = element.data('lazyload') != undefined ? element.data('lazyload') : element.data('svg_src') !=undefined ? element.data('svg_src') : element.attr('src'),
  1970. loadobj = getLoadObj(opt,src);
  1971. // IF ELEMENTS IS NOT LOADED YET, AND IT IS NOW LOADED
  1972. if (element.data('loaded')===undefined && loadobj !==undefined && loadobj.progress && loadobj.progress.match(/loaded/g)) {
  1973. element.attr('src',loadobj.src);
  1974. // IF IT IS A DEFAULT IMG, WE NEED TO ASSIGN SOME SPECIAL VALUES TO IT
  1975. if (loadobj.type=="img") {
  1976. if (element.hasClass("defaultimg")) {
  1977. if (!_R.isIE(8)) {
  1978. if ((loadobj.src.indexOf('images/transparent.png')==-1 && loadobj.src.indexOf('assets/transparent.png')==-1) || element.data('bgcolor')===undefined) {
  1979. element.css({backgroundImage:'url("'+loadobj.src+'")'});
  1980. } else {
  1981. if (element.data('bgcolor')!==undefined)
  1982. element.css({background:element.data('bgcolor')});
  1983. }
  1984. } else {
  1985. defimg.attr('src',loadobj.src);
  1986. }
  1987. nextli.data('owidth',loadobj.width);
  1988. nextli.data('oheight',loadobj.height);
  1989. nextli.find('.slotholder').data('owidth',loadobj.width);
  1990. nextli.find('.slotholder').data('oheight',loadobj.height);
  1991. } else {
  1992. var w = element.data('ww'),
  1993. h = element.data('hh');
  1994. element.data('owidth',loadobj.width);
  1995. element.data('oheight',loadobj.height);
  1996. w = w==undefined || w =="auto" || w=="" ? loadobj.width : w;
  1997. h = h==undefined || h =="auto" || h=="" ? loadobj.height : h;
  1998. if (!jQuery.isNumeric(w) && w.indexOf("%")>0)
  1999. h = w;
  2000. element.data('ww',w);
  2001. element.data('hh',h);
  2002. }
  2003. } else
  2004. if (loadobj.type=="svg" && loadobj.progress=="loaded") {
  2005. element.append('<div class="tp-svg-innercontainer"></div>');
  2006. element.find('.tp-svg-innercontainer').append(loadobj.innerHTML);
  2007. }
  2008. // ELEMENT IS NOW FULLY LOADED
  2009. element.data('loaded',true);
  2010. }
  2011. if (loadobj && loadobj.progress && loadobj.progress.match(/inprogress|inload|prepared/g))
  2012. if (!loadobj.error && jQuery.now()-element.data('start-to-load')<5000)
  2013. waitforload = true;
  2014. else {
  2015. loadobj.progress="failed";
  2016. if (!loadobj.reported_img) {
  2017. loadobj.reported_img = true;
  2018. console.warn(src+" Could not be loaded !");
  2019. }
  2020. }
  2021. // WAIT FOR VIDEO API'S
  2022. if (opt.youtubeapineeded == true && (!window['YT'] || YT.Player==undefined)) {
  2023. waitforload = true;
  2024. if (jQuery.now()-opt.youtubestarttime>5000 && opt.youtubewarning!=true) {
  2025. opt.youtubewarning = true;
  2026. var txt = "YouTube Api Could not be loaded !";
  2027. if (location.protocol === 'https:') txt = txt + " Please Check and Renew SSL Certificate !";
  2028. console.error(txt);
  2029. opt.c.append('<div style="position:absolute;top:50%;width:100%;color:#e74c3c; font-size:16px; text-align:center; padding:15px;background:#000; display:block;"><strong>'+txt+'</strong></div>')
  2030. }
  2031. }
  2032. if (opt.vimeoapineeded == true && !window['Vimeo']) {
  2033. waitforload = true;
  2034. if (jQuery.now()-opt.vimeostarttime>5000 && opt.vimeowarning!=true) {
  2035. opt.vimeowarning= true;
  2036. var txt = "Vimeo Api Could not be loaded !";
  2037. if (location.protocol === 'https:') txt = txt + " Please Check and Renew SSL Certificate !";
  2038. console.error(txt);
  2039. opt.c.append('<div style="position:absolute;top:50%;width:100%;color:#e74c3c; font-size:16px; text-align:center; padding:15px;background:#000; display:block;"><strong>'+txt+'</strong></div>')
  2040. }
  2041. }
  2042. });
  2043. if (!_ISM && opt.audioqueue && opt.audioqueue.length>0) {
  2044. jQuery.each(opt.audioqueue,function(i,obj) {
  2045. if (obj.status && obj.status==="prepared")
  2046. if (jQuery.now() - obj.start<obj.waittime)
  2047. waitforload = true;
  2048. });
  2049. }
  2050. jQuery.each(opt.loadqueue,function(i,o) {
  2051. if (o.static===true && (o.progress!="loaded" || o.progress==="failed")) {
  2052. if (o.progress=="failed") {
  2053. if (!o.reported) {
  2054. o.reported = true;
  2055. console.warn("Static Image "+o.src+" Could not be loaded in time. Error Exists:"+o.error);
  2056. }
  2057. }
  2058. else
  2059. if (!o.error && jQuery.now()-o.starttoload<5000) {
  2060. waitforload = true;
  2061. }
  2062. else {
  2063. if (!o.reported) {
  2064. o.reported = true;
  2065. console.warn("Static Image "+o.src+" Could not be loaded within 5s! Error Exists:"+o.error);
  2066. }
  2067. }
  2068. }
  2069. });
  2070. if (waitforload)
  2071. punchgs.TweenLite.delayedCall(0.18,waitForCurrentImages,[nextli,opt,callback]);
  2072. else
  2073. punchgs.TweenLite.delayedCall(0.18,callback);
  2074. }
  2075. //////////////////////////////////////
  2076. // - CALL TO SWAP THE SLIDES - //
  2077. /////////////////////////////////////
  2078. var swapSlide = function(container) {
  2079. var opt = container[0].opt;
  2080. clearTimeout(opt.waitWithSwapSlide);
  2081. if (container.find('.processing-revslide').length>0) {
  2082. opt.waitWithSwapSlide = setTimeout(function() {
  2083. swapSlide(container);
  2084. },150);
  2085. return false;
  2086. }
  2087. var actli = container.find('.active-revslide'),
  2088. nextli = container.find('.next-revslide'),
  2089. defimg= nextli.find('.defaultimg');
  2090. if (opt.sliderType==="carousel" && !opt.carousel.fadein) {
  2091. punchgs.TweenLite.to(opt.ul,1,{opacity:1});
  2092. opt.carousel.fadein=true;
  2093. }
  2094. if (nextli.index() === actli.index() && opt.onlyPreparedSlide!==true) {
  2095. nextli.removeClass("next-revslide");
  2096. return false;
  2097. }
  2098. if (opt.onlyPreparedSlide===true) {
  2099. opt.onlyPreparedSlide=false;
  2100. jQuery(opt.li[0]).addClass("processing-revslide");
  2101. }
  2102. nextli.removeClass("next-revslide").addClass("processing-revslide");
  2103. if (nextli.index()===-1 && opt.sliderType==="carousel") nextli = jQuery(opt.li[0]);
  2104. nextli.data('slide_on_focus_amount',(nextli.data('slide_on_focus_amount')+1) || 1);
  2105. // CHECK IF WE ARE ALREADY AT LAST ITEM TO PLAY IN REAL LOOP SESSION
  2106. if (opt.stopLoop=="on" && nextli.index()==opt.lastslidetoshow-1) {
  2107. container.find('.tp-bannertimer').css({'visibility':'hidden'});
  2108. container.trigger('revolution.slide.onstop');
  2109. opt.noloopanymore = 1;
  2110. }
  2111. // INCREASE LOOP AMOUNTS
  2112. if (nextli.index()===opt.slideamount-1) {
  2113. opt.looptogo=opt.looptogo-1;
  2114. if (opt.looptogo<=0)
  2115. opt.stopLoop="on";
  2116. }
  2117. opt.tonpause = true;
  2118. container.trigger('stoptimer');
  2119. opt.cd=0;
  2120. if (opt.spinner==="off")
  2121. if (opt.loader!==undefined) opt.loader.css({display:"none"});
  2122. else
  2123. opt.loadertimer = setTimeout(function() {if (opt.loader!==undefined) opt.loader.css({display:"block"});},50);
  2124. loadImages(nextli,opt,1);
  2125. if (_R.preLoadAudio) _R.preLoadAudio(nextli,opt,1);
  2126. // WAIT FOR SWAP SLIDE PROGRESS
  2127. waitForCurrentImages(nextli,opt,function() {
  2128. // MANAGE BG VIDEOS
  2129. nextli.find('.rs-background-video-layer').each(function() {
  2130. var _nc = jQuery(this);
  2131. if (!_nc.hasClass("HasListener")) {
  2132. _nc.data('bgvideo',1);
  2133. if (_R.manageVideoLayer) _R.manageVideoLayer(_nc,opt);
  2134. }
  2135. if (_nc.find('.rs-fullvideo-cover').length==0)
  2136. _nc.append('<div class="rs-fullvideo-cover"></div>')
  2137. });
  2138. swapSlideProgress(defimg,container)
  2139. });
  2140. }
  2141. //////////////////////////////////////
  2142. // - PROGRESS SWAP THE SLIDES - //
  2143. /////////////////////////////////////
  2144. var swapSlideProgress = function(defimg,container) {
  2145. var actli = container.find('.active-revslide'),
  2146. nextli = container.find('.processing-revslide'),
  2147. actsh = actli.find('.slotholder'),
  2148. nextsh = nextli.find('.slotholder'),
  2149. opt = container[0].opt;
  2150. opt.tonpause=false;
  2151. opt.cd=0;
  2152. clearTimeout(opt.loadertimer);
  2153. if (opt.loader!==undefined) opt.loader.css({display:"none"});
  2154. // if ( opt.sliderType =="carousel") _R.prepareCarousel(opt);
  2155. _R.setSize(opt);
  2156. _R.slotSize(defimg,opt);
  2157. if (_R.manageNavigation) _R.manageNavigation(opt);
  2158. var data={};
  2159. data.nextslide=nextli;
  2160. data.currentslide=actli;
  2161. container.trigger('revolution.slide.onbeforeswap',data);
  2162. opt.transition = 1;
  2163. opt.videoplaying = false;
  2164. // IF DELAY HAS BEEN SET VIA THE SLIDE, WE TAKE THE NEW VALUE, OTHER WAY THE OLD ONE...
  2165. if (nextli.data('delay')!=undefined) {
  2166. opt.cd=0;
  2167. opt.delay=nextli.data('delay');
  2168. } else
  2169. opt.delay=opt.origcd;
  2170. if (nextli.data('ssop')=="true" || nextli.data('ssop')===true)
  2171. opt.ssop = true
  2172. else
  2173. opt.ssop = false;
  2174. container.trigger('nulltimer');
  2175. var ai = actli.index(),
  2176. ni = nextli.index();
  2177. opt.sdir = ni<ai ? 1 : 0;
  2178. if (opt.sc_indicator=="arrow") {
  2179. if (ai==0 && ni==opt.slideamount-1) opt.sdir = 1;
  2180. if (ai==opt.slideamount-1 && ni==0) opt.sdir = 0;
  2181. }
  2182. opt.lsdir = opt.lsdir === undefined ? opt.sdir : opt.lsdir;
  2183. opt.dirc = opt.lsdir != opt.sdir;
  2184. opt.lsdir = opt.sdir;
  2185. ///////////////////////////
  2186. // REMOVE THE CAPTIONS //
  2187. ///////////////////////////
  2188. if (actli.index() != nextli.index() && opt.firststart!=1)
  2189. if (_R.removeTheCaptions) _R.removeTheCaptions(actli,opt);
  2190. if (!nextli.hasClass('rs-pause-timer-once') && !nextli.hasClass("rs-pause-timer-always"))
  2191. container.trigger('restarttimer');
  2192. else
  2193. opt.videoplaying = true;
  2194. nextli.removeClass("rs-pause-timer-once");
  2195. var nexttrans,
  2196. direction=-1,
  2197. mtl;
  2198. opt.currentSlide = actli.index();
  2199. opt.nextSlide = nextli.index();
  2200. // SELECT SLIDER TYPE
  2201. if ( opt.sliderType =="carousel") {
  2202. mtl = new punchgs.TimelineLite();
  2203. _R.prepareCarousel(opt,mtl);
  2204. letItFree(container,nextsh,actsh,nextli,actli,mtl);
  2205. opt.transition = 0;
  2206. opt.firststart = 0;
  2207. } else {
  2208. mtl = new punchgs.TimelineLite({onComplete:function() {
  2209. letItFree(container,nextsh,actsh,nextli,actli,mtl);
  2210. }});
  2211. mtl.add(punchgs.TweenLite.set(nextsh.find('.defaultimg'),{opacity:0}));
  2212. mtl.pause();
  2213. if (_R.animateTheCaptions)
  2214. _R.animateTheCaptions({slide:nextli,opt:opt,preset:true});
  2215. if (opt.firststart==1) {
  2216. punchgs.TweenLite.set(actli,{autoAlpha:0});
  2217. opt.firststart=0;
  2218. }
  2219. punchgs.TweenLite.set(actli,{zIndex:18});
  2220. punchgs.TweenLite.set(nextli,{autoAlpha:0,zIndex:20});
  2221. // IF THERE IS AN OTHER FIRST SLIDE START HAS BEED SELECTED
  2222. if (nextli.data('differentissplayed') =='prepared') {
  2223. nextli.data('differentissplayed','done');
  2224. nextli.data('transition',nextli.data('savedtransition'));
  2225. nextli.data('slotamount',nextli.data('savedslotamount'));
  2226. nextli.data('masterspeed',nextli.data('savedmasterspeed'));
  2227. }
  2228. if (nextli.data('fstransition') != undefined && nextli.data('differentissplayed') !="done") {
  2229. nextli.data('savedtransition',nextli.data('transition'));
  2230. nextli.data('savedslotamount',nextli.data('slotamount'));
  2231. nextli.data('savedmasterspeed',nextli.data('masterspeed'));
  2232. nextli.data('transition',nextli.data('fstransition'));
  2233. nextli.data('slotamount',nextli.data('fsslotamount'));
  2234. nextli.data('masterspeed',nextli.data('fsmasterspeed'));
  2235. nextli.data('differentissplayed','prepared');
  2236. }
  2237. if (nextli.data('transition')==undefined) nextli.data('transition',"random");
  2238. nexttrans = 0;
  2239. var transtext = nextli.data('transition') !== undefined ? nextli.data('transition').split(",") : "fade",
  2240. curtransid = nextli.data('nexttransid') == undefined ? -1 : nextli.data('nexttransid');
  2241. if (nextli.data('randomtransition')=="on")
  2242. curtransid = Math.round(Math.random()*transtext.length);
  2243. else
  2244. curtransid=curtransid+1;
  2245. if (curtransid==transtext.length) curtransid=0;
  2246. nextli.data('nexttransid',curtransid);
  2247. var comingtransition = transtext[curtransid];
  2248. if (opt.ie) {
  2249. if (comingtransition=="boxfade") comingtransition = "boxslide";
  2250. if (comingtransition=="slotfade-vertical") comingtransition = "slotzoom-vertical";
  2251. if (comingtransition=="slotfade-horizontal") comingtransition = "slotzoom-horizontal";
  2252. }
  2253. if (_R.isIE(8))
  2254. comingtransition = 11;
  2255. mtl = _R.animateSlide(nexttrans, comingtransition, container, nextli, actli, nextsh, actsh, mtl);
  2256. if (nextsh.data('kenburns')=="on") {
  2257. _R.startKenBurn(nextsh,opt);
  2258. mtl.add(punchgs.TweenLite.set(nextsh,{autoAlpha:0}))
  2259. }
  2260. // SHOW FIRST LI && ANIMATE THE CAPTIONS
  2261. mtl.pause();
  2262. }
  2263. if (_R.scrollHandling) {
  2264. _R.scrollHandling(opt, true,0);
  2265. mtl.eventCallback("onUpdate",function() {
  2266. _R.scrollHandling(opt, true,0);
  2267. });
  2268. }
  2269. // START PARALLAX IF NEEDED
  2270. if (opt.parallax.type!="off" && opt.parallax.firstgo==undefined && _R.scrollHandling) {
  2271. opt.parallax.firstgo = true;
  2272. opt.lastscrolltop = -999;
  2273. _R.scrollHandling(opt,true,0);
  2274. setTimeout(function() {
  2275. opt.lastscrolltop = -999;
  2276. _R.scrollHandling(opt,true,0);
  2277. },210);
  2278. setTimeout(function() {
  2279. opt.lastscrolltop = -999;
  2280. _R.scrollHandling(opt,true,0);
  2281. },420);
  2282. }
  2283. if (_R.animateTheCaptions) {
  2284. if (opt.sliderType==="carousel" && opt.carousel.showLayersAllTime==="on") {
  2285. // SHOW ALL LAYERS IN ALL SLIDES FOR CAROUSEL
  2286. jQuery.each(opt.li,function(i) {
  2287. if (!opt.carousel.allLayersStarted) {
  2288. if (opt.li[i] === nextli)
  2289. _R.animateTheCaptions({slide:jQuery(opt.li[i]),maintimeline:mtl,opt:opt,startslideanimat:0});
  2290. else
  2291. _R.animateTheCaptions({slide:jQuery(opt.li[i]),opt:opt,startslideanimat:0});
  2292. }
  2293. else
  2294. _R.animateTheCaptions({slide:jQuery(opt.li[i]),opt:opt,recall:true});
  2295. });
  2296. opt.carousel.allLayersStarted = true;
  2297. } else {
  2298. _R.animateTheCaptions({slide:nextli, opt:opt,maintimeline:mtl,startslideanimat:0});
  2299. }
  2300. } else {
  2301. if (mtl != undefined) setTimeout(function() {
  2302. mtl.resume();
  2303. },30);
  2304. }
  2305. punchgs.TweenLite.to(nextli,0.001,{autoAlpha:1});
  2306. //if (_R.callStaticDDDParallax) _R.callStaticDDDParallax(container,opt,nextli);
  2307. }
  2308. //////////////////////////////////////////
  2309. // GIVE FREE THE TRANSITIOSN //
  2310. //////////////////////////////////////////
  2311. var letItFree = function(container,nextsh,actsh,nextli,actli,mtl) {
  2312. var opt = container[0].opt;
  2313. if (opt.sliderType==="carousel") {
  2314. // CAROUSEL SLIDER
  2315. } else {
  2316. opt.removePrepare = 0;
  2317. punchgs.TweenLite.to(nextsh.find('.defaultimg'),0.001,{zIndex:20,autoAlpha:1,onComplete:function() {
  2318. removeSlots(container,opt,nextli,1);
  2319. }});
  2320. if (nextli.index()!=actli.index()) {
  2321. punchgs.TweenLite.to(actli,0.2,{zIndex:18,autoAlpha:0,onComplete:function() {
  2322. removeSlots(container,opt,actli,1);
  2323. }});
  2324. }
  2325. }
  2326. container.find('.active-revslide').removeClass("active-revslide");
  2327. container.find('.processing-revslide').removeClass("processing-revslide").addClass("active-revslide");
  2328. opt.act=nextli.index();
  2329. opt.c.attr('data-slideactive',container.find('.active-revslide').data('index'));
  2330. if (opt.parallax.type=="scroll" || opt.parallax.type=="scroll+mouse" || opt.parallax.type=="mouse+scroll") {
  2331. opt.lastscrolltop = -999;
  2332. _R.scrollHandling(opt);
  2333. }
  2334. mtl.clear();
  2335. if (actsh.data('kbtl')!=undefined) {
  2336. actsh.data('kbtl').reverse();
  2337. actsh.data('kbtl').timeScale(25);
  2338. }
  2339. if (nextsh.data('kenburns')=="on") {
  2340. if (nextsh.data('kbtl')!=undefined) {
  2341. nextsh.data('kbtl').timeScale(1);
  2342. nextsh.data('kbtl').play();
  2343. }
  2344. else
  2345. _R.startKenBurn(nextsh,opt);
  2346. }
  2347. nextli.find('.rs-background-video-layer').each(function(i) {
  2348. if (_ISM && (!opt.fallbacks.allowHTML5AutoPlayOnAndroid)) return false;
  2349. var _nc = jQuery(this);
  2350. // JASON 4th arg for Vimeo
  2351. _R.resetVideo(_nc,opt,false,true);
  2352. punchgs.TweenLite.fromTo(_nc,1,{autoAlpha:0},{autoAlpha:1,ease:punchgs.Power3.easeInOut,delay:0.2,onComplete:function() {
  2353. if (_R.animcompleted) _R.animcompleted(_nc,opt);
  2354. }});
  2355. });
  2356. actli.find('.rs-background-video-layer').each(function(i) {
  2357. if (_ISM) return false;
  2358. var _nc = jQuery(this);
  2359. if (_R.stopVideo) {
  2360. _R.resetVideo(_nc,opt);
  2361. _R.stopVideo(_nc,opt);
  2362. }
  2363. punchgs.TweenLite.to(_nc,1,{autoAlpha:0,ease:punchgs.Power3.easeInOut,delay:0.2});
  2364. });
  2365. // TIRGGER THE ON CHANGE EVENTS
  2366. var data={};
  2367. data.slideIndex=nextli.index()+1;
  2368. data.slideLIIndex=nextli.index();
  2369. data.slide = nextli;
  2370. data.currentslide=nextli;
  2371. data.prevslide = actli;
  2372. opt.last_shown_slide = actli.index();
  2373. container.trigger('revolution.slide.onchange',data);
  2374. container.trigger('revolution.slide.onafterswap',data);
  2375. if (opt.startWithSlide!==undefined && opt.startWithSlide!=="done" && opt.sliderType==="carousel") {
  2376. var callslideindex = opt.startWithSlide;
  2377. for (var lis=0;lis<=opt.li.length-1;lis++) {
  2378. var oindex = jQuery(opt.li[lis]).data('originalindex');
  2379. if (oindex === opt.startWithSlide)
  2380. callslideindex = lis;
  2381. }
  2382. if (callslideindex!==0)
  2383. _R.callingNewSlide(opt.c,callslideindex);
  2384. opt.startWithSlide = "done";
  2385. }
  2386. opt.duringslidechange = false;
  2387. var lastSlideLoop = actli.data('slide_on_focus_amount'),
  2388. lastSlideMaxLoop = actli.data('hideafterloop');
  2389. if (lastSlideMaxLoop!=0 && lastSlideMaxLoop<=lastSlideLoop) opt.c.revremoveslide(actli.index());
  2390. var _actli = opt.nextSlide === -1 || opt.nextSlide===undefined ? 0 : opt.nextSlide;
  2391. if (opt.rowzones!=undefined) _actli = _actli>opt.rowzones.length ? opt.rowzones.length : _actli;
  2392. if (opt.rowzones!=undefined && opt.rowzones.length>0 && opt.rowzones[_actli]!=undefined && _actli>=0 && _actli<=opt.rowzones.length && opt.rowzones[_actli].length>0) _R.setSize(opt);
  2393. //if (_R.callStaticDDDParallax) _R.callStaticDDDParallax(container,opt,nextli);
  2394. }
  2395. ///////////////////////////
  2396. // REMOVE THE LISTENERS //
  2397. ///////////////////////////
  2398. var removeAllListeners = function(container,opt) {
  2399. container.children().each(function() {
  2400. try{ jQuery(this).die('click'); } catch(e) {}
  2401. try{ jQuery(this).die('mouseenter');} catch(e) {}
  2402. try{ jQuery(this).die('mouseleave');} catch(e) {}
  2403. try{ jQuery(this).unbind('hover');} catch(e) {}
  2404. })
  2405. try{ container.die('click','mouseenter','mouseleave');} catch(e) {}
  2406. clearInterval(opt.cdint);
  2407. container=null;
  2408. }
  2409. ///////////////////////////
  2410. // - countDown - //
  2411. /////////////////////////
  2412. var countDown = function(container,opt) {
  2413. opt.cd=0;
  2414. opt.loop=0;
  2415. if (opt.stopAfterLoops!=undefined && opt.stopAfterLoops>-1)
  2416. opt.looptogo=opt.stopAfterLoops;
  2417. else
  2418. opt.looptogo=9999999;
  2419. if (opt.stopAtSlide!=undefined && opt.stopAtSlide>-1)
  2420. opt.lastslidetoshow=opt.stopAtSlide;
  2421. else
  2422. opt.lastslidetoshow=999;
  2423. opt.stopLoop="off";
  2424. if (opt.looptogo==0) opt.stopLoop="on";
  2425. var bt=container.find('.tp-bannertimer');
  2426. // LISTENERS //container.trigger('stoptimer');
  2427. container.on('stoptimer',function() {
  2428. var bt = jQuery(this).find('.tp-bannertimer');
  2429. bt[0].tween.pause();
  2430. if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
  2431. opt.sliderstatus = "paused";
  2432. _R.unToggleState(opt.slidertoggledby);
  2433. });
  2434. container.on('starttimer',function() {
  2435. if (opt.forcepause_viatoggle) return;
  2436. if (opt.conthover!=1 && opt.videoplaying!=true && opt.width>opt.hideSliderAtLimit && opt.tonpause != true && opt.overnav !=true && opt.ssop!=true)
  2437. if (opt.noloopanymore !== 1 && (!opt.viewPort.enable || opt.inviewport)) {
  2438. bt.css({visibility:"visible"});
  2439. bt[0].tween.resume();
  2440. opt.sliderstatus = "playing";
  2441. }
  2442. if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
  2443. _R.toggleState(opt.slidertoggledby);
  2444. });
  2445. container.on('restarttimer',function() {
  2446. if (opt.forcepause_viatoggle) return;
  2447. var bt = jQuery(this).find('.tp-bannertimer');
  2448. if (opt.mouseoncontainer && opt.navigation.onHoverStop=="on" && (!_ISM)) return false;
  2449. if (opt.noloopanymore !== 1 && (!opt.viewPort.enable || opt.inviewport) && opt.ssop!=true) {
  2450. bt.css({visibility:"visible"});
  2451. bt[0].tween.kill();
  2452. bt[0].tween=punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1});
  2453. opt.sliderstatus = "playing";
  2454. }
  2455. if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
  2456. _R.toggleState(opt.slidertoggledby);
  2457. });
  2458. container.on('nulltimer',function() {
  2459. bt[0].tween.kill();
  2460. bt[0].tween=punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1});
  2461. bt[0].tween.pause(0);
  2462. if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"});
  2463. opt.sliderstatus = "paused";
  2464. });
  2465. var countDownNext = function() {
  2466. if (jQuery('body').find(container).length==0) {
  2467. removeAllListeners(container,opt);
  2468. clearInterval(opt.cdint);
  2469. }
  2470. container.trigger("revolution.slide.slideatend");
  2471. //STATE OF API CHANGED -> MOVE TO AIP BETTER
  2472. if (container.data('conthover-changed') == 1) {
  2473. opt.conthover= container.data('conthover');
  2474. container.data('conthover-changed',0);
  2475. }
  2476. _R.callingNewSlide(container,1);
  2477. }
  2478. bt[0].tween=punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1});
  2479. if (opt.slideamount >1 && !(opt.stopAfterLoops==0 && opt.stopAtSlide==1)) {
  2480. container.trigger("starttimer");
  2481. }
  2482. else {
  2483. opt.noloopanymore = 1;
  2484. container.trigger("nulltimer");
  2485. }
  2486. container.on('tp-mouseenter',function() {
  2487. opt.mouseoncontainer = true;
  2488. if (opt.navigation.onHoverStop=="on" && (!_ISM)) {
  2489. container.trigger('stoptimer');
  2490. container.trigger('revolution.slide.onpause');
  2491. }
  2492. });
  2493. container.on('tp-mouseleft',function() {
  2494. opt.mouseoncontainer = false;
  2495. if (container.data('conthover')!=1 && opt.navigation.onHoverStop=="on" && ((opt.viewPort.enable==true && opt.inviewport) || opt.viewPort.enable==false)) {
  2496. container.trigger('revolution.slide.onresume');
  2497. container.trigger('starttimer');
  2498. }
  2499. });
  2500. }
  2501. //////////////////////////////////////////////////////
  2502. // * Revolution Slider - NEEDFULL FUNCTIONS
  2503. // * @version: 1.0 (30.10.2014)
  2504. // * @author ThemePunch
  2505. //////////////////////////////////////////////////////
  2506. // - BLUR / FOXUS FUNCTIONS ON BROWSER
  2507. var vis = (function(){
  2508. var stateKey,
  2509. eventKey,
  2510. keys = {
  2511. hidden: "visibilitychange",
  2512. webkitHidden: "webkitvisibilitychange",
  2513. mozHidden: "mozvisibilitychange",
  2514. msHidden: "msvisibilitychange"
  2515. };
  2516. for (stateKey in keys) {
  2517. if (stateKey in document) {
  2518. eventKey = keys[stateKey];
  2519. break;
  2520. }
  2521. }
  2522. return function(c) {
  2523. if (c) document.addEventListener(eventKey, c,{pasive:true});
  2524. return !document[stateKey];
  2525. }
  2526. })();
  2527. var restartOnFocus = function() {
  2528. jQuery('.rev_redraw_on_blurfocus').each(function() {
  2529. var opt = jQuery(this)[0].opt;
  2530. if (opt==undefined || opt.c==undefined || opt.c.length===0) return false;
  2531. if (opt.windowfocused!=true) {
  2532. opt.windowfocused = true;
  2533. punchgs.TweenLite.delayedCall(0.3,function(){
  2534. // TAB IS ACTIVE, WE CAN START ANY PART OF THE SLIDER
  2535. if (opt.fallbacks.nextSlideOnWindowFocus=="on") opt.c.revnext();
  2536. opt.c.revredraw();
  2537. if (opt.lastsliderstatus=="playing")
  2538. opt.c.revresume();
  2539. });
  2540. }
  2541. })
  2542. }
  2543. var lastStatBlur = function() {
  2544. jQuery('.rev_redraw_on_blurfocus').each(function() {
  2545. var opt = jQuery(this)[0].opt;
  2546. opt.windowfocused = false;
  2547. opt.lastsliderstatus = opt.sliderstatus;
  2548. opt.c.revpause();
  2549. var actsh = opt.c.find('.active-revslide .slotholder'),
  2550. nextsh = opt.c.find('.processing-revslide .slotholder');
  2551. if (nextsh.data('kenburns')=="on")
  2552. _R.stopKenBurn(nextsh,opt);
  2553. if (actsh.data('kenburns')=="on")
  2554. _R.stopKenBurn(actsh,opt);
  2555. });
  2556. }
  2557. var tabBlurringCheck = function() {
  2558. var notIE = (document.documentMode === undefined),
  2559. isChromium = window.chrome;
  2560. if (jQuery('body').data('revslider_focus_blur_listener')===1) return;
  2561. jQuery('body').data('revslider_focus_blur_listener',1);
  2562. if (notIE && !isChromium) {
  2563. // checks for Firefox and other NON IE Chrome versions
  2564. jQuery(window).on("focusin", function () {
  2565. restartOnFocus();
  2566. }).on("focusout", function () {
  2567. lastStatBlur();
  2568. });
  2569. } else {
  2570. // checks for IE and Chromium versions
  2571. if (window.addEventListener) {
  2572. // bind focus event
  2573. window.addEventListener("focus", function (event) {
  2574. restartOnFocus();
  2575. }, {capture:false,passive:true});
  2576. // bind blur event
  2577. window.addEventListener("blur", function (event) {
  2578. lastStatBlur();
  2579. }, {capture:false,passive:true});
  2580. } else {
  2581. // bind focus event
  2582. window.attachEvent("focus", function (event) {
  2583. restartOnFocus();
  2584. });
  2585. // bind focus event
  2586. window.attachEvent("blur", function (event) {
  2587. lastStatBlur();
  2588. });
  2589. }
  2590. }
  2591. }
  2592. // - GET THE URL PARAMETER //
  2593. var getUrlVars = function (hashdivider){
  2594. var vars = [], hash;
  2595. var hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_');
  2596. for(var i = 0; i < hashes.length; i++)
  2597. {
  2598. hashes[i] = hashes[i].replace('%3D',"=");
  2599. hash = hashes[i].split('=');
  2600. vars.push(hash[0]);
  2601. vars[hash[0]] = hash[1];
  2602. }
  2603. return vars;
  2604. }
  2605. })(jQuery);