Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #30 from Bunnbuns/master
Browse files Browse the repository at this point in the history
fix slow user posts population
  • Loading branch information
herronjo committed Dec 16, 2019
2 parents 093e5cc + 232c2fc commit d170a7b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/user.js
@@ -1,8 +1,10 @@
var posts = '';

function toLink(item) {
try {
var i = item.indexOf(':');
var splits = [item.slice(0, i), item.slice(i + 1)];
document.getElementById("posts").innerHTML = document.getElementById("posts").innerHTML.concat('<div class="posts"><a class="nodec" href="post.html?id=').concat(splits[0]).concat('">').concat(splits[1].replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")).concat("</a></div><br>");
posts += document.getElementById("posts").innerHTML.concat('<div class="posts"><a class="nodec" href="post.html?id=').concat(splits[0]).concat('">').concat(splits[1].replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")).concat("</a></div><br>");
} catch (err) {
console.log("Whoops");
}
Expand All @@ -16,6 +18,7 @@ function getPosts(id) {
for (i = 0; i < tmp.length - 1; i++) {
toLink(tmp[i]);
}
document.getElementById('posts').innerHTML = posts;
}

function getStuff(id) {
Expand Down

0 comments on commit d170a7b

Please sign in to comment.