PageSourceSearch

https://istitutomariausiliatrice.it/wp-content/plugins/cryout-serious-slider/resources/slider.js?ver=1.4.1

js istitutomariausiliatrice.it collected 2026-09-24 12:46:36 UTC 9,710 bytes, 346 lines download raw bytes

vendor: 9,061 bytes, lines 1-317
1/*!
2 * Bootstrap v3.3.7 (http://getbootstrap.com)
3 * Copyright 2011-2015 Twitter, Inc.
4 * Licensed under the MIT license
5 */
6
7if (typeof jQuery === 'undefined') {
8  throw new Error('Bootstrap\'s JavaScript requires jQuery')
9}
10
11+function ($) {
12  'use strict';
13  var version = $.fn.jquery.split(' ')[0].split('.')
14  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
15	throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
16  }
17}(jQuery);
18
19/* ========================================================================
20 * Bootstrap: transition.js v3.3.7
21 * http://getbootstrap.com/javascript/#transitions
22 * ========================================================================
23 * Copyright 2011-2015 Twitter, Inc.
24 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
25 * ======================================================================== */
26
27
28+function ($) {
29  'use strict';
30
31  /* CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
32   * ============================================================ */
33
34  function transitionEnd() {
35	var el = document.createElement('bootstrap')
36
37	var transEndEventNames = {
38	  WebkitTransition : 'webkitTransitionEnd',
39	  MozTransition	: 'transitionend',
40	  OTransition	  : 'oTransitionEnd otransitionend',
41	  transition	   : 'transitionend'
42	}
43
44	for (var name in transEndEventNames) {
45	  if (el.style[name] !== undefined) {
46		return { end: transEndEventNames[name] }
47	  }
48	}
49
50	return false /* explicit for ie8 (._.) */
51  }
52
53  /* http://blog.alexmaccaw.com/css-transitions */
54  $.fn.emulateTransitionEnd = function (duration) {
55	var called = false
56	var $el = this
57	$(this).one('bsTransitionEnd', function () { called = true })
58	var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
59	setTimeout(callback, duration)
60	return this
61  }
62
63  $(function () {
64	$.support.transition = transitionEnd()
65
66	if (!$.support.transition) return
67
68	$.event.special.bsTransitionEnd = {
69	  bindType: $.support.transition.end,
70	  delegateType: $.support.transition.end,
71	  handle: function (e) {
72		if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
73	  }
74	}
75  })
76
77}(jQuery);
78
79
80
81/* ========================================================================
82 * Bootstrap: carousel.js v3.3.7
83 * http://getbootstrap.com/javascript/#carousel
84 * ========================================================================
85 * Copyright 2011-2015 Twitter, Inc.
86 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
87 * ======================================================================== */
88
89
90+function ($) {
91  'use strict';
92
93  /* CAROUSEL CLASS DEFINITION
94   * ========================= */
95
96  var Carousel = function (element, options) {
97	this.$element	= $(element)
98	this.$indicators = this.$element.find('.seriousslider-indicators-inside')
99	this.options	 = options
100	this.paused	  = null
101	this.sliding	 = null
102	this.interval	= null
103	this.$active	 = null
104	this.$items	  = null
105
106	this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
107
108	this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
109	  .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
110	  .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
111  }
112
113  Carousel.VERSION  = '3.3.7'
114
115  Carousel.DEFAULTS = {
116	interval: 5000,
117	stransition: 600,
118	pause: 'hover',
119	wrap: true,
120	keyboard: true
121  }
122
123
124  Carousel.prototype.keydown = function (e) {
125	if (/input|textarea/i.test(e.target.tagName)) return
126	switch (e.which) {
127	  case 37: this.prev(); break
128	  case 39: this.next(); break
129	  default: return
130	}
131
132	e.preventDefault()
133  }
134
135  Carousel.prototype.cycle = function (e) {
136	e || (this.paused = false)
137
138	this.interval && clearInterval(this.interval)
139
140	this.options.interval
141	  && !this.paused
142	  && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
143
144	return this
145  }
146
147  Carousel.prototype.getItemIndex = function (item) {
148	this.$items = item.parent().children('.item')
149	return this.$items.index(item || this.$active)
150  }
151
152  Carousel.prototype.getItemForDirection = function (direction, active) {
153	var activeIndex = this.getItemIndex(active)
154	var willWrap = (direction == 'prev' && activeIndex === 0)
155				|| (direction == 'next' && activeIndex == (this.$items.length - 1))
156	if (willWrap && !this.options.wrap) return active
157	var delta = direction == 'prev' ? -1 : 1
158	var itemIndex = (activeIndex + delta) % this.$items.length
159	return this.$items.eq(itemIndex)
160  }
161
162  Carousel.prototype.to = function (pos) {
163	var that		= this
164	var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
165
166	if (pos > (this.$items.length - 1) || pos < 0) return
167
168	if (this.sliding)	   return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) /* yes, "slid" */
169	if (activeIndex == pos) return this.pause().cycle()
170
171	return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
172  }
173
174  Carousel.prototype.pause = function (e) {
175	e || (this.paused = true)
176
177	if (this.$element.find('.next, .prev').length && $.support.transition) {
178	  this.$element.trigger($.support.transition.end)
179	  this.cycle(true)
180	}
181
182	this.interval = clearInterval(this.interval)
183
184	return this
185  }
186
187  Carousel.prototype.next = function () {
188	if (this.sliding) return
189	return this.slide('next')
190  }
191
192  Carousel.prototype.prev = function () {
193	if (this.sliding) return
194	return this.slide('prev')
195  }
196
197  Carousel.prototype.slide = function (type, next) {
198	var $active   = this.$element.find('.item.active')
199	var $next	 = next || this.getItemForDirection(type, $active)
200	var isCycling = this.interval
201	var direction = type == 'next' ? 'left' : 'right'
202	var that	  = this
203
204	if ($next.hasClass('active')) return (this.sliding = false)
205
206	var relatedTarget = $next[0]
207	var slideEvent = $.Event('slide.bs.carousel', {
208	  relatedTarget: relatedTarget,
209	  direction: direction
210	})
211	this.$element.trigger(slideEvent)
212	if (slideEvent.isDefaultPrevented()) return
213
214	this.sliding = true
215
216	isCycling && this.pause()
217
218	if (this.$indicators.length) {
219	  this.$indicators.find('.active').removeClass('active')
220	  var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
221	  $nextIndicator && $nextIndicator.addClass('active')
222	}
223
224	var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) /* yes, "slid" */
225	if ($.support.transition && this.$element.hasClass('seriousslider')) {
226	  $next.addClass(type)
227	  $next[0].offsetWidth /* force reflow */
228	  $active.addClass(direction)
229	  $next.addClass(direction)
230	  $active
231		.one('bsTransitionEnd', function () {
232		  $next.removeClass([type, direction].join(' ')).addClass('active')
233		  $active.removeClass(['active', direction].join(' '))
234		  that.sliding = false
235		  setTimeout(function () {
236			that.$element.trigger(slidEvent)
237		  }, 0)
238		})
239		.emulateTransitionEnd(this.options.stransition)
240		/*.emulateTransitionEnd(Carousel.TRANSITION_DURATION)*/
241	} else {
242	  $active.removeClass('active')
243	  $next.addClass('active')
244	  this.sliding = false
245	  this.$element.trigger(slidEvent)
246	}
247
248	isCycling && this.cycle()
249
250	return this
251  }
252
253
254  // CAROUSEL PLUGIN DEFINITION
255  // ==========================
256
257  function Plugin(option) {
258	return this.each(function () {
259	  var $this   = $(this);
260	  var data	= $this.data('bs.carousel');
261	  var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option);
262	  var action  = typeof option == 'string' ? option : options.slide;
263
264	  if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
265	  if (typeof option == 'number') data.to(option)
266	  else if (action) data[action]()
267	  else if (options.interval) data.pause().cycle()
268	})
269  }
270
271  var old = $.fn.carousel
272
273  $.fn.carousel			 = Plugin
274  $.fn.carousel.Constructor = Carousel
275
276
277  /* CAROUSEL NO CONFLICT
278   * ==================== */
279
280  $.fn.carousel.noConflict = function () {
281	$.fn.carousel = old
282	return this
283  }
284
285
286  /* CAROUSEL DATA-API
287   * ================= */
288
289  var clickHandler = function (e) {
290	var href
291	var $this   = $(this)
292	var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) /* strip for ie7 */
293	if (!$target.hasClass('seriousslider')) return
294	var options = $.extend({}, $target.data(), $this.data())
295	var slideIndex = $this.attr('data-slide-to')
296	if (slideIndex) options.interval = false
297
298	Plugin.call($target, options)
299
300	if (slideIndex) {
301	  $target.data('bs.carousel').to(slideIndex)
302	}
303
304	e.preventDefault()
305  }
306
307
308  $(document)
309	.on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
310	.on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
311
312}(jQuery);
313
314/* swipe support for mobile devices */
315document.addEventListener('DOMContentLoaded', function () {
316
317	const sliders = document.querySelectorAll('.cryout-serious-slider');
318	sliders.forEach(slider => {
319
320		let touchStartX = 0;
321		let touchEndX = 0;
322
323		slider.addEventListener('touchstart', function (e) {
324			touchStartX = e.changedTouches[0].screenX;
325		});
326
327		slider.addEventListener('touchend', function (e) {
328			touchEndX = e.changedTouches[0].screenX;
329			handleSwipe(slider);
330		});
331		
332		function handleSwipe(sliderElement) {
333			const threshold = 50; /* minimum px for a valid swipe */
334
335			if (touchEndX < touchStartX - threshold) {
336				jQuery(slider).carousel('next'); /* Swipe left */
337			}
338
339			if (touchEndX > touchStartX + threshold) {
340				jQuery(slider).carousel('prev'); /* Swipe right */
341			}
342		}
343	});
344});
345
346/* FIN */

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.