commit: 0e60280c6f93f89766a510e22dbf3ad6a890e3bc
parent: 571273cffc7d621e75515870b9dabe913e1f63db
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 24 Mar 2019 16:09:47 +0100
Fixup render_mrf_settings
Diffstat:
M | about.js | 32 | ++++++++++++++++++-------------- |
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/about.js b/about.js
@@ -1,6 +1,22 @@
mrf_noscript = document.getElementById("mrf_noscript");
federation_list = document.getElementById("federation_list");
+var render_mrf_settings = function(name, settings) {
+ if(name && settings) {
+ html = "<li>"+name+":<ul>";
+
+ for(const [key, values] of Object.entries(settings)) {
+ html += "<li><code class='mrf_setting-key'>"+key+"</code>: <code class='mrf_settings-values'>"+values.join(", ")+"</code></li>"
+ }
+
+ html += "</ul></li>";
+
+ return html;
+ } else {
+ return "";
+ }
+};
+
request = new XMLHttpRequest();
request.onload = function()
{
@@ -14,8 +30,8 @@ request.onload = function()
federation_html += "</code></li>";
}
- if(federation_metadata.mrf_simple) { render_mrf_settings("MRF Simple", federation_metadata.mrf_simple); }
- if(federation_metadata.mrf_keyword) { render_mrf_settings("MRF Keywords", federation_metadata.mrf_keyword); }
+ federation_html += render_mrf_settings("MRF Simple", federation_metadata.mrf_simple);
+ federation_html += render_mrf_settings("MRF Keywords", federation_metadata.mrf_keyword);
if(federation_metadata.quarantined_instances) {
federation_html += "<li>Quarantined: <code>";
@@ -26,18 +42,6 @@ request.onload = function()
federation_list.innerHTML = federation_html;
};
-var render_mrf_settings = new function(name, settings) {
- html = "<li>"+name+":<ul>";
-
- for(const [key, values] of Object.entries(settings)) {
- html += "<li><code>"+key+"</code>: <code>"+values.join(", ")+"</code></li>"
- }
-
- html += "</ul></li>";
-
- return html;
-};
-
mrf_noscript.hidden = true;
request.open('GET', "https://queer.hacktivis.me/nodeinfo/2.0.json", true);