aboutsummaryrefslogtreecommitdiffstats
path: root/peniquitous.js
blob: c858f4228e3e4eb457b25a95984139256ab556bd (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
(function() {
	// Additional types:
	//   * email
	//   * number
	//   * search
	//   * tel
	//   * url
	var all_inputs = document.querySelectorAll('input[type="text"]');

	for (var i = 0; i < all_inputs.length; i++) {
		all_inputs[i].addEventListener('keyup', function(e) {
			if (e.ctrlKey && e.keyCode === 80) {
				KeyEvent.simulate(0, 38, [], e.target);
			}
			else if (e.ctrlKey && e.keyCode === 78) {
				KeyEvent.simulate(0, 40, [], e.target);
			}
		});
	}
	
	window.setTimeout(function() {
		KeyEvent.simulate(0, 40, [], document.getElementById('lst-ib'));
		console.log('fired');
	}, 6000);
})();