Onionr/onionr/static-data/www/ui/dist/js/timeline.js

28 lines
894 B
JavaScript
Raw Normal View History

2018-08-05 04:09:33 +00:00
/* just for testing rn */
Block.getBlocks({'type' : 'onionr-post', 'signed' : true, 'reverse' : true}, function(data) {
for(var i = 0; i < data.length; i++) {
try {
var block = data[i];
var post = new Post();
var user = new User();
var blockContent = JSON.parse(block.getContent());
user.setName('unknown');
user.setID(new String(block.getHeader('signer', 'unknown')));
post.setContent(blockContent['content']);
post.setPostDate(block.getDate());
post.setUser(user);
document.getElementById('onionr-timeline-posts').innerHTML += post.getHTML();
} catch(e) {
console.log(e);
}
}
});
2018-08-04 02:52:45 +00:00
2018-07-30 00:43:28 +00:00
function viewProfile(id, name) {
2018-08-05 04:16:42 +00:00
document.getElementById("onionr-profile-username").innerHTML = Sanitize.html(decodeURIComponent(name));
2018-07-30 00:43:28 +00:00
}