Merge branch 'Jack-1'

This commit is contained in:
jacktjong
2022-11-02 11:42:22 +01:00
5 changed files with 50 additions and 67 deletions

View File

@@ -68,26 +68,21 @@ var process_entities = function(message, entities) {
block.fn.tweets = function(config) {
var options = $.extend({
memory: 20
memory: 100
}, config);
<<<<<<< Updated upstream:template_static/lib/tweets.js
// create the necessary HTML in the block container
this.$element.append('<ol class="tweet-list stream-items"></ol>');
//this.$element.append('<ol class="tweet-list stream-items"></ol>');
=======
>>>>>>> Stashed changes:dashboard_static/lib/tweets.js
// store list for later
var $list = this.$element.find('ol');
var $list = $("div.tweetcontainer");
// register default handler for handling tweet data
this.actions(function(e, tweet){
tweets = window.sessionStorage.getItem('tweets');
tweets = JSON.parse(tweets);
tweets.push(tweet);
if(tweets.length >= options.memory) {
tweets.shift();
}
window.sessionStorage.setItem('tweets', JSON.stringify(tweets));
<<<<<<< Updated upstream:template_static/lib/tweets.js
var $item = $('<li class="stream-item"></li>');
var $tweet = $('<div class="tweet"></div>');
@@ -123,6 +118,17 @@ block.fn.tweets = function(config) {
$item.append($tweet);
// place new tweet in front of list
=======
tweets = window.sessionStorage.getItem('tweets');
tweets = JSON.parse(tweets);
tweets.push(tweet);
if(tweets.length >= options.memory) {
tweets.shift();
}
window.sessionStorage.setItem('tweets', JSON.stringify(tweets));
var $item = tweetCell(tweet)
>>>>>>> Stashed changes:dashboard_static/lib/tweets.js
$list.prepend($item);
// remove stale tweets