diff --git a/README.md b/README.md index 1d39bd4..c6db8fe 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.4 - Option to rewrite all Twitter links to Nitter,click on animated GIF works like image now,full height for images option now works for animated GIF - Release of Version 2.4.3 - Fixed login,fixed YouPlay/Invidious embeds,fixed empty image placeholder when audio available,improved status template code - 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 diff --git a/assets/js/halcyon/halcyonFunctions.js b/assets/js/halcyon/halcyonFunctions.js index 3000ac8..db5f28f 100644 --- a/assets/js/halcyon/halcyonFunctions.js +++ b/assets/js/halcyon/halcyonFunctions.js @@ -81,6 +81,8 @@ const ytcom = $(this).attr('href').match(/https?:\/\/(www\.)?youtube\.com\/watch 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)"); +const twcom = $(this).attr('href').match(/https?:\/\/(www\.)?twitter\.com\/(.*)/); +if(twcom) $(this).attr('target','_self').attr('href',"javascript:openNitter('"+twcom[2]+"');void(0)"); if(server_setting_unshorten && checkURLshortener($(this).attr('href'))) { var linkrand = Math.round(Math.random()*1000000); $(this).attr("data-random",linkrand); @@ -475,6 +477,17 @@ $('.overlay_redirect_invidious').data("video",video); $('.overlay_redirect_invidious').removeClass('invisible'); } } +function openNitter(path) { +if(localStorage.setting_redirect_nitter == "true") window.open("https://"+server_setting_nitter+"/"+path,"_blank"); +else if(localStorage.setting_redirect_nitter == "false") window.open("https://twitter.com/"+path,"_blank"); +else { +$("#js-overlay_content_wrap .temporary_object").empty(); +$('#js-overlay_content_wrap').addClass('view'); +$('#js-overlay_content_wrap').addClass('black_08'); +$('.overlay_redirect_nitter').data("path",path); +$('.overlay_redirect_nitter').removeClass('invisible'); +} +} function checkStatusLinks(text) { $(""+text+"").find("a").each(function(i) { const ytcom = $(this).attr('href').match(/https?:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z\d_-]+)/); diff --git a/assets/js/halcyon/halcyonSettings.js b/assets/js/halcyon/halcyonSettings.js index e9557df..02b06c6 100644 --- a/assets/js/halcyon/halcyonSettings.js +++ b/assets/js/halcyon/halcyonSettings.js @@ -449,6 +449,12 @@ $("#setting_redirect_invidious")[0].checked = true; if(localStorage.setting_redirect_invidious != "unset") { $("#setting_redirect_invidious_reset").show(); } +if(localStorage.setting_redirect_nitter == "true") { +$("#setting_redirect_nitter")[0].checked = true; +} +if(localStorage.setting_redirect_nitter != "unset") { +$("#setting_redirect_nitter_reset").show(); +} }); $("#setting_play_gif").change(function() { if(this.checked) { @@ -537,6 +543,23 @@ $("#setting_redirect_invidious_reset").fadeOut(); $("#setting_redirect_invidious")[0].checked = false; putMessage(__("Youtube link redirect reset to default")); }); +$("#setting_redirect_nitter").change(function() { +$("#setting_redirect_nitter_reset").fadeIn(); +if(this.checked) { +localStorage.setItem("setting_redirect_nitter","true"); +putMessage(__("Twitter links redirected to Nitter")); +} +else { +localStorage.setItem("setting_redirect_nitter","false"); +putMessage(__("Twitter links not redirected anymore")); +} +}); +$("#setting_redirect_nitter_reset").click(function() { +localStorage.setItem("setting_redirect_nitter","unset"); +$("#setting_redirect_nitter_reset").fadeOut(); +$("#setting_redirect_nitter")[0].checked = false; +putMessage(__("Twitter link redirect reset to default")); +}); } else if(window.location.pathname == "/settings/blocks") { $('#js-settings_nav_blocks').toggleClass('view'); diff --git a/assets/js/halcyon/halcyonTemplates.js b/assets/js/halcyon/halcyonTemplates.js index c7c3564..e72c409 100644 --- a/assets/js/halcyon/halcyonTemplates.js +++ b/assets/js/halcyon/halcyonTemplates.js @@ -36,7 +36,7 @@ else if(status.media_attachments[i].type === "gifv") { var vidprev = ""; if(status.media_attachments[i].preview_url != status.media_attachments[i].url) vidprev = ""; media_embeds.push(` -
+