aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/go_input.js
blob: fedbd905a9463f6217e846869562336c9811d304 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var elements = document.querySelectorAll("textarea, input" + [
	":not([type='button'])",
	":not([type='checkbox'])",
	":not([type='hidden'])",
	":not([type='image'])",
	":not([type='radio'])",
	":not([type='reset'])",
	":not([type='submit'])"].join(""));
function gi() {
	if (elements) {
		var el, i = 0;
		while((el = elements[i++])) {
			var style=getComputedStyle(el, null);
			if (style.display !== 'none' && style.visibility === 'visible') {
				if (el.type === "file") {
					el.click();
				}
				else {
					el.focus();
				}
				return "XXXFORM_ACTIVEXXX";
			}
		}
	}
}

gi();