1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-14 03:15:49 +02:00

Make 'Show this thread' in notification open tweet detail

Closes 
This commit is contained in:
chylex 2018-01-10 22:47:50 +01:00
parent 8c452d3fa2
commit bb7cbde38f
3 changed files with 24 additions and 0 deletions
Core/Bridge
Resources/Scripts

View File

@ -113,6 +113,10 @@ public void LoadNextNotification(){
notification.InvokeAsyncSafe(notification.FinishCurrentNotification);
}
public void ShowNotificationTweetDetail(){
notification.InvokeAsyncSafe(notification.ShowTweetDetail);
}
public void ScreenshotTweet(string html, int width, int height){
form.InvokeAsyncSafe(() => form.OnTweetScreenshotReady(html, width, height));
}

View File

@ -182,6 +182,12 @@
this.outerHTML = this.innerHTML;
});
html.find("p.link-complex-target").filter(function(){
return $(this).text() === "Show this thread";
}).first().each(function(){
this.id = "tduck-show-thread";
});
let type = tweet.getChirpType();
if (type === "follow"){
@ -286,6 +292,7 @@
tags.push(".tweet-context .nbfc { text-overflow: ellipsis !important; white-space: nowrap !important }"); // force ellipsis on long usernames
tags.push(".activity-header { align-items: center !important; margin-bottom: 4px !important }"); // tweak alignment of avatar and text in notifications
tags.push(".activity-header .tweet-timestamp { line-height: unset !important }"); // fix timestamp position in notifications
tags.push("#tduck-show-thread { display: inline-block !important; cursor: pointer }");
if (fontSizeName === "smallest"){
tags.push(".badge-verified:before { width: 13px !important; height: 13px !important; background-position: -223px -98px !important }"); // fix cut off badge icon

View File

@ -106,6 +106,19 @@
window.setTimeout($TD.fixClipboard, 0);
});
//
// Block: Setup a handler for 'Show this thread'.
//
(function(){
var btn = document.getElementById("tduck-show-thread");
return if !btn;
btn.addEventListener("click", function(){
$TD.showNotificationTweetDetail();
});
})();
//
// Block: Setup a skip button.
//
if (!document.body.hasAttribute("td-example-notification")){