Merge branch 'main' into ResponsiveCSS

This commit is contained in:
Tim Wijma
2022-11-02 11:48:17 +01:00

View File

@@ -71,54 +71,11 @@ block.fn.tweets = function(config) {
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>');
=======
>>>>>>> Stashed changes:dashboard_static/lib/tweets.js
// store list for later
var $list = $("div.tweetcontainer");
// register default handler for handling tweet data
this.actions(function(e, tweet){
<<<<<<< Updated upstream:template_static/lib/tweets.js
var $item = $('<li class="stream-item"></li>');
var $tweet = $('<div class="tweet"></div>');
var $content = $('<div class="content"></div>');
var $header = $('<div class="stream-item-header"></div>');
// Build a tag image and header:
var $account = $('<a class="account-group"></a>');
$account.attr("href", "http://twitter.com/" + tweet.user.screen_name);
var $avatar = $("<img>").addClass("avatar");
$avatar.attr("src", tweet.user.profile_image_url);
$account.append($avatar);
$account.append($('<strong class="fullname">' + tweet.user.name + '</strong>'));
$account.append($('<span>&nbsp;</span>'));
$account.append($('<span class="username"><s>@</s><b>' + tweet.user.screen_name + '</b></span>'));
$header.append($account);
// Build timestamp:
var $time = $('<small class="time"></small>');
$time.append($('<span>' + tweet.created_at + '</span>'));
$header.append($time);
$content.append($header);
// Build contents:
var text = process_entities(tweet.text, tweet.entities);
var $text = $('<p class="tweet-text">' + text + '</p>');
$content.append($text);
// Build outer structure of containing divs:
$tweet.append($content);
$item.append($tweet);
// place new tweet in front of list
=======
tweets = window.sessionStorage.getItem('tweets');
tweets = JSON.parse(tweets);
tweets.push(tweet);
@@ -128,7 +85,6 @@ block.fn.tweets = function(config) {
window.sessionStorage.setItem('tweets', JSON.stringify(tweets));
var $item = tweetCell(tweet)
>>>>>>> Stashed changes:dashboard_static/lib/tweets.js
$list.prepend($item);
// remove stale tweets