Javier López-Contreras | 052503f | 2018-12-26 12:34:42 +0100 | [diff] [blame] | 1 | var seq = [38, 38, 40, 40, 37, 39, 37, 39, 65, 66, 13];
|
| 2 | var cur = 0;
|
| 3 |
|
| 4 | function 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 |
|
avm99963 | 027b5b0 | 2018-12-28 02:31:46 +0100 | [diff] [blame] | 26 | function initJustDoIt() {
|
Andreu Huguet | 65622cc | 2018-12-28 13:41:17 +0100 | [diff] [blame] | 27 | document.addEventListener("keydown", function(event) {
|
Javier López-Contreras | 052503f | 2018-12-26 12:34:42 +0100 | [diff] [blame] | 28 | 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 | }
|