PageSourceSearch

https://www.ipvc.pt/ess/wp-content/themes/gsk-site-escola/js/skill/global.js?ver=0.0.1

js ipvc.pt collected 2026-10-01 11:26:37 UTC 2,870 bytes, 109 lines download raw bytes

1/**
2 * Shuffle an Array
3 * @return {Array}
4 *
5 * https://www.kirupa.com/html5/shuffling_array_js.htm
6 */
7Array.prototype.shuffle = function() {
8	
9	var input = this;
10
11	for ( var i=input.length-1; i >= 0; i-- ) {
12
13		var randomIndex = Math.floor( Math.random() * ( i + 1 ) ); 
14		var itemAtIndex = input[randomIndex]; 
15
16		input[randomIndex] = input[i]; 
17		input[i] = itemAtIndex;
18	}
19
20	return input;
21}
22
23/**
24 * Enable/Disable Scroll
25 */
26var keys = { 37: 1, 38: 1, 39: 1, 40: 1 };
27
28function preventDefault(e) {
29	e = e || window.event;
30	if (e.preventDefault)
31		e.preventDefault();
32	e.returnValue = false; 
33}
34
35function preventDefaultForScrollKeys(e) {
36	if (keys[e.keyCode]) {
37		preventDefault(e);
38		return false;
39	}
40}
41
42function disableScroll() {
43	if (window.addEventListener) // older FF
44		window.addEventListener('DOMMouseScroll', preventDefault, false);
45		window.onwheel = preventDefault; // modern standard
46		window.onmousewheel = document.onmousewheel = preventDefault; // older browsers, IE
47		window.ontouchmove  = preventDefault; // mobile
48}
49
50function enableScroll() {
51	if (window.removeEventListener)
52		window.removeEventListener('DOMMouseScroll', preventDefault, false);
53		window.onmousewheel = document.onmousewheel = null;
54		window.onwheel = null;
55		window.ontouchmove = null;
56}
57
58function createCookie( name, value, path ) {
59	var expires = "";
60	var date = new Date();
61	var midnight = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
62	expires = "; expires=" + midnight.toGMTString();
63
64	if (!path) {
65		path = "/";
66	}
67	
68	document.cookie = name + "=" + value + expires + "; path=" + path;
69}
70
71function setCookie(c_name, value, exdays){
72	try{
73		var exdate = new Date();
74	
75		exdate.setDate(exdate.getDate() + exdays);
76	
77		var c_value = escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
78	
79		document.cookie = c_name + "=" + c_value;
80
81	}catch(err){
82		//alert("setCookie "+err);
83	}
84}
85
86function getCookie(CookieName){
87	var CookieVal = null;
88	try{	
89	    if(document.cookie)	   //only if exists
90	    {
91	   	    var arr = document.cookie.split((escape(CookieName) + '=')); 
92	   	    if(arr.length >= 2)
93	   	    {
94	       	    var arr2 = arr[1].split(';');
95	   		    CookieVal  = unescape(arr2[0]); //unescape() : Decodes the String
96	   	    }
97	    }
98	}catch(err){
99		//alert("setCookie "+err);
100	}
101    return CookieVal;
102}
103
104// function translateManual() {			
105// 	document.getElementById("qtranxs_select_qtranslate-chooser").options[0].text = 'PT';
106// 	document.getElementById("qtranxs_select_qtranslate-chooser").options[1].text = 'EN';
107// 	document.getElementById("qtranxs_select_qtranslate--1-chooser").options[0].text = 'PT';
108// 	document.getElementById("qtranxs_select_qtranslate--1-chooser").options[1].text = 'EN';
109// };

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.