1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-13 18:15:48 +02:00

Rename SetLastRightClickInfo bridge method and make it browser-only

This commit is contained in:
chylex 2018-06-06 15:11:07 +02:00
parent 70ca890bef
commit fd0e1740a5
2 changed files with 8 additions and 8 deletions
Core/Bridge
Resources/Scripts

View File

@ -64,6 +64,10 @@ public void LoadNotificationLayout(string fontSize, string headLayout){
});
}
public void SetRightClickedLink(string type, string url){
ContextInfo.SetLink(type, url);
}
public void SetRightClickedChirp(string tweetUrl, string quoteUrl, string chirpAuthors, string chirpImages){
ContextInfo.SetChirp(tweetUrl, quoteUrl, chirpAuthors, chirpImages);
}
@ -99,10 +103,6 @@ public void ShowTweetDetail(){
// Global
public void SetLastRightClickInfo(string type, string url){
ContextInfo.SetLink(type, url);
}
public void OnTweetPopup(string columnId, string chirpId, string columnName, string tweetHtml, int tweetCharacters, string tweetUrl, string quoteUrl){
notification.InvokeAsyncSafe(() => {
form.OnTweetNotification();

View File

@ -562,17 +562,17 @@
let media = tweet.getMedia().find(media => media.mediaId === me.getAttribute("data-media-entity-id"));
if ((media.isVideo && media.service === "twitter") || media.isAnimatedGif){
$TD.setLastRightClickInfo("video", media.chooseVideoVariant().url);
$TD.setRightClickedLink("video", media.chooseVideoVariant().url);
}
else{
$TD.setLastRightClickInfo("image", media.large());
$TD.setRightClickedLink("image", media.large());
}
}
else if (me.classList.contains("js-gif-play")){
$TD.setLastRightClickInfo("video", $(this).closest(".js-media-gif-container").find("video").attr("src"));
$TD.setRightClickedLink("video", $(this).closest(".js-media-gif-container").find("video").attr("src"));
}
else{
$TD.setLastRightClickInfo("link", me.getAttribute("data-full-url"));
$TD.setRightClickedLink("link", me.getAttribute("data-full-url"));
}
});