Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: psvenk <45520974+psvenk@users.noreply.github.com>
  • Loading branch information
kdk1616 and psvenk authored Jan 20, 2021
1 parent e275eb5 commit 9d89519
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
16 changes: 5 additions & 11 deletions public/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -1268,18 +1268,12 @@ $.ajax("/version").then(ver => $("#version").text(ver));
$.ajax("/updates").then(upt => {
$("#updates").html(upt);
document.getElementById("changelog").outerHTML = "<h2 class='info-header'>Version History/What's New:</h2>";
var items = document.getElementById("updates").getElementsByTagName("h2");
for (var i = 0; i < items.length; i++) {
items[i].className = "info-header";
}
const items = document.querySelectorAll("#updates h2");
items.forEach(x => { x.className = "info-header"; });
//Hide Everything but first and second versions
for(var i = 3; i < items.length; i ++) {
items[i].style = "display: none";
}
items = document.getElementById("updates").getElementsByTagName("ul");
for(var i = 3; i < items.length; i ++) {
items[i].style = "display: none";
}
items.slice(3).forEach(x => { x.style.setProperty("display", "none") });
const subpoints = document.querySelectorAll("#updates ul");
subpoints.slice(3).forEach(x => { x.style.setProperty("display", "none") });


});
Expand Down
2 changes: 1 addition & 1 deletion serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ app.get('/version', (req, res) => res.send(version));

app.get('/updates', async (req, res) => {
const changelog = await fs.promises.readFile(__dirname + '/CHANGELOG.md');
res.send(marked("" + changelog));
res.send(marked(changelog.toString()));
});

app.use(function(req, res, next) { // enable cors
Expand Down

0 comments on commit 9d89519

Please sign in to comment.