diff --git a/.htaccess b/.htaccess index e7122f1..1a91e97 100644 --- a/.htaccess +++ b/.htaccess @@ -57,6 +57,7 @@ RewriteRule ^settings/?$ settings_general\.php [NC,L] RewriteRule ^settings/profile/?$ settings_profile\.php [NC,L] RewriteRule ^settings/appearance/?$ settings_appearance\.php [NC,L] RewriteRule ^settings/filters/?$ settings_filters\.php [NC,L] +RewriteRule ^settings/media/?$ settings_media\.php [NC,L] # User RewriteBase / diff --git a/Caddyfile b/Caddyfile index 4bd7ab9..e0929f7 100644 --- a/Caddyfile +++ b/Caddyfile @@ -125,6 +125,10 @@ halcyon.domain.tld { r ^/settings/filters/?$ to /settings_filters.php } + rewrite { + r ^/settings/media/?$ + to /settings_media.php + } # End settings # Begin user diff --git a/README.md b/README.md index 764aacf..fda2350 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,15 @@ We moved our instances list to a wiki page: https://notabug.org/halcyon-suite/ha - Twitter like UI, familiar interface. - Able to use on all instances. - No tracking, No ads. -- Supports multiple languages +- Supports multiple languages. +- Privacy-friendly video embeds. ## Install [![Install Halcyon with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=halcyon) or read our new wiki pages to install it manually: https://notabug.org/halcyon-suite/halcyon/wiki ## Blog +- Release of Version 2.2.0 - Blog article coming soon - Release of Version 2.1.6 - Added search suggestions,fixed autocomplete bug,added instance info page,fixed small bug in profile settings,search for posts now supported - Release of Version 2.1.5 - Added support for filter,added possibility to filter all bots,it's now easier to detect bots - Release of Version 2.1.4 - Added custom profile fields,verified links,custom profile link settings and improved regular expressions for links @@ -63,3 +65,5 @@ or read our new wiki pages to install it manually: https://notabug.org/halcyon-s - [LascauxSRL/lsx-emojipicker](https://github.com/LascauxSRL/lsx-emojipicker) - [osapon/Pomo](https://github.com/osapon/Pomo) - [Summer-Dong/auto-complete-for-text-input-box](https://github.com/Summer-Dong/auto-complete-for-text-input-box) +- [youplay/yp-player](https://notabug.org/youplay/yp-player) +- [speranskydanil/Simple-Audio-Player](https://github.com/speranskydanil/Simple-Audio-Player) diff --git a/assets/css/dark.css b/assets/css/dark.css index 7676a83..d1e18bd 100644 --- a/assets/css/dark.css +++ b/assets/css/dark.css @@ -612,3 +612,22 @@ color:#FFF !important; .instance_field { border:1px solid #000000; } +.player { +border: 1px solid #000000; +color: #FFF; +} +.player .progress { +background: rgb(101, 119, 134); +} +.player .loaded { +background: #76BFEC; +} +.player .progress .pointer { +background: #189EFC; +} +.player .volume { +background: rgb(101, 119, 134); +} +.player .volume .pointer { +background: #189EFC; +} diff --git a/assets/css/style.css b/assets/css/style.css index ca31990..dcc98f4 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -2684,3 +2684,92 @@ border-radius:5px; padding-top:34px; padding-bottom:35px; } +.player, +.player * { +overflow: visible; +-webkit-box-sizing: border-box; +-moz-box-sizing: border-box; +box-sizing: border-box; +-webkit-touch-callout: none; +-webkit-user-select: none; +-khtml-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +} +.player { +width: 100%; +height: 33px; +margin: 0px 0px 10px 0px; +padding: 5px 15px; +border: 1px solid #DCDFE1; +font-size: 14px; +line-height: 21px; +color: #333; +-webkit-border-radius: 5px; +-moz-border-radius: 5px; +border-radius: 5px; +} +.player > div { +float: left; +margin-right: 10px; +} +.player .play { +width: 21px; +height: 21px; +font-size: 1.5em; +} +.player .time-left { +width: 50px; +height: 21px; +text-align: center; +} +.player .time-right { +width: 50px; +height: 21px; +text-align: center; +} +.player .progress { +width: calc(100% - 252px); +height: 9px; +margin-top: 6px; +background: #AAB8C2; +border-radius:9px; +} +.player .loaded { +width: 0px; +height: 9px; +border-radius:9px; +background: rgb(101, 119, 134); +} +.player .progress .pointer { +width: 15px; +height: 15px; +margin: -12px 0px 0px -3px; +background: #189EFC; +-webkit-border-radius: 50%; +-moz-border-radius: 50%; +border-radius: 50%; +} +.player .mute { +width: 21px; +height: 21px; +font-size: 1.5em; +} +.player .volume { +width: 60px; +height: 9px; +margin-top:6px; +margin-right: 0px; +background: #AAB8C2; +border-radius:9px; +} +.player .volume .pointer { +width: 15px; +height: 15px; +margin: -3px 0px 0px 27px; +background: #189EFC; +-webkit-border-radius: 50%; +-moz-border-radius: 50%; +border-radius: 50%; +} diff --git a/assets/js/halcyon/halcyonFunctions.js b/assets/js/halcyon/halcyonFunctions.js index 15eae09..f2bcc27 100644 --- a/assets/js/halcyon/halcyonFunctions.js +++ b/assets/js/halcyon/halcyonFunctions.js @@ -39,39 +39,39 @@ $(".h-card > a").each(function(i) { $(this).attr('href',getRelativeURL($(this).attr('href'))); }); $(".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]); -} -const mstags = $(this).attr('href').match(/https:\/\/.+..+\/tags\/([a-zA-Z\d_%]+)\/?$/); -if(mstags) { -$(this).attr('target','_self').attr('href','/search?q='+mstags[1]); -} -const plusers = $(this).attr('href').match(/https:\/\/.+..+\/users\/([a-zA-Z\d_]+)(\/statuses\/\d+)\/?$/); -if(plusers) { -$(this).attr('target','_self').attr('href','/@'+plusers[1]+'@'+$(this).attr('href').split("/")[2]); -} -const msusers = $(this).attr('href').match(/https:\/\/.+..+\/@([a-zA-Z\d_]+)\/?$/); -if(msusers) { -$(this).attr('target','_self').attr('href','/@'+msusers[1]+'@'+$(this).attr('href').split("/")[2]); -} -const msstatus = $(this).attr('href').match(/https:\/\/.+..+\/@([a-zA-Z\d_]+)(\/\d+)\/?$/); -if(msstatus) { -$(this).attr('target','_self').attr('href',"javascript:openStatus('"+msstatus[0]+"');void(0)"); -} -const msstatus2 = $(this).attr('href').match(/https:\/\/.+..+\/users\/([a-zA-Z\d_]+)\/?$/); -if(msstatus2) { -$(this).attr('target','_self').attr('href',"javascript:openStatus('"+msstatus2[0]+"');void(0)"); -} -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)"); -} -if(localStorage.setting_link_previews == "true") { +const pltags = $(this).attr('href').match(/https?:\/\/.+..+\/tag\/([a-zA-Z\d_%]+)\/?$/); +if(pltags) $(this).attr('target','_self').attr('href','/search?q='+pltags[1]); +const mstags = $(this).attr('href').match(/https?:\/\/.+..+\/tags\/([a-zA-Z\d_%]+)\/?$/); +if(mstags) $(this).attr('target','_self').attr('href','/search?q='+mstags[1]); +const plusers = $(this).attr('href').match(/https?:\/\/.+..+\/users\/([a-zA-Z\d_]+)(\/statuses\/\d+)\/?$/); +if(plusers) $(this).attr('target','_self').attr('href','/@'+plusers[1]+'@'+$(this).attr('href').split("/")[2]); +const msusers = $(this).attr('href').match(/https?:\/\/.+..+\/@([a-zA-Z\d_]+)\/?$/); +if(msusers) $(this).attr('target','_self').attr('href','/@'+msusers[1]+'@'+$(this).attr('href').split("/")[2]); +const msstatus = $(this).attr('href').match(/https?:\/\/.+..+\/@([a-zA-Z\d_]+)(\/\d+)\/?$/); +if(msstatus) $(this).attr('target','_self').attr('href',"javascript:openStatus('"+msstatus[0]+"');void(0)"); +const msstatus2 = $(this).attr('href').match(/https?:\/\/.+..+\/users\/([a-zA-Z\d_]+)\/?$/); +if(msstatus2) $(this).attr('target','_self').attr('href',"javascript:openStatus('"+msstatus2[0]+"');void(0)"); +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)"); +}); +$(".toot_article a").each(function(i) { +const ytcom = $(this).attr('href').match(/https?:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z\d_-]+)/); +const htcom = $(this).attr('href').match(/https?:\/\/(www\.)?hooktube\.com\/watch\?v=([a-zA-Z\d_-]+)/); +const ivcom = $(this).attr('href').match(/https?:\/\/(www\.)?invidio\.us\/watch\?v=([a-zA-Z\d_-]+)/); +const ytbe = $(this).attr('href').match(/https?:\/\/(www\.)?youtu\.be\/([a-zA-Z\d_-]+)/); +const htbe = $(this).attr('href').match(/https?:\/\/(www\.)?hooktube\.com\/([a-zA-Z\d_-]+)/); +const vimeo = $(this).attr('href').match(/https?:\/\/(www\.)?vimeo\.com\/([\d]+)/); +const peertube = $(this).attr('href').match(/https?:\/\/.+..+\/videos\/watch\/([\da-z]{8}-[\da-z]{4}-[\da-z]{4}-[\da-z]{4}-[\da-z]{12})\/?$/); +if(ytcom) embedMedia("youtube",$(this).closest(".toot_article"),ytcom[2]); +else if(htcom) embedMedia("youtube",$(this).closest(".toot_article"),htcom[2]); +else if(ivcom) embedMedia("youtube",$(this).closest(".toot_article"),ivcom[2]); +else if(ytbe) embedMedia("youtube",$(this).closest(".toot_article"),ytbe[2]); +else if(htbe) embedMedia("youtube",$(this).closest(".toot_article"),htbe[2]); +else if(vimeo) embedMedia("vimeo",$(this).closest(".toot_article"),vimeo[2]); +else if(peertube) embedMedia("peertube",$(this).closest(".toot_article"),peertube[0].replace("/watch/","/embed/")); +else if(localStorage.setting_link_previews == "true") { if(!window.cards) { cards = new Array(); } @@ -476,3 +476,34 @@ window.location.href = "/404"; } }); } +function embedMedia(source,element,watchid) { +if(element.children(".media_views").length == 0) { +let media_views = `