logo

queer.hacktivis.me-meta

Unnamed repository; edit this file 'description' to name the repository.
commit: d9ecc56d7f6565dd8a6aa4ab622aede803a12df9
parent: 46d523c92ff7f93ddfb313df27d8cfdf28fe34ed
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun, 28 Oct 2018 11:15:50 +0100

about.js: Fix for non-spidermonkey engines

Diffstat:

Mabout.html2+-
Mabout.js11+++++------
2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/about.html b/about.html @@ -46,7 +46,7 @@ <h2>Federation</h2> <p>Quarantined means the instance doesn’t send posts that aren’t public or unlisted to try to avoid privacy leaks.</p> <h3>List of Federation Settings</h3> - <p class="noscript">You do not seem to have JavaScript enabled, sorry but for now either look in <a href="https://queer.hacktivis.me/nodeinfo/2.0.json">nodeinfo’s JSON</a> or enable JavaScript (the code is readable).</p> + <p id="mrf_noscript">You do not seem to have JavaScript enabled, sorry but for now either look in <a href="https://queer.hacktivis.me/nodeinfo/2.0.json">nodeinfo’s JSON</a> or enable JavaScript (the code is readable).</p> <ul id="federation_list"></ul> <script src="about.js"></script> <h3>Reasons</h3> diff --git a/about.js b/about.js @@ -1,4 +1,4 @@ -noscript = document.getElementsByClassName("noscript"); +mrf_noscript = document.getElementById("mrf_noscript"); federation_list = document.getElementById("federation_list"); request = new XMLHttpRequest(); @@ -15,10 +15,9 @@ request.onload = function() if(federation_metadata.mrf_simple) { federation_html += "<li>MRF Simple:<ul>"; - Array.forEach(Object.entries(federation_metadata.mrf_simple), function(policy) - { - federation_html += "<li>"+policy[0]+": "+policy[1].join(", ")+"</li>" - }); + for(const [key, values] of Object.entries(federation_metadata.mrf_simple)) { + federation_html += "<li>"+key+": "+values.join(", ")+"</li>" + }; federation_html += "</ul></li>"; } @@ -31,7 +30,7 @@ request.onload = function() federation_list.innerHTML = federation_html; }; -Array.forEach(noscript, function(e){e.hidden=true;}); +mrf_noscript.hidden = true; request.open('GET', "https://queer.hacktivis.me/nodeinfo/2.0.json", true); request.send();