Skip to content

Commit b954af0

Browse files
author
Edward Hades
committed
ui: render content
1 parent 02e9268 commit b954af0

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

htdocs/js/chukchi.js

+11
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ Chukchi.getAllFeeds = function(start, count, unread, callback) {
9292
});
9393
};
9494

95+
Chukchi.getContent = function(content, callback) {
96+
var id = content;
97+
if(typeof(content) == 'object')
98+
id = content.id;
99+
this._ajax('content/' + id, {
100+
success: function(result) {
101+
callback(result);
102+
}
103+
});
104+
}
105+
95106
Chukchi.getEntries = function(feed, start, count, unread, callback) {
96107
var id = feed;
97108
if(typeof(feed) == 'object')

htdocs/js/chukchiui.js

+5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ function makeEntryBlock(entry) {
8585
$entry.find('.title').html(entry.title);
8686
$entry.find('.date').html(moment(entry.published).fromNow());
8787

88+
Chukchi.getContent(entry.content[0], function(content) {
89+
// TODO handle non-html, handle summary and expired content
90+
$entry.find('.text').html(content.data);
91+
});
92+
8893
return $entry;
8994
}
9095

0 commit comments

Comments
 (0)