summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ritter <tom@ritter.vg>2018-04-12 15:39:28 -0500
committerTom Ritter <tom@ritter.vg>2018-04-12 15:39:28 -0500
commitdfe0349b200bba3d62784a68257fc44ceaf32fc4 (patch)
tree0473252599516281edf172adc275d437a2eeffac
parent68232ece53be3b1a52cd417ebc39d5581c1836c3 (diff)
Enter in the textbox will load individual relay data.
Closes #25771
-rwxr-xr-xwebsite.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/website.py b/website.py
index da9690f..9e12145 100755
--- a/website.py
+++ b/website.py
@@ -1311,10 +1311,13 @@ class WebsiteWriter:
+ " dataLoaded = true;\n"
+ " lines = data.split('\\n');\n"
+ " for(i=0; i<lines.length; i++) {\n"
+ + " if (lines[i].trim().length == 0) continue;\n"
+ " parts = lines[i].split(':');\n"
+ + " if (parts.length != 3) { console.log('Strange line: ' + lines[i]); continue; }\n"
+ " fingerprint = parts[0];\n"
+ " nickname = parts[1];\n"
+ " indexes = parts[2].split(',')\n"
+ + " if (indexes.length != 2) { console.log('Strange line: ' + lines[i]); continue; }\n"
+ " relayIndexes[fingerprint] = { indexes, nickname };\n"
+ " }\n"
+ " console.log('Loaded relay offset data');\n"
@@ -1367,6 +1370,7 @@ class WebsiteWriter:
+ " $('#relay-addition-javascript-pointer').html('But you can add individual "
+ "relays from the current consensus here. <input type=\"text\" id=\"fingerprintBox\" "
+ "placeholder=\"Fingerprint\"/><input type=\"button\" onclick=\"loadData()\" value=\"Load\"/>');\n"
+ + " $('#fingerprintBox').on('keyup', function(e) { if(e.keyCode == 13) loadData(); });"
+ "</script>\n")
self._write_relay_info_tableHeader(False)