PageSourceSearch

https://www.congresochihuahua.gob.mx/js/focus.js

js congresochihuahua.gob.mx collected 2026-10-02 11:52:24 UTC 2,983 bytes, 86 lines download raw bytes

1function initPage()
2{
3	clearFormFields({
4		clearInputs: true,
5		clearTextareas: true,
6		passwordFieldText: true,
7		addClassFocus: "focus",
8		filterClass: "default"
9	});
10}
11function clearFormFields(o)
12{
13	if (o.clearInputs == null) o.clearInputs = true;
14	if (o.clearTextareas == null) o.clearTextareas = true;
15	if (o.passwordFieldText == null) o.passwordFieldText = false;
16	if (o.addClassFocus == null) o.addClassFocus = false;
17	if (!o.filterClass) o.filterClass = "default";
18	if(o.clearInputs) {
19		var inputs = document.getElementsByTagName("input");
20		for (var i = 0; i < inputs.length; i++ ) {
21			if((inputs[i].type == "text" || inputs[i].type == "password") && inputs[i].className.indexOf(o.filterClass) == -1) {
22				inputs[i].valueHtml = inputs[i].value;
23				inputs[i].onfocus = function ()	{
24					if(this.valueHtml == this.value) this.value = "";
25					if(this.fake) {
26						inputsSwap(this, this.previousSibling);
27						this.previousSibling.focus();
28					}
29					if(o.addClassFocus && !this.fake) {
30						this.className += " " + o.addClassF
30ocus;
31						this.parentNode.className += " parent-" + o.addClassFocus;
32					}
33				}
34				inputs[i].onblur = function () {
35					if(this.value == "") {
36						this.value = this.valueHtml;
37						if(o.passwordFieldText && this.type == "password") inputsSwap(this, this.nextSibling);
38					}
39					if(o.addClassFocus) {
40						this.className = this.className.replace(o.addClassFocus, "");
41						this.parentNode.className = this.parentNode.className.replace("parent-"+o.addClassFocus, "");
42					}
43				}
44				if(o.passwordFieldText && inputs[i].type == "password") {
45					var fakeInput = document.createElement("input");
46					fakeInput.type = "text";
47					fakeInput.value = inputs[i].value;
48					fakeInput.className = inputs[i].className;
49					fakeInput.fake = true;
50					inputs[i].parentNode.insertBefore(fakeInput, inputs[i].nextSibling);
51					inputsSwap(inputs[i], null);
52				}
53			}
54		}
55	}
56	if(o.clearTextareas) {
57		var textareas = document.getElementsByTagName("textarea");
58		for(var i=0; i<textareas.length; i++) {
59			if(textareas[i].className.indexOf(o.filterClass) == -1) {
60				textareas[i].valueHtml = textareas[i].value;
61				textareas[i].onfocus = function() {
62					if(this.value == this.valueHtml) this.value = "";
63					if(o.addClassFocus) {
64						this.className += " " + o.addClassFocus;
65						this.parentNode.className += " parent-" + o.addClassFocus;
66					}
67				}
68				textareas[i].onblur = function() {
69					if(this.value == "") this.value = this.valueHtml;
70					if(o.addClassFocus) {
71						this.className = this.className.replace(o.addClassFocus, "");
72						this.parentNode.className = this.parentNode.className.replace("parent-"+o.addClassFocus, "");
73					}
74				}
75			}
76		}
77	}
78	function inputsSwap(el, el2) {
79		if(el) el.style.display = "none";
80		if(el2) el2.style.display = "inline";
81	}
82}
83if (window.addEventListener)
84	window.addEventListener("load", initPage, false);
85else if (window.attachEvent)
86	window.attachEvent("onload", initPage);

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.