1/** 2 * Gestionnaire du slider 3 */ 4(function($) { 5 $.fn.TCTtiSlider = function(options) { 6 7 var opts = $.extend({}, $.fn.TCTtiSlider.defaults, options); 8 var $el = $(this); 9 10 var updateSizeOptions = function() { 11 // if mobile, set height + width to device dimensions 12 if ($('body.smartphone').length > 0) { 13 opts.autoScaleSliderWidth = $(window).width(); 14 opts.autoScaleSliderHeight = $(window).height(); 15 } else if ($('body.desktop').length > 0) { 16 opts.autoScaleSliderWidth = 1200; 17 opts.autoScaleSliderHeight = 350; 18 } else { 19 opts.autoScaleSliderWidth = 1200; 20 opts.autoScaleSliderHeight = 435; 21 } 22 }; 23 24 var initOptions = function() { 25 opts.autoPlay.enabled = $el.data('autoplayEnabled'); 26 opts.autoPlay.delay = $el.data('autoplayDelay'); 27 opts.transitionSpeed = $el.data('transitionSpeed'); 28 opts.transitionType = $el.data('transitionType'); 29 opts.randomizeSlides = $el.data('randomizeSlides'); 30 opts.sliderTouch = $el.data('sliderTouch'); 31 opts.arrowsNav = $el.data('arrowsNav'); 32 opts.controlNavigation = $el.data('controlNavigation'); 33 opts.loop = $el.data('loop'); 34 opts.fullscreen.enabled = $el.data('fullscreenEnabled'); 35 36 updateSizeOptions(); 37 }; 38 39 initOptions(); 40 41 $el.royalSlider(opts); 42 43 // Gestion du plein-écran 44 var slider = $el.data('royalSlider'); 45 46 slider.ev.on('rsEnterFullscreen', function() { 47 $('body').addClass('rsFullscreen'); 48 }); 49 50 slider.ev.on('rsExitFullscreen', function() { 51 $('body').removeClass('rsFullscreen'); 52 }); 53 54 55 $(window).on('TC:breakpointChanged', function(breakpoint) { 56 updateSizeOptions(); 57 58 // change opts 59 $.extend(slider.st, opts); 60 slider.updateSliderSize(); 61 }); 62 63 }; 64 65 $.fn.TCTtiSlider.defaults = { 66 autoHeight: true, 67 arrowsNav: false, 68 addActiveClass: true, 69 fadeinLoadedSlide: true, 70 controlNavigationSpacing: 0, 71 controlNavigation: 'tabs', 72 imageScaleMode: 'none', 73 imageAlignCenter: false, 74 loop: true, 75 loopRewind: true, 76 numImagesToPreload: 6, 77 keyboardNavEnabled: true, 78 usePreloader: false, 79 randomizeSlides: false, 80 sliderTouch: true, 81 sliderDrag: true, 82 fullscreen: { 83 enabled: true 84 }, 85 autoPlay: { 86 enabled: false 87 } 88 }; 89 90}(jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.