blob: dfb4f6a4c98c60e2271502cc97f52fa486d937d1 [file] [log] [blame]
Javier López-Contreras052503f2018-12-26 12:34:42 +01001var seq = [38, 38, 40, 40, 37, 39, 37, 39, 65, 66, 13];
2var cur = 0;
3
4function justdoit() {
5 s.graph.nodes().forEach(function(n) {
6 switch(n.color) {
7 case "#d61c08":
8 n.color = "#0159aa";
9 break;
10
11 case "#0159aa":
12 n.color = "#0ca80a";
13 break;
14
15 case "#0ca80a":
16 n.color = "#d61c08";
17 break;
18 }
19 });
20
21 s.refresh();
22 setTimeout(justdoit, 333);
23}
24
25
avm99963027b5b02018-12-28 02:31:46 +010026function initJustDoIt() {
Andreu Huguet65622cc2018-12-28 13:41:17 +010027 document.addEventListener("keydown", function(event) {
Javier López-Contreras052503f2018-12-26 12:34:42 +010028 if (event.key == "f" && event.target.getAttribute("id") != "search-input") altSearchBar();
29 if (event.which == seq[cur]) {
30 if (cur < seq.length) {
31 ++cur;
32 if (cur == seq.length) {
33 justdoit();
34 }
35 }
36 } else cur = 0;
37 });
38}