PageSourceSearch

https://www.wkforum.org/2022/assets/js/FWDRLHider.js?v=1790289095

js wkforum.org collected 2026-09-24 22:31:52 UTC 4,336 bytes, 159 lines download raw bytes

1/**
2 * Revolution Lightbox PACKAGED v3.0
3 * Hider manager to test touch or mouse inactivity.
4 *
5 * @author Tibi - FWDesign [https://webdesign-flash.ro/]
6 * Copyright © 2006 All Rights Reserved.
7 */
8(function (window){
9	
10    var FWDRLHider = function(screenToTest, hideDelay){
11    	
12    	var _s = this;
13    	var prototype = FWDRLHider.prototype;
14   
15    	_s.screenToTest = screenToTest;
16    	_s.hideDelay = hideDelay;
17    	_s.globalX = 0;
18    	_s.globalY = 0;
19	
20    	
21    	_s.dspOnceShow = true;
22    	_s.isStopped_bl = true;
23    	_s.isHidden_bl = false;
24    	_s.isMbl = FWDRLUtils.isMbl;
25    	_s.hasPointerEvt = FWDRLUtils.hasPointerEvent;
26    	
27		_s.start = function(){
28			_s.currentTime = new Date().getTime();
29			clearInterval(_s.check_int);
30			_s.check_int = setInterval(_s.update, 100);
31			_s.addMouseOrTouchCheck();
32			_s.isStopped_bl = false;
33			window.addEventListener("click", _s.reset);	
34		};
35		
36		_s.stop = function(){
37			clearInterval(_s.check_int);
38			_s.isStopped_bl = true;
39			_s.removeMT();
40			_s.removeMT2();
41			window.removeEventListener("click", _s.reset);	
42		};
43
44		_s.clickMHU = function(){
45			_s.dispatchEvent(FWDRLHider.SHOW);
46		}
47		
48		_s.addMouseOrTouchCheck = function(){	
49			if(_s.hasInitialTestEvents_bl) return;
50			_s.hasInitialTestEvents_bl = true;
51			if(_s.isMbl){
52				if(_s.hasPointerEvt){
53					_s.screenToTest.screen.addEventListener("pointerdown", _s.onMTUpdate);
54					_s.screenToTest.screen.addEventListener("pointermove", _s.onMTUpdate);
55				}else{
56					_s.screenToTest.screen.addEventListener("touchstart", _s.onMTUpdate);
57				}
58			}else{
59				window.addEventListener("mousemove", _s.onMTUpdate);
60				window.addEventListener("click", _s.onMTUpdate);
61			}
62		};
63		
64		_s.removeMT = function(){	
65			if(!_s.hasInitialTestEvents_bl) return;
66			_s.hasInitialTestEvents_bl = false;
67			if(_s.isMbl){
68				if(_s.hasPointerEvt){
69					_s.screenToTest.screen.removeEventListener("pointerdown", _s.onMTUpdate);
70					_s.screenToTest.screen.removeEventListener("pointermove", _s.onMTUpdate);
71				}else{
72					_s.screenToTest.screen.removeEventListener("touchstart", _s.onMTUpdate);
73				}
74			}else{
75				window.removeEventListener("mousemove", _s.onMTUpdate);
76			}
77		};
78		
79		_s.onMTUCheck2 = function(){	
80			if(_s.addSecondTestEvents_bl) return;
81			_s.addSecondTestEvents_bl = true;
82			_s.screenToTest.screen.addEventListener("mousemove", _s.secondTestMoveDummy);
83			_s.screenToTest.screen.addEventListener("click", _s.secondTestMoveDummy);
84		};
85		
86		_s.removeMT2 = function(){	
87			if(!_s.addSecondTestEvents_bl) return;
88			_s.addSecondTestEvents_bl = false;
89			_s.screenToTest.screen.removeEventListener("mousemove", _s.secondTestMoveDummy);
90			_s.screenToTest.screen.removeEventListener("click", _s.secondTestMoveDummy);
91		};
92		
93		_s.secondTestMoveDummy = function(){
94			_s.removeMT2();
95			_s.addMouseOrTouchCheck();
96		};
97		
98		_s.onMTUpdate = function(e){
99			var vmc = FWDRLUtils.getViewportMouseCoordinates(e);	
100			
101			if(_s.globalX != vmc.screenX
102			   && _s.globalY != vmc.screenY){
103				_s.currentTime = new Date().getTime();
104			}
105			
106			_s.globalX = vmc.screenX;
107			_s.globalY = vmc.screenY;
108			
109			if(!_s.isMbl){
110				if(!FWDRLUtils.hitTest(_s.screenToTest.screen, _s.globalX, _s.globalY)){
111					_s.removeMT();
112					_s.onMTUCheck2();
113				}
114			}
115		};
116	
117		_s.update = function(e){
118			if(new Date().getTime() > _s.currentTime + _s.hideDelay){
119				if(_s.dspOnceShow){	
120					_s.dspOnceHide = true;
121					_s.dspOnceShow = false;
122					_s.isHidden_bl = true;
123					_s.dispatchEvent(FWDRLHider.HIDE);
124					clearTimeout(_s.hideCompleteId_to);
125					_s.hideCompleteId_to = setTimeout(function(){
126						_s.dispatchEvent(FWDRLHider.HIDE_COMPLETE);
127					}, 1000);
128				}
129			}else{
130				if(_s.dspOnceHide){
131					clearTimeout(_s.hideCompleteId_to);
132					_s.dspOnceHide = false;
133					_s.dspOnceShow = true;
134					_s.isHidden_bl = false;
135					_s.dispatchEvent(FWDRLHider.SHOW);
136				}
137			}
138		};
139
140		_s.reset = function(){
141			_s.isHidden_bl = false;
142			clearTimeout(_s.hideCompleteId_to);
143			_s.currentTime = new Date().getTime();
144			_s.dispatchEvent(FWDRLHider.SHOW);
145		};
146		
147     };
148     
149	 FWDRLHider.HIDE = "hide";
150	 FWDRLHider.SHOW = "show";
151	 FWDRLHider.HIDE_COMPLETE = "hideComplete";
152	 
153	 FWDRLHider.setPrototype = function(){
154		 FWDRLHider.prototype = new FWDRLEventDispatcher();
155	 };
156	 
157
158	 window.FWDRLHider = FWDRLHider;
159}(window));

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.