Commit bb3f113c authored by Roland Denis's avatar Roland Denis
Browse files

Adding tweet author and replacing ids by classes.

parent 369bed0a
Pipeline #3302 passed with stages
in 16 seconds
......@@ -421,12 +421,22 @@ a:hover{
color: #3fc5dc;
}
.twitter .hashtag a {
.twitter-hashtag a {
font-family: 'Roboto', serif;
font-size: 13px;
font-weight: 700;
}
a.twitter-link {
display: block;
}
a.twitter-author {
font-family: inherit;
font-size: inherit;
font-weight: inherit;
}
.twitter img.comma {
position: absolute;
top: 0px;
......
......@@ -123,21 +123,22 @@
<div class="carousel-item {% if tweet_id == 0 %}active{% endif %}">
<div class="container pb-4">
<img src="{{SITEURL}}/theme/img/twitter_comma.png" class="comma" />
<span class="share d-flex flex-row-reverse p-4"><a id="twitter-share" href="#">Partager</a></span>
<span class="share d-flex flex-row-reverse p-4"><a class="twitter-share" href="#">Partager</a></span>
<a href="https://twitter.com/{{TWITTER['user']}}" target="_blank" style="display:block">
<h1 class="pt-4">GroupeCalcul@twitter</h1>
</a>
<ul class="list-inline">
<li id="twitter-date" class="list-inline-item m-0 px-1">Date</li>
<li id="twitter-hashtag" class="hashtag list-inline-item m-0 px-1">#hashtag</li>
<li class="list-inline-item m-0 px-1"><span class="twitter-date">Date</span></li>
<li class="list-inline-item m-0 px-1"><span class="twitter-hashtag">#hashtag</span></li>
<!--<li class="list-inline-item m-0 px-1"> <img src="{{SITEURL}}/theme/img/twitter_refresh.png" />Rafraîchir</li>-->
<li class="list-inline-item m-0 px-1"><a class="twitter-author" href="#" target="_blank">@author</a></li>
</ul>
<div class="container px-0">
<div class="container" style="width:90%;">
<a id="twitter-link" href="#" target="_blank" style="display:block">
<p id="twitter-text">Contenu</p>
<a class="twitter-link" href="#" target="_blank">
<p class="twitter-text">Contenu</p>
</a>
</div>
</div>
......@@ -186,13 +187,18 @@
function customizeTweet(tweet_id) {
input_tweet = $($('.twitter').find('.twitter-timeline').contents().find('li.timeline-TweetList-tweet')[tweet_id]);
output_tweet = $($('#twitterCarousel').find('.carousel-item')[tweet_id]);
output_tweet.find('#twitter-text').html(input_tweet.find('p.timeline-Tweet-text').html());
output_tweet.find('#twitter-date').html(capitalizeFirstLetter(input_tweet.find('time').attr('aria-label').substring(7)));
output_tweet.find('#twitter-share').attr('href', input_tweet.find('a.timeline-ShareMenu-option').attr('href'));
output_tweet.find('#twitter-link').attr('href', input_tweet.find('.timeline-Tweet').attr('data-click-to-open-target'));
output_tweet.find('.twitter-text').html(input_tweet.find('p.timeline-Tweet-text').html());
output_tweet.find('.twitter-date').html(capitalizeFirstLetter(input_tweet.find('time').attr('aria-label').substring(7)));
output_tweet.find('.twitter-share').attr('href', input_tweet.find('a.timeline-ShareMenu-option').attr('href'));
output_tweet.find('.twitter-link').attr('href', input_tweet.find('.timeline-Tweet').attr('data-click-to-open-target'));
// Tweet author
var tweet_author = input_tweet.find('.TweetAuthor-Link');
output_tweet.find('.twitter-author').attr('href', tweet_author.attr('href'))
output_tweet.find('.twitter-author').html(tweet_author.find('.TweetAuthor-screenName').html())
// Hashtags
var hashtag_obj = output_tweet.find('#twitter-hashtag');
var hashtag_obj = output_tweet.find('.twitter-hashtag');
hashtag_obj.html('');
input_tweet.find('a.hashtag').each(function () {
hashtag_obj.append('<a href="' + $(this).attr('href') + '" target="_blank">' + $(this).text() + '</a> ');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment