|
|
@ -2,8 +2,8 @@ var ModuleFeed = { |
|
|
|
template: { |
|
|
|
template: { |
|
|
|
feed: { |
|
|
|
feed: { |
|
|
|
item: { |
|
|
|
item: { |
|
|
|
append: function(feed, userName, time, message, reTwist) { |
|
|
|
append: function(feed, item) { |
|
|
|
if (reTwist === undefined || reTwist.length == 0) { |
|
|
|
if (item.reTwist === undefined || item.reTwist.length == 0) { |
|
|
|
var rt = false; |
|
|
|
var rt = false; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var rt = $( |
|
|
|
var rt = $( |
|
|
@ -14,28 +14,28 @@ var ModuleFeed = { |
|
|
|
'class': 'info' |
|
|
|
'class': 'info' |
|
|
|
}).append( |
|
|
|
}).append( |
|
|
|
$('<a/>', { |
|
|
|
$('<a/>', { |
|
|
|
'href': 'people/' + reTwist.userName |
|
|
|
'href': 'people/' + item.reTwist.userName |
|
|
|
}).append(reTwist.userName) |
|
|
|
}).append(item.reTwist.userName) |
|
|
|
).append( |
|
|
|
).append( |
|
|
|
$('<span/>', { |
|
|
|
$('<span/>', { |
|
|
|
'class': 'time' |
|
|
|
'class': 'time' |
|
|
|
}).append( |
|
|
|
}).append( |
|
|
|
reTwist.time |
|
|
|
item.reTwist.time |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
).append(reTwist.message) |
|
|
|
).append(item.reTwist.message) |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
$(feed).append( |
|
|
|
$(feed).append( |
|
|
|
$('<div/>', { |
|
|
|
$('<div/>', { |
|
|
|
'class': 'item', |
|
|
|
'class': 'item', |
|
|
|
'data-username': userName |
|
|
|
'data-username': item.userName, |
|
|
|
}).append( |
|
|
|
}).append( |
|
|
|
$('<div/>', { |
|
|
|
$('<div/>', { |
|
|
|
'class': 'avatar' |
|
|
|
'class': 'avatar' |
|
|
|
}).append( |
|
|
|
}).append( |
|
|
|
$('<a/>', { |
|
|
|
$('<a/>', { |
|
|
|
'href': 'people/' + userName |
|
|
|
'href': 'people/' + item.userName |
|
|
|
}).append( |
|
|
|
}).append( |
|
|
|
$('<img/>', { |
|
|
|
$('<img/>', { |
|
|
|
'src': '', |
|
|
|
'src': '', |
|
|
@ -51,19 +51,19 @@ var ModuleFeed = { |
|
|
|
'class': 'info' |
|
|
|
'class': 'info' |
|
|
|
}).append( |
|
|
|
}).append( |
|
|
|
$('<a/>', { |
|
|
|
$('<a/>', { |
|
|
|
'href': 'people/' + userName |
|
|
|
'href': 'people/' + item.userName |
|
|
|
}).append(userName) |
|
|
|
}).append(item.userName) |
|
|
|
).append( |
|
|
|
).append( |
|
|
|
$('<span/>', { |
|
|
|
$('<span/>', { |
|
|
|
'class': 'time' |
|
|
|
'class': 'time' |
|
|
|
}).append( |
|
|
|
}).append( |
|
|
|
time |
|
|
|
item.time |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
).append(rt).append( |
|
|
|
).append(rt).append( |
|
|
|
$('<div/>', { |
|
|
|
$('<div/>', { |
|
|
|
'class': (message != '' ? 'quote' : '') |
|
|
|
'class': (item.message != '' ? 'quote' : '') |
|
|
|
}).append(message) |
|
|
|
}).append(item.message) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
@ -112,7 +112,7 @@ var ModuleFeed = { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$(response.posts).each(function() { |
|
|
|
$(response.posts).each(function() { |
|
|
|
ModuleFeed.template.feed.item.append(feed, this.userName, this.time, this.message, this.reTwist); |
|
|
|
ModuleFeed.template.feed.item.append(feed, this); |
|
|
|
ModuleFeed.loadAvatar(feed, this.userName); |
|
|
|
ModuleFeed.loadAvatar(feed, this.userName); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|