diff --git a/README.md b/README.md index 1bd1d4a..51d3e09 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ We moved our instances list to our webpage: https://www.halcyon.social/instances or read our new documentation pages to install it manually: https://www.halcyon.social/documentation.php?page=install ## Blog +- Release of Version 2.4.2 - Many bugfixes,add trending hashtags,add URL unshortener,redirect YouTube to Invidious,translation improvements,add Spanish translation - Release of Version 2.4.1 - Improve French and German translation,respect Pleromas/GlitchSocs custom poll limits,add extension download link,many bugfixes - We published the new Halcyon Share Extension at [Firefox Addons](https://addons.mozilla.org/en-US/firefox/addon/halcyon-share/) and [NotABug](https://notabug.org/halcyon-suite/halcyon-share) - Release of Version 2.4.0 - Share links to Halcyon,preview overlays for mentions and more (blog article coming soon) diff --git a/assets/css/style.css b/assets/css/style.css index 9c90ff3..2171162 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -579,10 +579,10 @@ font-weight: 300; .single_reply_status .status_preview,.report_status .status_preview { border-top: 1px solid #E1E8ED; } -.single_reply_status .status_preview .toot_entry .toot_footer,.report_stauts .status_preview .toot_entry .toot_footer { +.single_reply_status .status_preview .toot_entry .toot_footer,.report_status .status_preview .toot_entry .toot_footer { display: none!important; } -.single_reply_status .status_preview .toot_entry .link_preview,.report_stauts .status_preview .toot_entry .link_preview { +.single_reply_status .status_preview .toot_entry .link_preview,.report_status .status_preview .toot_entry .link_preview { display: none!important; } .single_reply_status .status_form .status_bottom,.report_status .status_form .status_bottom { @@ -975,6 +975,9 @@ position: relative; box-sizing: border-box; border: 1px solid #DCDFE1; } +.media_views.link_preview { +cursor:pointer; +} .media_views.media_full_height { height:auto; } @@ -1517,9 +1520,12 @@ overflow: hidden; margin-right: 8px; border-radius: 5px; } -.account_box .label_box { +.what_to_follow .account_box .label_box { width: 200px; } +.trending_hashtags .account_box .label_box { +width:100%; +} .account_box .label_box h3 { overflow: hidden; white-space: nowrap; diff --git a/assets/js/halcyon/halcyonFunctions.js b/assets/js/halcyon/halcyonFunctions.js index 5bfbbe2..e4cfb25 100644 --- a/assets/js/halcyon/halcyonFunctions.js +++ b/assets/js/halcyon/halcyonFunctions.js @@ -59,7 +59,7 @@ di[re[4]] = re[3]; } return di; } -function replaceInternalLink(){ +function replaceInternalLink() { $(".toot_article a,.profile_bio a,.follows_profile_bio a").each(function(i) { const pltags = $(this).attr('href').match(/https?:\/\/.+..+\/tag\/([a-zA-Z\d_%]+)\/?$/); if(pltags) $(this).attr('target','_self').attr('href','/search?q='+pltags[1]); @@ -77,6 +77,24 @@ const gsstatus = $(this).attr('href').match(/https?:\/\/.+..+\/notice\/(\d+)\/?$ if(gsstatus) $(this).attr('target','_self').attr('href',"javascript:openStatus('"+gsstatus[0]+"');void(0)"); const plstatus = $(this).attr('href').match(/https?:\/\/.+..+\/objects\/([\da-z]{8}-[\da-z]{4}-[\da-z]{4}-[\da-z]{4}-[\da-z]{12})\/?$/); if(plstatus) $(this).attr('target','_self').attr('href',"javascript:openStatus('"+plstatus[0]+"');void(0)"); +const ytcom = $(this).attr('href').match(/https?:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z\d_-]+)/); +if(ytcom) $(this).attr('target','_self').attr('href',"javascript:openVideo('"+ytcom[2]+"');void(0)"); +const ytbe = $(this).attr('href').match(/https?:\/\/(www\.)?youtu\.be\/([a-zA-Z\d_-]+)/); +if(ytbe) $(this).attr('target','_self').attr('href',"javascript:openVideo('"+ytbe[2]+"');void(0)"); +if(server_setting_unshorten && checkURLshortener($(this).attr('href'))) { +var linkrand = Math.round(Math.random()*1000000); +$(this).attr("data-random",linkrand); +$.ajax("/unshorten.php?url="+encodeURIComponent($(this).attr('href'))).done(function(data) { +$(".toot_article a,.profile_bio a,.follows_profile_bio a").filter("[data-random="+linkrand+"]").attr("href",data); +$(".toot_article a,.profile_bio a,.follows_profile_bio a").filter("[data-random="+linkrand+"]").children().eq(1).text(data.split("//")[0]); +link = data.replace("https://",""); +link = link.replace("http://",""); +if(link.length > 30) $(".toot_article a,.profile_bio a,.follows_profile_bio a").filter("[data-random="+linkrand+"]").children().eq(1).addClass("ellipsis"); +else $(".toot_article a,.profile_bio a,.follows_profile_bio a").filter("[data-random="+linkrand+"]").children().eq(1).removeClass("ellipsis"); +$(".toot_article a,.profile_bio a,.follows_profile_bio a").filter("[data-random="+linkrand+"]").children().eq(1).text(link.substr(0,30)); +$(".toot_article a,.profile_bio a,.follows_profile_bio a").filter("[data-random="+linkrand+"]").children().eq(2).text(link.substr(30)); +}); +} }); $(".toot_article a").each(function(i) { const ytcom = $(this).attr('href').match(/https?:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z\d_-]+)/); @@ -169,7 +187,6 @@ current_filters = new Array; } localStorage.setItem("current_display_name",AccountObj["display_name"]); localStorage.setItem("current_acct",AccountObj["acct"]); -localStorage.setItem("current_url","/@"+AccountObj["acct"]+"@"+current_instance+"?mid="+current_id); localStorage.setItem("current_header",AccountObj["header"]); localStorage.setItem("current_avatar",AccountObj["avatar"]); localStorage.setItem("current_locked",AccountObj["locked"]); @@ -179,7 +196,6 @@ localStorage.setItem("current_followers_count",AccountObj["followers_count"]); localStorage.setItem("current_follow_loaded","false"); current_display_name = localStorage.getItem("current_display_name"); current_acct = localStorage.getItem("current_acct"); -current_url = localStorage.getItem("current_url"); current_header = localStorage.getItem("current_header"); current_avatar = localStorage.getItem("current_avatar"); current_locked = localStorage.getItem("current_locked"); @@ -263,7 +279,6 @@ api_user_token: authtoken }); current_display_name = localStorage.getItem("current_display_name"); current_acct = localStorage.getItem("current_acct"); -current_url = localStorage.getItem("current_url"); current_header = localStorage.getItem("current_header"); current_avatar = localStorage.getItem("current_avatar"); current_locked = localStorage.getItem("current_locked"); @@ -287,15 +302,15 @@ is_account_locked = " "; } $(".js_current_profile_displayname").html(current_display_name); $(".js_current_profile_username").html(current_acct+is_account_locked); -$(".js_current_profile_link").attr("href", current_url); +$(".js_current_profile_link").attr("href","/@"+current_acct+"@"+current_instance+"?mid="+current_id); $(".js_current_header_image").attr("src", current_header); $(".js_current_profile_image").attr("src", current_avatar); $(".js_current_toots_count").text(current_statuses_count); $(".js_current_following_count").text(current_following_count); $(".js_current_followers_count").text(current_followers_count); -$(".current_toots_count_link").attr("href",current_url); -$(".current_following_count_link").attr("href",current_url); -$(".current_followers_count_link").attr("href",current_url); +$(".current_toots_count_link").attr("href","/@"+current_acct+"@"+current_instance+"?mid="+current_id); +$(".current_following_count_link").attr("href","/@"+current_acct+"@"+current_instance+"/following?mid="+current_id); +$(".current_followers_count_link").attr("href","/@"+current_acct+"@"+current_instance+"/followers?mid="+current_id); if($(window).width() < 1200) { responsive_design = true; $(".left_column").append($("