PageSourceSearch

https://prime-drilling.de/modules/mod_counter/assets/counter.js

js prime-drilling.de collected 2026-10-07 19:38:01 UTC 18,111 bytes, 678 lines download raw bytes

1
2// Counter Bereich
3
4
5/*!
6Waypoints - 4.0.1
7Copyright © 2011-2016 Caleb Troughton
8Licensed under the MIT license.
9https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
10*/
11(function() {
12	'use strict'
13  
14	var keyCounter = 0
15	var allWaypoints = {}
16  
17	/* http://imakewebthings.com/waypoints/api/waypoint */
18	function Waypoint(options) {
19	  if (!options) {
20		throw new Error('No options passed to Waypoint constructor')
21	  }
22	  if (!options.element) {
23		throw new Error('No element option passed to Waypoint constructor')
24	  }
25	  if (!options.handler) {
26		throw new Error('No handler option passed to Waypoint constructor')
27	  }
28  
29	  this.key = 'waypoint-' + keyCounter
30	  this.options = Waypoint.Adapter.extend({}, Waypoint.defaults, options)
31	  this.element = this.options.element
32	  this.adapter = new Waypoint.Adapter(this.element)
33	  this.callback = options.handler
34	  this.axis = this.options.horizontal ? 'horizontal' : 'vertical'
35	  this.enabled = this.options.enabled
36	  this.triggerPoint = null
37	  this.group = Waypoint.Group.findOrCreate({
38		name: this.options.group,
39		axis: this.axis
40	  })
41	  this.context = Waypoint.Context.findOrCreateByElement(this.options.context)
42  
43	  if (Waypoint.offsetAliases[this.options.offset]) {
44		this.options.offset = Waypoint.offsetAliases[this.options.offset]
45	  }
46	  this.group.add(this)
47	  this.context.add(this)
48	  allWaypoints[this.key] = this
49	  keyCounter += 1
50	}
51  
52	/* Private */
53	Waypoint.prototype.queueTrigger = function(direction) {
54	  this.group.queueTrigger(this, direction)
55	}
56  
57	/* Private */
58	Waypoint.prototype.trigger = function(args) {
59	  if (!this.enabled) {
60		return
61	  }
62	  if (this.callback) {
63		this.callback.apply(this, args)
64	  }
65	}
66  
67	/* Public */
68	/* http://imakewebthings.com/waypoints/api/destroy */
69	Waypoint.prototype.destroy = function() {
70	  this.context.remove(this)
71	  this.group.remove(this)
72	  delete allWaypoints[this.key]
73	}
74  
75	/* Public */
76	/* http://imakewebthings.com/waypoints/api/disable */
77	Waypoint.prototype.disable = function() {
78	  this.enabled = false
79	  return this
80	}
81  
82	/* Public */
83	/* http://imakewebthings.com/waypoints/api/enable */
84	Waypoint.prototype.enable = function() {
85	  this.context.refresh()
86	  this.enabled = true
87	  return this
88	}
89  
90	/* Public */
91	/* http://imakewebthings.com/waypoints/api/next */
92	Waypoint.prototype.next = function() {
93	  return this.group.next(this)
94	}
95  
96	/* Public */
97	/* http://imakewebthings.com/waypoints/api/previous */
98	Waypoint.prototype.previous = function() {
99	  return this.group.previous(this)
100	}
101  
102	/* Private */
103	Waypoint.invokeAll = function(method) {
104	  var allWaypointsArray = []
105	  for (var waypointKey in allWaypoints) {
106		allWaypointsArray.push(allWaypoints[waypointKey])
107	  }
108	  for (var i = 0, end = allWaypointsArray.length; i < end; i++) {
109		allWaypointsArray[i][method]()
110	  }
111	}
112  
113	/* Public */
114	/* http://imakewebthings.com/waypoints/api/destroy-all */
115	Waypoint.destroyAll = function() {
116	  Waypoint.invokeAll('destroy')
117	}
118  
119	/* Public */
120	/* http://imakewebthings.com/waypoints/api/disable-all */
121	Waypoint.disableAll = function() {
122	  Waypoint.invokeAll('disable')
123	}
124  
125	/* Public */
126	/* http://imakewebthings.com/waypoints/api/enable-all */
127	Waypoint.enableAll = function() {
128	  Waypoint.Context.refreshAll()
129	  for (var waypointKey in allWaypoints) {
130		allWaypoints[waypointKey].enabled = true
131	  }
132	  return this
133	}
134  
135	/* Public */
136	/* http://imakewebthings.com/waypoints/api/refresh-all */
137	Waypoint.refreshAll = function() {
138	  Waypoint.Context.refreshAll()
139	}
140  
141	/* Public */
142	/* http://imakewebthings.com/waypoints/api/viewport-height */
143	Waypoint.viewportHeight = function() {
144	  return window.innerHeight || document.documentElement.clientHeight
145	}
146  
147	/* Public */
148	/* http://imakewebthings.com/waypoints/api/viewport-width */
149	Waypoint.viewportWidth = function() {
150	  return document.documentElement.clientWidth
151	}
152  
153	Waypoint.adapters = []
154  
155	Waypoint.defaults = {
156	  context: window,
157	  continuous: true,
158	  enabled: true,
159	  group: 'default',
160	  horizontal: false,
161	  offset: 0
162	}
163  
164	Waypoint.offsetAliases = {
165	  'bottom-in-view': function() {
166		return this.context.innerHeight() - this.adapter.outerHeight()
167	  },
168	  'right-in-view': function() {
169		return this.context.innerWidth() - this.adapter.outerWidth()
170	  }
171	}
172  
173	window.Waypoint = Waypoint
174  }())
175  ;(function() {
176	'use strict'
177  
178	function requestAnimationFrameShim(callback) {
179	  window.setTimeout(callback, 1000 / 60)
180	}
181  
182	var keyCounter = 0
183	var contexts = {}
184	var Waypoint = window.Waypoint
185	var oldWindowLoad = window.onload
186  
187	/* http://imakewebthings.com/waypoints/api/context */
188	function Context(element) {
189	  this.element = element
190	  this.Adapter = Waypoint.Adapter
191	  this.adapter = new this.Adapter(element)
192	  this.key = 'waypoint-context-' + keyCounter
193	  this.didScroll = false
194	  this.didResize = false
195	  this.oldScroll = {
196		x: this.adapter.scrollLeft(),
197		y: this.adapter.scrollTop()
198	  }
199	  this.waypoints = {
200		vertical: {},
201		horizontal: {}
202	  }
203  
204	  element.waypointContextKey = this.key
205	  contexts[element.waypointContextKey] = this
206	  keyCounter += 1
207	  if (!Waypoint.windowContext) {
208		Waypoint.windowContext = true
209		Waypoint.windowContext = new Context(window)
210	  }
211  
212	  this.createThrottledScrollHandler()
213	  this.createThrottledResizeHandler()
214	}
215  
216	/* Private */
217	Context.prototype.add = function(waypoint) {
218	  var axis = waypoint.options.horizontal ? 'horizontal' : 'vertical'
219	  this.waypoints[axis][waypoint.key] = waypoint
220	  this.refresh()
221	}
222  
223	/* Private */
224	Context.prototype.checkEmpty = function() {
225	  var horizontalEmpty = this.Adapter.isEmptyObject(this.waypoints.horizontal)
226	  var verticalEmpty = this.Adapter.isEmptyObject(this.waypoints.vertical)
227	  var isWindow = this.element == this.element.window
228	  if (horizontalEmpty && verticalEmpty && !isWindow) {
229		this.adapter.off('.waypoints')
230		delete contexts[this.key]
231	  }
232	}
233  
234	/* Private */
235	Context.prototype.createThrottledResizeHandler = function() {
236	  var self = this
237  
238	  function resizeHandler() {
239		self.handleResize()
240		self.didResize = false
241	  }
242  
243	  this.adapter.on('resize.waypoints', function() {
244		if (!self.didResize) {
245		  self.didResize = true
246		  Waypoint.requestAnimationFrame(resizeHandler)
247		}
248	  })
249	}
250  
251	/* Private */
252	Context.prototype.createThrottledScrollHandler = function() {
253	  var self = this
254	  function scrollHandler() {
255		self.handleScroll()
256		self.didScroll = false
257	  }
258  
259	  this.adapter.on('scroll.waypoints', function() {
260		if (!self.didScroll || Waypoint.isTouch) {
261		  self.didScroll = true
262		  Waypoint.requestAnimationFrame(scrollHandler)
263		}
264	  })
265	}
266  
267	/* Private */
268	Context.prototype.handleResize = function() {
269	  Waypoint.Context.refreshAll()
270	}
271  
272	/* Private */
273	Context.prototype.handleScroll = function() {
274	  var triggeredGroups = {}
275	  var axes = {
276		horizontal: {
277		  newScroll: this.adapter.scrollLeft(),
278		  oldScroll: this.oldScroll.x,
279		  forward: 'right',
280		  backward: 'left'
281		},
282		vertical: {
283		  newScroll: this.adapter.scrollTop(),
284		  oldScroll: this.oldScroll.y,
285		  forward: 'down',
286		  backward: 'up'
287		}
288	  }
289  
290	  for (var axisKey in axes) {
291		var axis = axes[axisKey]
292		var isForward = axis.newScroll > axis.oldScroll
293		var direction = isForward ? axis.forward : axis.backward
294  
295		for (var waypointKey in this.waypoints[axisKey]) {
296		  var waypoint = this.waypoints[axisKey][waypointKey]
297		  if (waypoint.triggerPoint === null) {
298			continue
299		  }
300		  var wasBeforeTriggerPoint = axis.oldScroll < waypoint.triggerPoint
301		  var nowAfterTriggerPoint = axis.newScroll >= waypoint.triggerPoint
302		  var crossedForward = wasBeforeTriggerPoint && nowAfterTriggerPoint
303		  var crossedBackward = !wasBeforeTriggerPoint && !nowAfterTriggerPoint
304		  if (crossedForward || crossedBackward) {
305			waypoint.queueTrigger(direction)
306			triggeredGroups[waypoint.group.id] = waypoint.group
307		  }
308		}
309	  }
310  
311	  for (var groupKey in triggeredGroups) {
312		triggeredGroups[groupKey].flushTriggers()
313	  }
314  
315	  this.oldScroll = {
316		x: axes.horizontal.newScroll,
317		y: axes.vertical.newScroll
318	  }
319	}
320  
321	/* Private */
322	Context.prototype.innerHeight = function() {
323	  /*eslint-disable eqeqeq */
324	  if (this.element == this.element.window) {
325		return Waypoint.viewportHeight()
326	  }
327	  /*eslint-enable eqeqeq */
328	  return this.adapter.innerHeight()
329	}
330  
331	/* Private */
332	Context.prototype.remove = function(waypoint) {
333	  delete this.waypoints[waypoint.axis][waypoint.key]
334	  this.checkEmpty()
335	}
336  
337	/* Private */
338	Context.prototype.innerWidth = function() {
339	  /*eslint-disable eqeqeq */
340	  if (this.element == this.element.window) {
341		return Waypoint.viewportWidth()
342	  }
343	  /*eslint-enable eqeqeq */
344	  return this.adapter.innerWidth()
345	}
346  
347	/* Public */
348	/* http://imakewebthings.com/waypoints/api/context-destroy */
349	Context.prototype.destroy = function() {
350	  var allWaypoints = []
351	  for (var axis in this.waypoints) {
352		for (var waypointKey in this.waypoints[axis]) {
353		  allWaypoints.push(this.waypoints[axis][waypointKey])
354		}
355	  }
356	  for (var i = 0, end = allWaypoints.length; i < end; i++) {
357		allWaypoints[i].destroy()
358	  }
359	}
360  
361	/* Public */
362	/* http://imakewebthings.com/waypoints/api/context-refresh */
363	Context.prototype.refresh = function() {
364	  /*eslint-disable eqeqeq */
365	  var isWindow = this.element == this.element.window
366	  /*eslint-enable eqeqeq */
367	  var contextOffset = isWindow ? undefined : this.adapter.offset()
368	  var triggeredGroups = {}
369	  var axes
370  
371	  this.handleScroll()
372	  axes = {
373		horizontal: {
374		  contextOffset: isWindow ? 0 : contextOffset.left,
375		  contextScroll: isWindow ? 0 : this.oldScroll.x,
376		  contextDimension: this.innerWidth(),
377		  oldScroll: this.oldScroll.x,
378		  forward: 'right',
379		  backward: 'left',
380		  offsetProp: 'left'
381		},
382		vertical: {
383		  contextOffset: isWindow ? 0 : contextOffset.top,
384		  contextScroll: isWindow ? 0 : this.oldScroll.y,
385		  contextDimension: this.innerHeight(),
386		  oldScroll: this.oldScroll.y,
387		  forward: 'down',
388		  backward: 'up',
389		  offsetProp: 'top'
390		}
391	  }
392  
393	  for (var axisKey in axes) {
394		var axis = axes[axisKey]
395		for (var waypointKey in this.waypoints[axisKey]) {
396		  var waypoint = this.waypoints[axisKey][waypointKey]
397		  var adjustment = waypoint.options.offset
398		  var oldTriggerPoint = waypoint.triggerPoint
399		  var elementOffset = 0
400		  var freshWaypoint = oldTriggerPoint == null
401		  var contextModifier, wasBeforeScroll, nowAfterScroll
402		  var triggeredBackward, triggeredForward
403  
404		  if (waypoint.element !== waypoint.element.window) {
405			elementOffset = waypoint.adapter.offset()[axis.offsetProp]
406		  }
407  
408		  if (typeof adjustment === 'function') {
409			adjustment = adjustment.apply(waypoint)
410		  }
411		  else if (typeof adjustment === 'string') {
412			adjustment = parseFloat(adjustment)
413			if (waypoint.options.offset.indexOf('%') > - 1) {
414			  adjustment = Math.ceil(axis.contextDimension * adjustment / 100)
415			}
416		  }
417  
418		  contextModifier = axis.contextScroll - axis.contextOffset
419		  waypoint.triggerPoint = Math.floor(elementOffset + contextModifier - adjustment)
420		  wasBeforeScroll = oldTriggerPoint < axis.oldScroll
421		  nowAfterScroll = waypoint.triggerPoint >= axis.oldScroll
422		  triggeredBackward = wasBeforeScroll && nowAfterScroll
423		  triggeredForward = !wasBeforeScroll && !nowAfterScroll
424  
425		  if (!freshWaypoint && triggeredBackward) {
426			waypoint.queueTrigger(axis.backward)
427			triggeredGroups[waypoint.group.id] = waypoint.group
428		  }
429		  else if (!freshWaypoint && triggeredForward) {
430			waypoint.queueTrigger(axis.forward)
431			triggeredGroups[waypoint.group.id] = waypoint.group
432		  }
433		  else if (freshWaypoint && axis.oldScroll >= waypoint.triggerPoint) {
434			waypoint.queueTrigger(axis.forward)
435			triggeredGroups[waypoint.group.id] = waypoint.group
436		  }
437		}
438	  }
439  
440	  Waypoint.requestAnimationFrame(function() {
441		for (var groupKey in triggeredGroups) {
442		  triggeredGroups[groupKey].flushTriggers()
443		}
444	  })
445  
446	  return this
447	}
448  
449	/* Private */
450	Context.findOrCreateByElement = function(element) {
451	  return Context.findByElement(element) || new Context(element)
452	}
453  
454	/* Private */
455	Context.refreshAll = function() {
456	  for (var contextId in contexts) {
457		contexts[contextId].refresh()
458	  }
459	}
460  
461	/* Public */
462	/* http://imakewebthings.com/waypoints/api/context-find-by-element */
463	Context.findByElement = function(element) {
464	  return contexts[element.waypointContextKey]
465	}
466  
467	window.onload = function() {
468	  if (oldWindowLoad) {
469		oldWindowLoad()
470	  }
471	  Context.refreshAll()
472	}
473  
474  
475	Waypoint.requestAnimationFrame = function(callback) {
476	  var requestFn = window.requestAnimationFrame ||
477		window.mozRequestAnimationFrame ||
478		window.webkitRequestAnimationFrame ||
479		requestAnimationFrameShim
480	  requestFn.call(window, callback)
481	}
482	Waypoint.Context = Context
483  }())
484  ;(function() {
485	'use strict'
486  
487	function byTriggerPoint(a, b) {
488	  return a.triggerPoint - b.triggerPoint
489	}
490  
491	function byReverseTriggerPoint(a, b) {
492	  return b.triggerPoint - a.triggerPoint
493	}
494  
495	var groups = {
496	  vertical: {},
497	  horizontal: {}
498	}
499	var Waypoint = window.Waypoint
500  
501	/* http://imakewebthings.com/waypoints/api/group */
502	function Group(options) {
503	  this.name = options.name
504	  this.axis = options.axis
505	  this.id = this.name + '-' + this.axis
506	  this.waypoints = []
507	  this.clearTriggerQueues()
508	  groups[this.axis][this.name] = this
509	}
510  
511	/* Private */
512	Group.prototype.add = function(waypoint) {
513	  this.waypoints.push(waypoint)
514	}
515  
516	/* Private */
517	Group.prototype.clearTriggerQueues = function() {
518	  this.triggerQueues = {
519		up: [],
520		down: [],
521		left: [],
522		right: []
523	  }
524	}
525  
526	/* Private */
527	Group.prototype.flushTriggers = function() {
528	  for (var direction in this.triggerQueues) {
529		var waypoints = this.triggerQueues[direction]
530		var reverse = direction === 'up' || direction === 'left'
531		waypoints.sort(reverse ? byReverseTriggerPoint : byTriggerPoint)
532		for (var i = 0, end = waypoints.length; i < end; i += 1) {
533		  var waypoint = waypoints[i]
534		  if (waypoint.options.continuous || i === waypoints.length - 1) {
535			waypoint.trigger([direction])
536		  }
537		}
538	  }
539	  this.clearTriggerQueues()
540	}
541  
542	/* Private */
543	Group.prototype.next = function(waypoint) {
544	  this.waypoints.sort(byTriggerPoint)
545	  var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
546	  var isLast = index === this.waypoints.length - 1
547	  return isLast ? null : this.waypoints[index + 1]
548	}
549  
550	/* Private */
551	Group.prototype.previous = function(waypoint) {
552	  this.waypoints.sort(byTriggerPoint)
553	  var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
554	  return index ? this.waypoints[index - 1] : null
555	}
556  
557	/* Private */
558	Group.prototype.queueTrigger = function(waypoint, direction) {
559	  this.triggerQueues[direction].push(waypoint)
560	}
561  
562	/* Private */
563	Group.prototype.remove = function(waypoint) {
564	  var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
565	  if (index > -1) {
566		this.waypoints.splice(index, 1)
567	  }
568	}
569  
570	/* Public */
571	/* http://imakewebthings.com/waypoints/api/first */
572	Group.prototype.first = function() {
573	  return this.waypoints[0]
574	}
575  
576	/* Public */
577	/* http://imakewebthings.com/waypoints/api/last */
578	Group.prototype.last = function() {
579	  return this.waypoints[this.waypoints.length - 1]
580	}
581  
582	/* Private */
583	Group.findOrCreate = function(options) {
584	  return groups[options.axis][options.name] || new Group(options)
585	}
586  
587	Waypoint.Group = Group
588  }())
589  ;(function() {
590	'use strict'
591  
592	var $ = window.jQuery
593	var Waypoint = window.Waypoint
594  
595	function JQueryAdapter(element) {
596	  this.$element = $(element)
597	}
598  
599	$.each([
600	  'innerHeight',
601	  'innerWidth',
602	  'off',
603	  'offset',
604	  'on',
605	  'outerHeight',
606	  'outerWidth',
607	  'scrollLeft',
608	  'scrollTop'
609	], function(i, method) {
610	  JQueryAdapter.prototype[method] = function() {
611		var args = Array.prototype.slice.call(arguments)
612		return this.$element[method].apply(this.$element, args)
613	  }
614	})
615  
616	$.each([
617	  'extend',
618	  'inArray',
619	  'isEmptyObject'
620	], function(i, method) {
621	  JQueryAdapter[method] = $[method]
622	})
623  
624	Waypoint.adapters.push({
625	  name: 'jquery',
626	  Adapter: JQueryAdapter
627	})
628	Waypoint.Adapter = JQueryAdapter
629  }())
630  ;(function() {
631	'use strict'
632  
633	var Waypoint = window.Waypoint
634  
635	function createExtension(framework) {
636	  return function() {
637		var waypoints = []
638		var overrides = arguments[0]
639  
640		if (framework.isFunction(arguments[0])) {
641		  overrides = framework.extend({}, arguments[1])
642		  overrides.handler = arguments[0]
643		}
644  
645		this.each(function() {
646		  var options = framework.extend({}, overrides, {
647			element: this
648		  })
649		  if (typeof options.context === 'string') {
650			options.context = framework(this).closest(options.context)[0]
651		  }
652		  waypoints.push(new Waypoint(options))
653		})
654  
655		return waypoints
656	  }
657	}
658  
659	if (window.jQuery) {
660	  window.jQuery.fn.waypoint = createExtension(window.jQuery)
661	}
662	if (window.Zepto) {
663	  window.Zepto.fn.waypoint = createExtension(window.Zepto)
664	}
665  }())
666  ;
667
668
669
670
671  /*!
672* jquery.counterup.js 1.0
673*
674* Copyright 2013, Benjamin Intal http://gambit.ph @bfintal
675* Released under the GPL v2 License
676*
677* Date: Nov 26, 2013
678*/(function(e){"use strict";e.fn.counterUp=function(t){var n=e.extend({time:400,delay:10},t);return this.each(function(){var t=e(this),r=n,i=function(){var e=[],n=r.time/r.delay,i=t.text(),s=/[0-9]+,[0-9]+/.test(i);i=i.replace(/,/g,"");var o=/^[0-9]+$/.test(i),u=/^[0-9]+\.[0-9]+$/.test(i),a=u?(i.split(".")[1]||[]).length:0;for(var f=n;f>=1;f--){var l=parseInt(i/n*f);u&&(l=parseFloat(i/n*f).toFixed(a));if(s)while(/(\d+)(\d{3})/.test(l.toString()))l=l.toString().replace(/(\d+)(\d{3})/,"$1,$2");e.unshift(l)}t.data("counterup-nums",e);t.text("0");var c=function(){t.text(t.data("counterup-nums").shift());if(t.data("counterup-nums").length)setTimeout(t.data("counterup-func"),r.delay);else{delete t.data("counterup-nums");t.data("counterup-nums",null);t.data("counterup-func",null)}};t.data("counterup-func",c);setTimeout(t.data("counterup-func"),r.delay)};t.waypoint(i,{offset:"100%",triggerOnce:!0})})}})(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.