From aadcb94355b000c3288d80988ce29aa68d1454e8 Mon Sep 17 00:00:00 2001 From: nipos Date: Sun, 9 Feb 2020 19:26:29 +0100 Subject: [PATCH] Repair emoji autocomplete,repair YouPlay,improve Invidious embed,change Vinayaka instance,add Bibliogram and NoFB redirects --- README.md | 1 + assets/js/autocomplete/textarea.js | 2 +- assets/js/halcyon/halcyonFunctions.js | 85 ++++++++++++++-- assets/js/halcyon/halcyonSettings.js | 92 +++++++++++++++++ assets/js/halcyon/halcyonUI.js | 58 ++++++++++- config/config.ini.sample | 8 +- footer.php | 4 + header.php | 3 +- login/auth.php | 4 + media/invidious.php | 95 +++++++++++++++++ media/vimeo.php | 2 +- media/youplay.php | 10 +- media/ytcaption.php | 4 +- media/ytclass.php | 130 ++++++++++++------------ settings_general.php | 28 +++++ settings_media.php | 28 +++++ version.txt | 2 +- widgets/overlay_redirect_bibliogram.php | 24 +++++ widgets/overlay_redirect_nofb.php | 24 +++++ widgets/overlay_rewrite_bibliogram.php | 24 +++++ widgets/overlay_rewrite_nofb.php | 24 +++++ 21 files changed, 563 insertions(+), 89 deletions(-) create mode 100644 media/invidious.php create mode 100644 widgets/overlay_redirect_bibliogram.php create mode 100644 widgets/overlay_redirect_nofb.php create mode 100644 widgets/overlay_rewrite_bibliogram.php create mode 100644 widgets/overlay_rewrite_nofb.php diff --git a/README.md b/README.md index 8a79ddb..1fca52b 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.7 - Repair emoji autocomplete,repair YouPlay,improve Invidious embed,change Vinayaka instance,add Bibliogram and NoFB redirects - Release of Version 2.4.6 - Replace some removed Mastodon APIs,fix Toot button not locking on CTRL+Enter,make navbar a bit more responsive - Release of Version 2.4.5 - Support for emoji categories,added links to admin panel,rewrite links to Invidious and Nitter at compose,bugfixes - 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 diff --git a/assets/js/autocomplete/textarea.js b/assets/js/autocomplete/textarea.js index 616fb73..6c84e24 100644 --- a/assets/js/autocomplete/textarea.js +++ b/assets/js/autocomplete/textarea.js @@ -71,7 +71,7 @@ $(liNode).data("value",prepend+ele[resultname]+" "); $(liNode).addClass("account_box").append($("
").addClass("icon_box").append($("").attr("src",ele.avatar).css("float","left"))) .append($("
").addClass("label_box").append($("").addClass("dn").append($("

").html(ele.display_name).addClass("emoji_poss"))).append($("").addClass("un").html(prepend+ele.acct))); } -else if(resultname == "name") { +else if(prepend == "#") { $(liNode).data("value",prepend+ele[resultname]+" "); $(liNode).addClass("account_box").append($("
").addClass("icon_box").append($("").addClass("emoji_poss").html("#️⃣").css("float","left").css("font-size","32px"))) .append($("
").addClass("label_box").append($("").addClass("dn").append($("

").html(prepend+ele[resultname])))); diff --git a/assets/js/halcyon/halcyonFunctions.js b/assets/js/halcyon/halcyonFunctions.js index 1e3b8c8..985729a 100644 --- a/assets/js/halcyon/halcyonFunctions.js +++ b/assets/js/halcyon/halcyonFunctions.js @@ -83,6 +83,12 @@ const ytbe = $(this).attr('href').match(/https?:\/\/(www\.)?youtu\.be\/([a-zA-Z\ 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)"); +const igpost = $(this).attr('href').match(/https?:\/\/(www\.)?instagram\.com\/p\/([a-zA-Z\d_-]+)/); +if(igpost) $(this).attr('target','_self').attr('href',"javascript:openBibliogram('p/"+igpost[2]+"');void(0)"); +const igacc = $(this).attr('href').match(/https?:\/\/(www\.)?instagram\.com\/([a-zA-Z\d_\.]+)/); +if(igacc) $(this).attr('target','_self').attr('href',"javascript:openBibliogram('u/"+igacc[2]+"');void(0)"); +const fbcom = $(this).attr('href').match(/https?:\/\/(www\.)?facebook\.com\/(.*)/); +if(fbcom) $(this).attr('target','_self').attr('href',"javascript:openNoFB('"+fbcom[2]+"');void(0)"); if(server_setting_unshorten && checkURLshortener($(this).attr('href'))) { var linkrand = Math.round(Math.random()*1000000); $(this).attr("data-random",linkrand); @@ -489,6 +495,28 @@ $('.overlay_redirect_nitter').data("path",path); $('.overlay_redirect_nitter').removeClass('invisible'); } } +function openBibliogram(path) { +if(localStorage.setting_redirect_bibliogram == "true") window.open("https://"+server_setting_bibliogram+"/"+path,"_blank"); +else if(localStorage.setting_redirect_bibliogram == "false") window.open("https://www.instagram.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_bibliogram').data("path",path); +$('.overlay_redirect_bibliogram').removeClass('invisible'); +} +} +function openNoFB(path) { +if(localStorage.setting_redirect_nofb == "true") window.open("https://nofb.pw/?p="+encodeURIComponent("https://www.facebook.com/"+path),"_blank"); +else if(localStorage.setting_redirect_nofb == "false") window.open("https://www.facebook.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_nofb').data("path",path); +$('.overlay_redirect_nofb').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_-]+)/); @@ -519,7 +547,7 @@ media_views += (` else if(source == "youtube" && localStorage.setting_play_invidious == "true") { media_views += (`
- +
`); } else if(source == "vimeo" && server_setting_vimeo == true && localStorage.setting_play_vimeo == "true") { @@ -547,10 +575,13 @@ textarea.trigger({"type":"keyup","key":":"}); }}); } } -function submitStatusArray(params,callback,invidious="unset",nitter="unset") { +function submitStatusArray(params,callback,invidious="unset",nitter="unset",bibliogram="unset",nofb="unset") { const ytcom = params.status.first().val().match(/https?:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z\d_-]+)/); const ytbe = params.status.first().val().match(/https?:\/\/(www\.)?youtu\.be\/([a-zA-Z\d_-]+)/); const twcom = params.status.first().val().match(/https?:\/\/(www\.)?twitter\.com\/(.*)/); +const igpost = params.status.first().val().match(/https?:\/\/(www\.)?instagram\.com\/p\/([a-zA-Z\d_-]+)/); +const igacc = params.status.first().val().match(/https?:\/\/(www\.)?instagram\.com\/([a-zA-Z\d_\.]+)/); +const fbcom = params.status.first().val().match(/https?:\/\/(www\.)?facebook\.com\/(.*)/); if((ytcom || ytbe) && localStorage.setting_rewrite_invidious == "unset" && invidious == "unset") { $("#js-overlay_content_wrap .temporary_object").empty(); $('#js-overlay_content_wrap').addClass('view'); @@ -558,6 +589,8 @@ $('#js-overlay_content_wrap').addClass('black_08'); $('.overlay_rewrite_invidious').data("params",params); $('.overlay_rewrite_invidious').data("callback",callback); $('.overlay_rewrite_invidious').data("nitter",nitter); +$('.overlay_rewrite_invidious').data("bibliogram",bibliogram); +$('.overlay_rewrite_invidious').data("nofb",nofb); $('.overlay_rewrite_invidious').removeClass('invisible'); } else if(twcom && localStorage.setting_rewrite_nitter == "unset" && nitter == "unset") { @@ -567,23 +600,59 @@ $('#js-overlay_content_wrap').addClass('black_08'); $('.overlay_rewrite_nitter').data("params",params); $('.overlay_rewrite_nitter').data("callback",callback); $('.overlay_rewrite_nitter').data("invidious",invidious); +$('.overlay_rewrite_nitter').data("bibliogram",bibliogram); +$('.overlay_rewrite_nitter').data("nofb",nofb); $('.overlay_rewrite_nitter').removeClass('invisible'); } +else if((igpost || igacc) && localStorage.setting_rewrite_bibliogram == "unset" && bibliogram == "unset") { +$("#js-overlay_content_wrap .temporary_object").empty(); +$('#js-overlay_content_wrap').addClass('view'); +$('#js-overlay_content_wrap').addClass('black_08'); +$('.overlay_rewrite_bibliogram').data("params",params); +$('.overlay_rewrite_bibliogram').data("callback",callback); +$('.overlay_rewrite_bibliogram').data("invidious",invidious); +$('.overlay_rewrite_bibliogram').data("nitter",nitter); +$('.overlay_rewrite_bibliogram').data("nofb",nofb); +$('.overlay_rewrite_bibliogram').removeClass('invisible'); +} +else if(fbcom && localStorage.setting_rewrite_nofb == "unset" && nofb == "unset") { +$("#js-overlay_content_wrap .temporary_object").empty(); +$('#js-overlay_content_wrap').addClass('view'); +$('#js-overlay_content_wrap').addClass('black_08'); +$('.overlay_rewrite_nofb').data("params",params); +$('.overlay_rewrite_nofb').data("callback",callback); +$('.overlay_rewrite_nofb').data("invidious",invidious); +$('.overlay_rewrite_nofb').data("nitter",nitter); +$('.overlay_rewrite_nofb').data("bibliogram",bibliogram); +$('.overlay_rewrite_nofb').removeClass('invisible'); +} if(ytcom && (localStorage.setting_rewrite_invidious == "true" || invidious == "true")) { params.status.first().val(params.status.first().val().replace(/https?:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z\d_-]+)/,"https://"+server_setting_invidious+"/watch?v=$2")); -submitStatusArray(params,callback,invidious,nitter); +submitStatusArray(params,callback,invidious,nitter,bibliogram,nofb); } else if(ytbe && (localStorage.setting_rewrite_invidious == "true" || invidious == "true")) { params.status.first().val(params.status.first().val().replace(/https?:\/\/(www\.)?youtu\.be\/([a-zA-Z\d_-]+)/,"https://"+server_setting_invidious+"/watch?v=$2")); -submitStatusArray(params,callback,invidious,nitter); +submitStatusArray(params,callback,invidious,nitter,bibliogram,nofb); } else if(twcom && (localStorage.setting_rewrite_nitter == "true" || nitter == "true")) { params.status.first().val(params.status.first().val().replace(/https?:\/\/(www\.)?twitter\.com\/(.*)/,"https://"+server_setting_nitter+"/$2")); -submitStatusArray(params,callback,invidious,nitter); +submitStatusArray(params,callback,invidious,nitter,bibliogram,nofb); } -else if(((!ytcom && !ytbe) || localStorage.setting_rewrite_invidious == "false" || invidious == "false") && (!twcom || localStorage.setting_rewrite_nitter == "false" || nitter == "false")) submitStatusArrayNow(params,callback); +else if(igpost && (localStorage.setting_rewrite_bibliogram == "true" || bibliogram == "true")) { +params.status.first().val(params.status.first().val().replace(/https?:\/\/(www\.)?instagram\.com\/p\/([a-zA-Z\d_-]+)/,"https://"+server_setting_bibliogram+"/p/$2")); +submitStatusArray(params,callback,invidious,nitter,bibliogram,nofb); } -function submitStatusArrayNow(params,callback,invidious,nitter) { +else if(igacc && (localStorage.setting_rewrite_bibliogram == "true" || bibliogram == "true")) { +params.status.first().val(params.status.first().val().replace(/https?:\/\/(www\.)?instagram\.com\/([a-zA-Z\d_\.]+)/,"https://"+server_setting_bibliogram+"/u/$2")); +submitStatusArray(params,callback,invidious,nitter,bibliogram,nofb); +} +else if(fbcom && (localStorage.setting_rewrite_nofb == "true" || nofb == "true")) { +params.status.first().val(params.status.first().val().replace(/https?:\/\/(www\.)?facebook\.com\/(.*)/,"https://nofb.pw/?p=https%3A%2F%2Fwww.facebook.com%2F$2")); +submitStatusArray(params,callback,invidious,nitter,bibliogram,nofb); +} +else if(((!ytcom && !ytbe) || localStorage.setting_rewrite_invidious == "false" || invidious == "false") && (!twcom || localStorage.setting_rewrite_nitter == "false" || nitter == "false") && ((!igpost && !igacc) || localStorage.setting_rewrite_bibliogram == "false" || bibliogram == "false") && (!fbcom || localStorage.setting_rewrite_nofb == "false" || nofb == "false")) submitStatusArrayNow(params,callback,invidious,nitter,bibliogram,nofb); +} +function submitStatusArrayNow(params,callback,invidious,nitter,bibliogram,nofb) { var statuses = params.status; params.status = params.status.first().val(); api.post("statuses",params,function(data) { @@ -597,7 +666,7 @@ nparams.status = statuses; nparams.visibility = params.visibility; nparams.spoiler_text = params.spoiler_text; nparams.in_reply_to_id = data.id; -submitStatusArray(nparams,callback,invidious,nitter); +submitStatusArray(nparams,callback,invidious,nitter,bibliogram,nofb); } }); } diff --git a/assets/js/halcyon/halcyonSettings.js b/assets/js/halcyon/halcyonSettings.js index 9bfbdec..8da6487 100644 --- a/assets/js/halcyon/halcyonSettings.js +++ b/assets/js/halcyon/halcyonSettings.js @@ -22,6 +22,18 @@ $("#setting_rewrite_nitter")[0].checked = true; if(localStorage.setting_rewrite_nitter != "unset") { $("#setting_rewrite_nitter_reset").show(); } +if(localStorage.setting_rewrite_bibliogram == "true") { +$("#setting_rewrite_bibliogram")[0].checked = true; +} +if(localStorage.setting_rewrite_bibliogram != "unset") { +$("#setting_rewrite_bibliogram_reset").show(); +} +if(localStorage.setting_rewrite_nofb == "true") { +$("#setting_rewrite_nofb")[0].checked = true; +} +if(localStorage.setting_rewrite_nofb != "unset") { +$("#setting_rewrite_nofb_reset").show(); +} if(localStorage.setting_who_to_follow == "true") { $("#setting_who_to_follow")[0].checked = true; } @@ -87,6 +99,40 @@ $("#setting_rewrite_nitter_reset").fadeOut(); $("#setting_rewrite_nitter")[0].checked = false; putMessage(__("Twitter link rewrite reset to default")); }); +$("#setting_rewrite_bibliogram").change(function() { +$("#setting_rewrite_bibliogram_reset").fadeIn(); +if(this.checked) { +localStorage.setItem("setting_rewrite_bibliogram","true"); +putMessage(__("Instagram links rewritten to Bibliogram")); +} +else { +localStorage.setItem("setting_rewrite_bibliogram","false"); +putMessage(__("Instagram links not rewritten anymore")); +} +}); +$("#setting_rewrite_bibliogram_reset").click(function() { +localStorage.setItem("setting_rewrite_bibliogram","unset"); +$("#setting_rewrite_bibliogram_reset").fadeOut(); +$("#setting_rewrite_bibliogram")[0].checked = false; +putMessage(__("Instagram link rewrite reset to default")); +}); +$("#setting_rewrite_nofb").change(function() { +$("#setting_rewrite_nofb_reset").fadeIn(); +if(this.checked) { +localStorage.setItem("setting_rewrite_nofb","true"); +putMessage(__("Facebook links rewritten to NoFB")); +} +else { +localStorage.setItem("setting_rewrite_nofb","false"); +putMessage(__("Facebook links not rewritten anymore")); +} +}); +$("#setting_rewrite_nofb_reset").click(function() { +localStorage.setItem("setting_rewrite_nofb","unset"); +$("#setting_rewrite_nofb_reset").fadeOut(); +$("#setting_rewrite_nofb")[0].checked = false; +putMessage(__("Facebook link rewrite reset to default")); +}); $(document).on('change',".local_instance_wrap input[name='local_instance']", function(e) { if($(this).val()) { localStorage.setItem("setting_local_instance","https://"+$(this).val()); @@ -514,6 +560,18 @@ $("#setting_redirect_nitter")[0].checked = true; if(localStorage.setting_redirect_nitter != "unset") { $("#setting_redirect_nitter_reset").show(); } +if(localStorage.setting_redirect_bibliogram == "true") { +$("#setting_redirect_bibliogram")[0].checked = true; +} +if(localStorage.setting_redirect_bibliogram != "unset") { +$("#setting_redirect_bibliogram_reset").show(); +} +if(localStorage.setting_redirect_nofb == "true") { +$("#setting_redirect_nofb")[0].checked = true; +} +if(localStorage.setting_redirect_nofb != "unset") { +$("#setting_redirect_nofb_reset").show(); +} }); $("#setting_play_gif").change(function() { if(this.checked) { @@ -619,6 +677,40 @@ $("#setting_redirect_nitter_reset").fadeOut(); $("#setting_redirect_nitter")[0].checked = false; putMessage(__("Twitter link redirect reset to default")); }); +$("#setting_redirect_bibliogram").change(function() { +$("#setting_redirect_bibliogram_reset").fadeIn(); +if(this.checked) { +localStorage.setItem("setting_redirect_bibliogram","true"); +putMessage(__("Instagram links redirected to Bibliogram")); +} +else { +localStorage.setItem("setting_redirect_bibliogram","false"); +putMessage(__("Instagram links not redirected anymore")); +} +}); +$("#setting_redirect_bibliogram_reset").click(function() { +localStorage.setItem("setting_redirect_bibliogram","unset"); +$("#setting_redirect_bibliogram_reset").fadeOut(); +$("#setting_redirect_bibliogram")[0].checked = false; +putMessage(__("Instagram link redirect reset to default")); +}); +$("#setting_redirect_nofb").change(function() { +$("#setting_redirect_nofb_reset").fadeIn(); +if(this.checked) { +localStorage.setItem("setting_redirect_nofb","true"); +putMessage(__("Facebook links redirected to NoFB")); +} +else { +localStorage.setItem("setting_redirect_nofb","false"); +putMessage(__("Facebook links not redirected anymore")); +} +}); +$("#setting_redirect_nofb_reset").click(function() { +localStorage.setItem("setting_redirect_nofb","unset"); +$("#setting_redirect_nofb_reset").fadeOut(); +$("#setting_redirect_nofb")[0].checked = false; +putMessage(__("Facebook link redirect reset to default")); +}); } else if(window.location.pathname == "/settings/blocks") { $('#js-settings_nav_blocks').toggleClass('view'); diff --git a/assets/js/halcyon/halcyonUI.js b/assets/js/halcyon/halcyonUI.js index 16bd6b9..08549f5 100644 --- a/assets/js/halcyon/halcyonUI.js +++ b/assets/js/halcyon/halcyonUI.js @@ -2015,8 +2015,12 @@ $('#js-overlay_content_wrap .overlay_addlist').addClass('invisible'); $('#js-overlay_content_wrap .overlay_filter').addClass('invisible'); $('#js-overlay_content_wrap .overlay_redirect_invidious').addClass('invisible'); $('#js-overlay_content_wrap .overlay_redirect_nitter').addClass('invisible'); +$('#js-overlay_content_wrap .overlay_redirect_bibliogram').addClass('invisible'); +$('#js-overlay_content_wrap .overlay_redirect_nofb').addClass('invisible'); $('#js-overlay_content_wrap .overlay_rewrite_invidious').addClass('invisible'); $('#js-overlay_content_wrap .overlay_rewrite_nitter').addClass('invisible'); +$('#js-overlay_content_wrap .overlay_rewrite_bibliogram').addClass('invisible'); +$('#js-overlay_content_wrap .overlay_rewrite_nofb').addClass('invisible'); $('#js-overlay_content .temporary_object, #js-overlay_content .parmanent_object').removeClass('visible'); $('#js-overlay_content_wrap .overlay_status.submit_status_label').removeClass('active_submit_button'); $('#js-overlay_content_wrap .single_reply_status .submit_status_label').removeClass('active_submit_button'); @@ -2084,26 +2088,66 @@ $('.close_button').click(); window.open("https://twitter.com/"+$(".overlay_redirect_nitter").data("path"),"_blank"); if($("#redirect_nitter_permanent")[0].checked) localStorage.setting_redirect_nitter = "false"; }); +$('.overlay_redirect_bibliogram_yes').click(function() { +$('.close_button').click(); +window.open("https://"+server_setting_bibliogram+"/"+$(".overlay_redirect_bibliogram").data("path"),"_blank"); +if($("#redirect_bibliogram_permanent")[0].checked) localStorage.setting_redirect_bibliogram = "true"; +}); +$('.overlay_redirect_bibliogram_no').click(function() { +$('.close_button').click(); +window.open("https://www.instagram.com/"+$(".overlay_redirect_bibliogram").data("path"),"_blank"); +if($("#redirect_bibliogram_permanent")[0].checked) localStorage.setting_redirect_bibliogram = "false"; +}); +$('.overlay_redirect_nofb_yes').click(function() { +$('.close_button').click(); +window.open("https://nofb.pw/?p="+encodeURIComponent("https://www.facebook.com/"+$(".overlay_redirect_nofb").data("path")),"_blank"); +if($("#redirect_nofb_permanent")[0].checked) localStorage.setting_redirect_nofb = "true"; +}); +$('.overlay_redirect_nofb_no').click(function() { +$('.close_button').click(); +window.open("https://www.facebook.com/"+$(".overlay_redirect_nofb").data("path"),"_blank"); +if($("#redirect_nofb_permanent")[0].checked) localStorage.setting_redirect_nofb = "false"; +}); $('.overlay_rewrite_invidious_yes').click(function() { $('.close_button').click(); -submitStatusArray($(".overlay_rewrite_invidious").data("params"),$(".overlay_rewrite_invidious").data("callback"),"true",$(".overlay_rewrite_invidious").data("nitter")); +submitStatusArray($(".overlay_rewrite_invidious").data("params"),$(".overlay_rewrite_invidious").data("callback"),"true",$(".overlay_rewrite_invidious").data("nitter"),$(".overlay_rewrite_invidious").data("bibliogram"),$(".overlay_rewrite_invidious").data("nofb")); if($("#rewrite_invidious_permanent")[0].checked) localStorage.setting_rewrite_invidious = "true"; }); $('.overlay_rewrite_invidious_no').click(function() { $('.close_button').click(); -submitStatusArray($(".overlay_rewrite_invidious").data("params"),$(".overlay_rewrite_invidious").data("callback"),"false",$(".overlay_rewrite_invidious").data("nitter")); +submitStatusArray($(".overlay_rewrite_invidious").data("params"),$(".overlay_rewrite_invidious").data("callback"),"false",$(".overlay_rewrite_invidious").data("nitter"),$(".overlay_rewrite_invidious").data("bibliogram"),$(".overlay_rewrite_invidious").data("nofb")); if($("#rewrite_invidious_permanent")[0].checked) localStorage.setting_rewrite_invidious = "false"; }); $('.overlay_rewrite_nitter_yes').click(function() { $('.close_button').click(); -submitStatusArray($(".overlay_rewrite_nitter").data("params"),$(".overlay_rewrite_nitter").data("callback"),$(".overlay_rewrite_nitter").data("invidious"),"true"); +submitStatusArray($(".overlay_rewrite_nitter").data("params"),$(".overlay_rewrite_nitter").data("callback"),$(".overlay_rewrite_nitter").data("invidious"),"true",$(".overlay_rewrite_nitter").data("bibliogram"),$(".overlay_rewrite_nitter").data("bibliogram")); if($("#rewrite_nitter_permanent")[0].checked) localStorage.setting_rewrite_nitter = "true"; }); $('.overlay_rewrite_nitter_no').click(function() { $('.close_button').click(); -submitStatusArray($(".overlay_rewrite_nitter").data("params"),$(".overlay_rewrite_nitter").data("callback"),$(".overlay_rewrite_nitter").data("invidious"),"false"); +submitStatusArray($(".overlay_rewrite_nitter").data("params"),$(".overlay_rewrite_nitter").data("callback"),$(".overlay_rewrite_nitter").data("invidious"),"false",$(".overlay_rewrite_nitter").data("bibliogram"),$(".overlay_rewrite_nitter").data("bibliogram")); if($("#rewrite_nitter_permanent")[0].checked) localStorage.setting_rewrite_nitter = "false"; }); +$('.overlay_rewrite_bibliogram_yes').click(function() { +$('.close_button').click(); +submitStatusArray($(".overlay_rewrite_bibliogram").data("params"),$(".overlay_rewrite_bibliogram").data("callback"),$(".overlay_rewrite_bibliogram").data("invidious"),$(".overlay_rewrite_bibliogram").data("nitter"),"true",$(".overlay_rewrite_bibliogram").data("nofb")); +if($("#rewrite_bibliogram_permanent")[0].checked) localStorage.setting_rewrite_bibliogram = "true"; +}); +$('.overlay_rewrite_bibliogram_no').click(function() { +$('.close_button').click(); +submitStatusArray($(".overlay_rewrite_bibliogram").data("params"),$(".overlay_rewrite_bibliogram").data("callback"),$(".overlay_rewrite_bibliogram").data("invidious"),$(".overlay_rewrite_bibliogram").data("nitter"),"false",$(".overlay_rewrite_bibliogram").data("nofb")); +if($("#rewrite_bibliogram_permanent")[0].checked) localStorage.setting_rewrite_bibliogram = "false"; +}); +$('.overlay_rewrite_nofb_yes').click(function() { +$('.close_button').click(); +submitStatusArray($(".overlay_rewrite_nofb").data("params"),$(".overlay_rewrite_nofb").data("callback"),$(".overlay_rewrite_nofb").data("invidious"),$(".overlay_rewrite_nofb").data("nitter"),$(".overlay_rewrite_nofb").data("bibliogram"),"true"); +if($("#rewrite_nofb_permanent")[0].checked) localStorage.setting_rewrite_nofb = "true"; +}); +$('.overlay_rewrite_nofb_no').click(function() { +$('.close_button').click(); +submitStatusArray($(".overlay_rewrite_nofb").data("params"),$(".overlay_rewrite_nofb").data("callback"),$(".overlay_rewrite_nofb").data("invidious"),$(".overlay_rewrite_nofb").data("nitter"),$(".overlay_rewrite_nofb").data("bibliogram"),"false"); +if($("#rewrite_nofb_permanent")[0].checked) localStorage.setting_rewrite_nofb = "false"; +}); if($("#js-overlay_content_wrap").hasClass("view")) $(document.body).css("overflow-y","hidden"); $("#js-overlay_content_wrap").attrchange(function(attr) { if(attr == "class" && $("#js-overlay_content_wrap").hasClass("view")) $(document.body).css("overflow-y","hidden"); @@ -2150,9 +2194,15 @@ e.stopPropagation(); const ytcom = $(this).data("url").match(/https?:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z\d_-]+)/); const ytbe = $(this).data("url").match(/https?:\/\/(www\.)?youtu\.be\/([a-zA-Z\d_-]+)/); const twcom = $(this).data("url").match(/https?:\/\/(www\.)?twitter\.com\/(.*)/); +const igpost = $(this).data("url").match(/https?:\/\/(www\.)?instagram\.com\/p\/([a-zA-Z\d_-]+)/); +const igacc = $(this).data("url").match(/https?:\/\/(www\.)?instagram\.com\/([a-zA-Z\d_\.]+)/); +const fbcom = $(this).data("url").match(/https?:\/\/(www\.)?facebook\.com\/(.*)/); if(ytcom) openVideo(ytcom[2]); else if(ytbe) openVideo(ytbe[2]); else if(twcom) openNitter(twcom[2]); +else if(igpost) openBibliogram("p/"+igpost[2]); +else if(igacc) openBibliogram("u/"+igacc[2]); +else if(fbcom) openNoFB(fbcom[2]); else window.open($(this).data("url"),"_blank"); }); $(document).on('focus','.status_textarea textarea,.status_top .status_spoiler',function(e) { diff --git a/config/config.ini.sample b/config/config.ini.sample index 9698f07..cb015ce 100644 --- a/config/config.ini.sample +++ b/config/config.ini.sample @@ -3,7 +3,7 @@ [App] api_client_name = Your application name api_client_website = https://example.com/ -who_to_follow_provider = https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-osa-api.cgi?{{host}}+{{user}} +who_to_follow_provider = https://vinayaka.tsia.de/cgi-bin/vinayaka-user-match-osa-api.cgi?{{host}}+{{user}} default_language = en_US debug_mode = false url_unshortener = true @@ -11,13 +11,17 @@ url_unshortener = true ; Media embed settings ; YouPlay resolves YouTube MP4s on your server and sends this link to the user for privacy-friendly watching ; Vimeo embeds work in the same way as YouPlay embeds here because the official players contain too much spyware +; YouPlay Fallback uses a proprietary API of https://unblockvideos.com and can be used if your own server IP has been blocked by Google ; Invidous is a external service to watch YouTube videos in a privacy-friendly way - Halcyon can automatically rewrite links to a instance you can set here ; Nitter is a external service to view Twitter contents in a privacy-friendly way - Halcyon can automatically rewrite links to a instance you can set here +; Bibliogram is a external service to view Instagram contents in a privacy-friendly way - Halcyon can automatically rewrite links to a instance you can set here [Media] youplay = true vimeo = true +youplay_fallback = true invidious = invidiou.sh -nitter = nitter.nixnet.xyz +nitter = nitter.13ad.de +bibliogram = bibliogram.dsrev.ru ; The proxy can be used optionally to resolve data for privacy-friendly media embeds on the server side - It is not used for Mastodon API requests on login ; Proxy type can be set to none, socks5, socks4, http or https - Example settings for locally installed Tor client diff --git a/footer.php b/footer.php index 15db1de..d7b6ad3 100644 --- a/footer.php +++ b/footer.php @@ -17,8 +17,12 @@ include dirname(__FILE__).('/widgets/overlay_prompt.php'); include dirname(__FILE__).('/widgets/overlay_addlist.php'); include dirname(__FILE__).('/widgets/overlay_redirect_invidious.php'); include dirname(__FILE__).('/widgets/overlay_redirect_nitter.php'); +include dirname(__FILE__).('/widgets/overlay_redirect_bibliogram.php'); +include dirname(__FILE__).('/widgets/overlay_redirect_nofb.php'); include dirname(__FILE__).('/widgets/overlay_rewrite_invidious.php'); include dirname(__FILE__).('/widgets/overlay_rewrite_nitter.php'); +include dirname(__FILE__).('/widgets/overlay_rewrite_bibliogram.php'); +include dirname(__FILE__).('/widgets/overlay_rewrite_nofb.php'); if($_SERVER["REQUEST_URI"] == "/settings/filters") include dirname(__FILE__).('/widgets/overlay_filter.php'); ?>

diff --git a/header.php b/header.php index edce886..44e7027 100644 --- a/header.php +++ b/header.php @@ -75,7 +75,8 @@ server_setting_youplay = ; server_setting_vimeo = ; server_setting_unshorten = ; server_setting_invidious = ; -server_setting_nitter = ; +server_setting_nitter = ; +server_setting_bibliogram = ; diff --git a/login/auth.php b/login/auth.php index ac42b4d..231762e 100644 --- a/login/auth.php +++ b/login/auth.php @@ -60,8 +60,12 @@ localStorage.setItem('setting_post_privacy','".$profile["source"]["privacy"]."') localStorage.setItem('setting_post_sensitive','".$profile["source"]["sensitive"]."'); localStorage.setItem('setting_redirect_invidious','unset'); localStorage.setItem('setting_redirect_nitter','unset'); +localStorage.setItem('setting_redirect_bibliogram','unset'); +localStorage.setItem('setting_redirect_nofb','unset'); localStorage.setItem('setting_rewrite_invidious','unset'); localStorage.setItem('setting_rewrite_nitter','unset'); +localStorage.setItem('setting_rewrite_bibliogram','unset'); +localStorage.setItem('setting_rewrite_nofb','unset'); $.cookie('darktheme','unset',{path:'/',expires:3650}); if(sessionStorage.return && sessionStorage.return == 'share') location.href = '/intent/toot?action=send'; else location.href = '/'; diff --git a/media/invidious.php b/media/invidious.php new file mode 100644 index 0000000..cbfca60 --- /dev/null +++ b/media/invidious.php @@ -0,0 +1,95 @@ + + + + + + + + + + + + + diff --git a/media/vimeo.php b/media/vimeo.php index b18c336..fcb721b 100644 --- a/media/vimeo.php +++ b/media/vimeo.php @@ -19,7 +19,7 @@ $vdata = vimeo(htmlspecialchars($_GET["id"])); if($vdata) { $vlink = $vdata["dl"]; ?> -
+

+
+
+
+ +
+ +
+
+ +
+
+

+
+
+
+ +
+ +
+
+ +
+

diff --git a/settings_media.php b/settings_media.php index 8737462..36cd323 100644 --- a/settings_media.php +++ b/settings_media.php @@ -122,6 +122,34 @@
+
+

+
+
+
+ +
+ +
+
+ +
+
+

+
+
+
+ +
+ +
+
+ +
-

diff --git a/version.txt b/version.txt index 7bf4b6a..e30309f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.4.6 +2.4.7 diff --git a/widgets/overlay_redirect_bibliogram.php b/widgets/overlay_redirect_bibliogram.php new file mode 100644 index 0000000..fd79ee8 --- /dev/null +++ b/widgets/overlay_redirect_bibliogram.php @@ -0,0 +1,24 @@ + diff --git a/widgets/overlay_redirect_nofb.php b/widgets/overlay_redirect_nofb.php new file mode 100644 index 0000000..ad85a37 --- /dev/null +++ b/widgets/overlay_redirect_nofb.php @@ -0,0 +1,24 @@ + diff --git a/widgets/overlay_rewrite_bibliogram.php b/widgets/overlay_rewrite_bibliogram.php new file mode 100644 index 0000000..6423ea0 --- /dev/null +++ b/widgets/overlay_rewrite_bibliogram.php @@ -0,0 +1,24 @@ + diff --git a/widgets/overlay_rewrite_nofb.php b/widgets/overlay_rewrite_nofb.php new file mode 100644 index 0000000..2eac2a9 --- /dev/null +++ b/widgets/overlay_rewrite_nofb.php @@ -0,0 +1,24 @@ +