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