PageSourceSearch

https://sigpp.ifpa.edu.br/shared/javascript/ifpa.js

js ifpa.edu.br collected 2026-10-02 14:09:16 UTC 3,637 bytes, 114 lines download raw bytes

1function removerHtml(texto) {
2	texto = texto.replace(/<[^<>]*>/gi,"");
3	texto = texto.replace(/&gt;/gi, "-");
4	return texto.replace(/&[^&;]*;/gi,"");
5}
6function removerEspacos(texto) {
7	texto = texto.replace(/\s+/g," ");
8	return texto.replace(/^\s+|\s+$/g,"");
9}
10function procuraTitulo(objeto) {
11	var elemento = null;
12	if (objeto.tagName == "H2") {
13		elemento = objeto;
14	} else {
15		if (objeto.children != null) {
16			var elLength = objeto.children.length;
17			if (elLength > 0) {
18				var i = 0;
19				for (; i<objeto.children.length; i++) {
20					var item = objeto.children[i];
21					elemento = procuraTitulo(item);
22					if (elemento != null) {
23						if (elemento.parent == null) {
24							elemento.parent = objeto;
25						}
26						break;
27					}
28				}
29			}
30		}
31	}
32	return elemento;
33}
34function wikiIfpa(sistema,linkWiki) {
35	/* COMENTADO PELO IFPA PARA APONTAR PARA A PAGINA DE MANUAIS E NAO MAIS PARA O WIKI
36	var elemento = procuraTitulo(document.body);
37	if (elemento != null) {
38		var titulo = elemento.innerHTML;
39		titulo = removerHtml(titulo);
40		titulo = removerEspacos(titulo);
41		if (sistema != null) {
42			titulo = sistema+' - '+titulo;
43		}
44		var doisPontos = titulo.indexOf(":");
45		if (doisPontos != -1) {
46			titulo = titulo.substring(0,doisPontos)
47		}
48		// cria link
49		var linke = document.createElement("a");
50		linke.setAttribute("href", linkWiki+titulo);
51		linke.setAttribute("target", "_blank");
52		linke.innerHTML = "Ajuda/Wiki";
53		linke.setAttribute("style","color: red;");
54		// cria div
55		var divi = document.createElement("div");
56		divi.id = "wikiIFPA";
57		divi.setAttribute("style","float: right; padding: 4px 22px 2px 22px;");
58		divi.appendChild(linke);
59		// insere antes do titulo
60		elemento.parent.insertBefore(divi, elemento);
61	}
62	*/
63	var elemento = procuraTitulo(document.body);
64	if (elemento != null) {
65		// cria link
66		var linke = document.createElement("a");
67		linke.setAttribute("href", "http://www.dti.ifpa.edu.br/manuais/");
68		linke.setAttribute("target", "_blank");
69		linke.innerHTML = "Ajuda/Manuais";
70		linke.setAttribute("style","color: red;");
71		// cria div
72		var divi = document.createElement("div");
73		divi.id = "wikiIFPA";
74		divi.setAttribute("style","float: right; padding: 4px 22px 2px 22px;");
75		divi.appendChild(linke);
76		// insere antes do titulo
77		elemento.parent.insertBefore(divi, elemento);
78	}
79}
80var teclasEspeciais = new Array(Event.KEY_BACKSPACE, Event.KEY_TAB, Event.KEY_RETURN, Event.KEY_SHIFT, Event.KEY_ESC, Event.KEY_END, Event.KEY_HOME, Event.KEY_LEFT, Event.KEY_UP, Event.KEY_RIGHT, Event.KEY_DOWN, Event.KEY_DELETE);
81function formatarMascaraUFRN(src, event, mask) {
82	var i;
83
84	if (document.selection) // Internet Explorer
85		i = Math.abs(document.selection.createRange().moveStart("character", -1000000));
86	else // Firefox
87		i = src.selectionStart;
88
89	var saida = mask.substring(0,1);
90	var texto = mask.substring(i);
91	var rcode = event.which ? event.which : event.keyCode;
92
93	// Enter, backspace, delete e setas direcionais
94	if (teclasEspeciais.indexOf(rcode) != -1) {
95		return true;
96	} else {
97		if (texto.substring(0,1) != saida) {
98			src.value = src.value.substring(0,i) + texto.substring(0,1) + src.value.substring(i);
99			return true;
100		} else {
101			return false;
102		}
103	}
104}
105function formatarTelefoneComDDD(src, event) {
106	return formatarMascaraUFRN(src, event, '## ####-####');
107}
108function alertaAdiantamentoSalarial(obj) {
109	if (obj != null) {
110		if (obj.checked == true) {
111			alert("Prezado Servidor, Alertamos que o valor recebido referente ao adiantamento salarial equipara-se a um EMPRÉSTIMO, e será descontado, EM PARCELA ÚNICA, no contracheque, no mês subsequente ao término das férias.");
112		}
113	}
114}

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.