PageSourceSearch

https://www.processfolks.com/templates/rt_nuance/roksprocket/layouts/features/themes/scroller/scroller.js

js processfolks.com collected 2026-10-04 04:56:37 UTC 12,814 bytes, 374 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10
11((function(){
12	if (typeof this.RokSprocket == 'undefined') this.RokSprocket = {};
13	else Object.merge(this.RokSprocket, {Scroller: null});
14
15	var Scroller = new Class({
16
17		Extends: this.RokSprocket.Features,
18
19		options: {
20			curve: 'cubic-bezier(0.37,0.61,0.59,0.87)',
21			duration: '400ms',
22			data: 'scroller',
23			settings: {
24				animation: 'crossfade',
25				autoplay: false,
26				delay: 5
27			}
28		},
29
30		initialize: function(options){
31			this.parent(options);
32
33			Object.merge(this.animations.crossfade, {top: 0, left: 0});
34		},
35
36		animate: function(container, from, to){
37			var panes = container.getElements('[data-' + this.data + '-pane]'),
38				settings = this.getSettings(container),
39				animation = this.animations[settings.animation] || this.animations.crossfade,
40				current = panes[from],
41				next = panes[to];
42
43			if (Browser.ie && Browser.version < 8){
44				contents.setStyle('zoom', 1);
45				images.setStyle('zoom', 1);
46			}
47
48			var transition = settings.animation == 'random' ? this.getRandom() : animation,
49				initialStyles = {display: 'block', 'z-index': 2, 'position': 'absolute', 'opacity': 0};
50
51			['top', 'right', 'bottom', 'left'].each(function(dir){
52				next.style[dir] = '';
53			}, this);
54
55			panes.styles(Object.merge({}, transition.from, {position: 'absolute'}));
56			current.styles(Object.merge({}, transition.to, {'z-index': 1, position: 'relative'}));
57			next.styles(Object.merge({}, transition.from, initialStyles));
58
59			if (Browser.ie && Browser.version < 9){
60				next.set('morph', {
61					link: 'cancel',
62					duration: this.options.duration.toInt(),
63					transition: 'quad:in:out',
64					onComplete: function(){
65						next.styles(Object.merge({}, transition.to, {position: 'relative'}));
66						current.styles(Object.merge({}, transition.from, {position: 'absolute', display: 'none'}));
67						next.get('morph').removeEvents('onComplete');
68
69						if (settings.autoplay && settings.autoplay.toInt()) this.startTimer(container);
70					}.bind(this)
71				}).morph(transition.to);
72
73				current.set('morph', {
74					link: 'cancel',
75					duration: this.options.duration.toInt(),
76					transition: 'quad:in:out'
77				}).morph(transition.from);
78			} else {
79				next.moofx(transition.to, {
80					duration: this.options.duration,
81					equation: this.options.curve,
82					callback: function(){
83						next.styles(Object.merge({}, transition.to, {position: 'relative'}));
84						current.styles(Object.merge({}, transition.from, {position: 'absolute'}));
85
86						if (settings.autoplay && settings.autoplay.toInt()) this.startTimer(container);
87					}.bind(this)
88				});
89
90				current.moofx(transition.from, {
91					duration: this.options.duration,
92					equation: this.options.curve
93				});
94			}
95
96		}
97
98	});
99
100	this.RokSprocket.Scroller = Scroller;
101
102})());
103
104;(function(window, undefined)
105{
106    "use strict";
107
108    function extend()
109    {
110        for(var i=1; i < arguments.length; i++)
111        {
112            for(var key in arguments[i])
113            {
114                if(arguments[i].hasOwnProperty(key))
115                {
116                    arguments[0][key] = arguments[i][key];
117                }
118            }
119        }
120        return arguments[0];
121    }
122
123    var pluginName = "tinyscrollbar"
124    ,   defaults   =
125        {
126            axis         : 'y'    // Vertical or horizontal scrollbar? ( x || y ).
127        ,   wheel        : true   // Enable or disable the mousewheel;
128        ,   wheelSpeed   : 40     // How many pixels must the mouswheel scroll at a time.
129        ,   wheelLock    : true   // Lock default scrolling window when there is no more content.
130        ,   scrollInvert : false  // Enable invert style scrolling
131        ,   trackSize    : false  // Set the size of the scrollbar to auto or a fixed number.
132        ,   thumbSize    : false  // Set the size of the thumb to auto or a fixed number.
133        }
134    ;
135
136    function Plugin($container, options)
137    {
138        this.options   = extend({}, defaults, options);
139        this._defaults = defaults;
140        this._name     = pluginName;
141
142        var self        = this
143        ,   $body       = document.querySelectorAll("body")[0]
144        ,   $viewport   = $container.querySelectorAll(".viewport")[0]
145        ,   $overview   = $container.querySelectorAll(".overview")[0]
146        ,   $scrollbar  = $container.querySelectorAll(".scrollbar")[0]
147        ,   $track      = $scrollbar.querySelectorAll(".track")[0]
148        ,   $thumb      = $scrollbar.querySelectorAll(".thumb")[0]
149
150        ,   mousePosition  = 0
151        ,   isHorizontal   = this.options.axis === 'x'
152        ,   hasTouchEvents = ("ontouchstart" in document.documentElement)
153        ,   wheelEvent     = ("onwheel" in document || document.documentMode >= 9) ? "wheel" :
154                             (document.onmousewheel !== undefined ? "mousewheel" : "DOMMouseScroll")
155
156        ,   sizeLabel = isHorizontal ? "width" : "height"
157        ,   posiLabel = isHorizontal ? "left" : "top"
158        ,   moveEvent = document.createEvent("HTMLEvents")
159        ;
160
161        moveEvent.initEvent("move", true, true);
162
163        this.contentPosition = 0;
164        this.viewportSize    = 0;
165        this.contentSize     = 0;
166        this.contentRatio    = 0;
167        this.trackSize       = 0;
168        this.trackRatio      = 0;
169        this.thumbSize       = 0;
170        this.thumbPosition   = 0;
171
172        function initialize()
173        {
174            self.update();
175            setEvents();
176
177            return self;
178        }
179
180        this.update = function(scrollTo)
181        {
182            var sizeLabelCap  = sizeLabel.charAt(0).toUpperCase() + sizeLabel.slice(1).toLowerCase();
183            this.viewportSize = $viewport['offset'+ sizeLabelCap];
184            this.contentSize  = $overview['scroll'+ sizeLabelCap];
185            this.contentRatio = this.viewportSize / this.contentSize;
186            this.trackSize    = this.options.trackSize || this.viewportSize;
187            this.thumbSize    = Math.min(this.trackSize, Math.max(0, (this.options.thumbSize || (this.trackSize * this.contentRatio))));
188            this.trackRatio   = this.options.thumbSize ? (this.contentSize - this.viewportSize) / (this.trackSize - this.thumbSize) : (this.contentSize / this.trackSize);
189
190            var scrcls = $scrollbar.className;
191            $scrollbar.className = this.contentRatio >= 1 ? scrcls + " disable" : scrcls.replace(" disable", "");
192
193            switch (scrollTo)
194            {
195                case "bottom":
196                    this.contentPosition = this.contentSize - this.viewportSize;
197                    break;
198
199                case "relative":
200                    this.contentPosition = Math.min(this.contentSize - this.viewportSize, Math.max(0, this.contentPosition));
201                    break;
202
203                default:
204                    this.contentPosition = parseInt(scrollTo, 10) || 0;
205            }
206
207            setSize();
208        };
209
210        function setSize()
211        {
212            $thumb.style[posiLabel] = self.contentPosition / self.trackRatio + "px";
213            $overview.style[posiLabel] = -self.contentPosition + "px";
214            $scrollbar.style[sizeLabel] = self.trackSize + "px";
215            $track.style[sizeLabel] = self.trackSize + "px";
216            $thumb.style[sizeLabel] = self.thumbSize + "px";
217        }
218
219        function setEvents()
220        {
221            if(hasTouchEvents)
222            {
223                $viewport.ontouchstart = function(event)
224                {
225                    if(1 === event.touches.length)
226                    {
227                        start(event.touches[0]);
228                        event.stopPropagation();
229                    }
230                };
231            }
232            else
233            {
234                $thumb.onmousedown = start;
235                $track.onmousedown = drag;
236            }
237
238            window.addEventListener("resize", function()
239            {
240               self.update("relative");
241            }, true);
242
243            if(self.options.wheel && window.addEventListener)
244            {
245                $container.addEventListener(wheelEvent, wheel, false );
246            }
247            else if(self.options.wheel)
248            {
249                $container.onmousewheel = wheel;
250            }
251        }
252
253        function start(event)
254        {
255            $body.className   += " noSelect";
256            mousePosition      = isHorizontal ? event.pageX : event.pageY;
257            self.thumbPosition = parseInt($thumb.style[posiLabel], 10) || 0;
258
259            if(hasTouchEvents)
260            {
261                document.ontouchmove = function(event)
262                {
263                    event.preventDefault();
264                    drag(event.touches[0]);
265                };
266                document.ontouchend = end;
267            }
268            else
269            {
270                document.onmousemove = drag;
271                document.onmouseup = $thumb.onmouseup = end;
272            }
273        }
274
275        function wheel(event)
276        {
277            if(self.contentRatio < 1)
278            {
279                var evntObj         = event || window.event
280                ,   deltaDir        = "delta" + self.options.axis.toUpperCase()
281                ,   wheelSpeedDelta = -(evntObj[deltaDir] || evntObj.detail || (-1 / 3 * evntObj.wheelDelta)) / 40
282                ;
283
284                self.contentPosition -= wheelSpeedDelta * self.options.wheelSpeed;
285                self.contentPosition = Math.min((self.contentSize - self.viewportSize), Math.max(0, self.contentPosition));
286
287                $container.dispatchEvent(moveEvent);
288
289                $thumb.style[posiLabel]    = self.contentPosition / self.trackRatio + "px";
290                $overview.style[posiLabel] = -self.contentPosition + "px";
291
292                if(self.options.wheelLock || (self.contentPosition !== (self.contentSize - self.viewportSize) && self.contentPosition !== 0))
293                {
294                    evntObj.preventDefault();
295                }
296            }
297        }
298
299        function drag(event)
300        {
301            if(self.contentRatio < 1)
302            {
303                var mousePositionNew   = isHorizontal ? event.pageX : event.pageY
304                ,   thumbPositionDelta = mousePositionNew - mousePosition
305                ;
306
307                if(self.options.scrollInvert && hasTouchEvents)
308                {
309                    thumbPositionDelta = mousePosition - mousePositionNew;
310                }
311
312                var thumbPositionNew = Math.min((self.trackSize - self.thumbSize), Math.max(0, self.thumbPosition + thumbPositionDelta));
313                self.contentPosition = thumbPositionNew * self.trackRatio;
314
315                $container.dispatchEvent(moveEvent);
316
317                $thumb.style[posiLabel] = thumbPositionNew + "px";
318                $overview.style[posiLabel] = -self.contentPosition + "px";
319            }
320        }
321
322        function end()
323        {
324            $body.className = $body.className.replace(" noSelect", "");
325            document.onmousemove = document.onmouseup = null;
326            $thumb.onmouseup = null;
327            document.ontouchmove = document.ontouchend = null;
328        }
329
330        return initialize();
331    }
332
333    var tinyscrollbar = function($container, options)
334    {
335        return new Plugin($container, options);
336    };
337
338    if(typeof define == 'function' && define.amd)
339    {
340        define(function(){ return tinyscrollbar; });
341    }
342    else if(typeof module === 'object' && module.exports)
343    {
344        module.exports = tinyscrollbar;
345    }
346    else
347    {
348        window.tinyscrollbar = tinyscrollbar;
349    }
350})(window);
351
352
353}
354
355/*
356     FILE ARCHIVED ON 08:59:39 Apr 17, 2022 AND RETRIEVED FROM THE
357     INTERNET ARCHIVE ON 11:06:30 Feb 05, 2026.
358     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
359
360     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
361     SECTION 108(a)(3)).
362*/
363/*
364playback timings (ms):
365  captures_list: 2.379
366  exclusion.robots: 0.015
367  exclusion.robots.policy: 0.006
368  esindex: 0.007
369  cdx.remote: 24.862
370  LoadShardBlock: 102.332 (3)
371  PetaboxLoader3.datanode: 125.451 (4)
372  load_resource: 97.211
373  PetaboxLoader3.resolve: 71.27
374*/

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.