diff --git a/README.md b/README.md index 05b286a..1bd1d4a 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ 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.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) - Release of Version 2.3.4 - Introduce BlurHash,repair YouPlay,improve link previews feature,add debug mode,add lighttpd example config,bug fixes - Release of Version 2.3.3 - New media uploader,sort uploads,drag&drop and copy&paste uploads,fix automatic dark mode diff --git a/assets/css/style.css b/assets/css/style.css index b4d57c9..9c90ff3 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -333,6 +333,11 @@ outline:0; .poll_time input:invalid { box-shadow:none; } +.poll_time_warning { +width:100%; +text-align:center; +color:#FF0000; +} .poll_mc_switch { margin:0 !important; display:inline-block; @@ -850,7 +855,7 @@ border-radius: 3px; box-sizing: border-box; background-color: #fff; box-shadow: 0.5px 0.5px 3px rgba(0,0,0,0.26); -z-index: 1; +z-index: 9; } .toot_entry .toot_entry_body .toot_content .toot_header .expand_button_wrap .expand_menu::before { display: block; @@ -986,32 +991,42 @@ object-fit: cover; .media_views .media_attachment > iframe { object-fit: fill; } -.media_views.sensitive .sensitive_alart { +.media_attachment .sensitive_alert { +display:none; +} +.media_attachment.sensitive .sensitive_alert { display: flex; z-index: 1; flex-direction: column; justify-content: center; align-items: center; -position: absolute; +position: relative; width: 100%; height: 100%; +top:-100%; +overflow:hidden; background-color: #000; background-size:cover; background-position:center; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; } -.media_views.sensitive .sensitive_alart .text1 { +.media_attachment.sensitive .sensitive_alert .text1 { font-size: 26px; +line-height:20px; font-weight: 200; padding: 8px 16px; color: #fff; } -.media_views.sensitive .sensitive_alart .text2 { +.media_attachment.sensitive .sensitive_alert .text2 { +font-size:15px; font-weight: 200; padding: 2px 4px; margin-top: 3px; color: #fff; } +.media_attachment.sensitive iframe+.sensitive_alert { +top:calc(-100% - 7px); +} .media_views[media_length="2"] { display: flex; } @@ -2575,7 +2590,8 @@ border-bottom-left-radius: 5px; .media_detail .toot_entry .toot_entry_body { border-bottom: none; } -.media_detail .toot_entry .media_views { +.media_detail .toot_entry .media_views, +.media_detail .toot_entry .player { display: none; } .switch { diff --git a/assets/js/halcyon/halcyonFunctions.js b/assets/js/halcyon/halcyonFunctions.js index f6725d9..5bfbbe2 100644 --- a/assets/js/halcyon/halcyonFunctions.js +++ b/assets/js/halcyon/halcyonFunctions.js @@ -34,6 +34,11 @@ txt.focus(); }); } })(jQuery); +$.extend($.expr[':'],{ +blank:function(el){ +return $(el).val().match(/^\s*$/); +} +}); }); function indicesOf(input,value) { var indices = new Array(); @@ -160,6 +165,7 @@ api.get("accounts/verify_credentials",function(AccountObj) { AccountObj.display_name = htmlEscape(AccountObj.display_name); for(var i=0;i"); +current_filters = new Array; } localStorage.setItem("current_display_name",AccountObj["display_name"]); localStorage.setItem("current_acct",AccountObj["acct"]); @@ -171,7 +177,6 @@ localStorage.setItem("current_statuses_count",AccountObj["statuses_count"]); localStorage.setItem("current_following_count",AccountObj["following_count"]); localStorage.setItem("current_followers_count",AccountObj["followers_count"]); localStorage.setItem("current_follow_loaded","false"); -localStorage.setItem("current_filters","[]"); current_display_name = localStorage.getItem("current_display_name"); current_acct = localStorage.getItem("current_acct"); current_url = localStorage.getItem("current_url"); @@ -181,7 +186,6 @@ current_locked = localStorage.getItem("current_locked"); current_statuses_count = localStorage.getItem("current_statuses_count"); current_following_count = localStorage.getItem("current_following_count"); current_followers_count = localStorage.getItem("current_followers_count"); -current_filters = JSON.parse(localStorage.getItem("current_filters")); current_search_history = JSON.parse(localStorage.getItem("current_search_history")); setCurrentProfile(); }); @@ -219,14 +223,18 @@ localStorage.setItem("current_muted_accts",JSON.stringify(mutes)); current_muted_accts = mutes; }); api.get("instance",function(data) { -if(data.max_toot_chars) { +if(!data.max_toot_chars) data.max_toot_chars = 500; +if(!data.poll_limits) { +data.poll_limits = new Object(); +data.poll_limits.max_options = 4; +data.poll_limits.max_option_chars = 25; +data.poll_limits.min_expiration = 300; +data.poll_limits.max_expiration = 2629746; +} localStorage.setItem("current_instance_charlimit",data.max_toot_chars); current_instance_charlimit = data.max_toot_chars; -} -else { -localStorage.setItem("current_instance_charlimit",500); -current_instance_charlimit = 500; -} +localStorage.setItem("current_instance_poll_limits",JSON.stringify(data.poll_limits)); +current_instance_poll_limits = data.poll_limits; }); api.get("custom_emojis",function(data) { var emojis = new Array(); @@ -264,6 +272,7 @@ current_following_count = localStorage.getItem("current_following_count"); current_followers_count = localStorage.getItem("current_followers_count"); current_following_accts = localStorage.getItem("current_following_accts"); current_instance_charlimit = localStorage.getItem("current_instance_charlimit"); +current_instance_poll_limits = JSON.parse(localStorage.getItem("current_instance_poll_limits")); current_blocked_accts = localStorage.getItem("current_blocked_accts"); current_muted_accts = localStorage.getItem("current_muted_accts"); current_filters = JSON.parse(localStorage.getItem("current_filters")); @@ -308,6 +317,7 @@ localStorage.setItem("setting_desktop_notifications","false"); if(localStorage.setting_who_to_follow == "true") { setWhoToFollow(); } +if(!localStorage.hide_firefox_download || localStorage.hide_firefox_download != "true") $("#widget_ffdl").show(); replace_emoji(); } function putMessage(Message) { diff --git a/assets/js/halcyon/halcyonTemplates.js b/assets/js/halcyon/halcyonTemplates.js index af77117..d2cb9da 100644 --- a/assets/js/halcyon/halcyonTemplates.js +++ b/assets/js/halcyon/halcyonTemplates.js @@ -2,87 +2,96 @@ function mediaattachments_template(status) { let media_views = ""; var border = ""; var mvfullheight = ""; -var blurbackground = ""; +var media_embeds = new Array(); +var audio_embeds = new Array(); var dsplength = status.media_attachments.length; -if(status.media_attachments[0].remote_url != null) { -status.media_attachments[0].url = status.media_attachments[0].remote_url; +for(var i=0;i + +
+${__('Sensitive content')} +${status.media_attachments[i].description} +
+`); } -if(status.media_attachments[0].type === "video" && localStorage.setting_play_video != "false") border = ' style="border:0;border-radius:0"'; -if(localStorage.setting_full_height == "true" && status.media_attachments.length == 1 && (status.media_attachments[0].type == "image" || (status.media_attachments[0].type === "video" && localStorage.setting_play_video == "false") || (status.media_attachments[0].type === "gifv" && localStorage.setting_play_gif == "false"))) { +else if(status.media_attachments[i].type === "video") { +var vidprev = ""; +if(status.media_attachments[i].preview_url != status.media_attachments[i].url) vidprev = "&preview="+encodeURIComponent(status.media_attachments[i].preview_url); +media_embeds.push(` +
+ +
+${__('Sensitive content')} +${status.media_attachments[i].description} +
+
`); +} +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(` +
+ +
+${__('Sensitive content')} +${status.media_attachments[i].description} +
+
`); +} +else if(status.media_attachments[i].type === "audio" || (status.media_attachments[i].type === "unknown" && status.media_attachments[i].url.substring(status.media_attachments[i].url.length-4) == ".mp3")) { +if(localStorage.setting_play_audio != "false") { +var audio_embed = $("
").attr("title",status.media_attachments[i].description).addClass("player"); +audio_embed.player(status.media_attachments[i].url); +audio_embeds.push(audio_embed); +} +} +else if(status.media_attachments[i].type === "image") { +media_embeds.push(` +
+ +
+${__('Sensitive content')} +${status.media_attachments[i].description} +
+
`); +} +} +if(status.media_attachments[0].type === "video" && localStorage.setting_play_video != "false" && dsplength == 1) border = ' style="border:0;border-radius:0"'; +if(localStorage.setting_full_height == "true" && status.media_attachments.length == 1 && (status.media_attachments[0].type == "image" || (status.media_attachments[0].type === "video" && localStorage.setting_play_video == "false") || (status.media_attachments[0].type === "gifv" && localStorage.setting_play_gif == "false"))) mvfullheight = " media_full_height"; -dsplength = "1"; -} -if(status.media_attachments[0].url === "/files/original/missing.png") { -return ""; -} -else if(!status.sensitive || localStorage.setting_show_nsfw == "true") { media_views = `
`; +if(media_embeds.length < 3) { +for(let i in media_embeds) { +media_views += media_embeds[i]; +} } else { -if(status.media_attachments[0].blurhash) blurbackground = 'style="background-image:url('+getBlurImage(status.media_attachments[0].blurhash)+')"'; -media_views = `
-
-${__('Sensitive content')} -${__('Click to view')} -
`; -} -if((status.media_attachments[0].type === "video" && localStorage.setting_play_video == "false") || (status.media_attachments[0].type === "gifv" && localStorage.setting_play_gif == "false")) { -media_views += (` -
- -
`); -} else if(status.media_attachments[0].type === "video") { -media_views += (` -
- -
`); -} else if(status.media_attachments[0].type === "gifv") { -media_views += (` -
- -
`); -} else if(status.media_attachments[0].type === "audio" || (status.media_attachments[0].type === "unknown" && status.media_attachments[0].url.substring(status.media_attachments[0].url.length-4) == ".mp3")) { -if(localStorage.setting_play_audio != "false") { -media_views = $("
").addClass("player"); -media_views.player(status.media_attachments[0].url); -} -} else { -if ( status.media_attachments.length <= 2 ) { -for ( let i in status.media_attachments ) { -if(status.media_attachments[i].remote_url != null) { -status.media_attachments[i].url = status.media_attachments[i].remote_url; -} -media_views += (` -
- -
`); -} -} else { -for ( let i in status.media_attachments ) { -if (Number(i) === 1) { -if(status.media_attachments[i].remote_url != null) { -status.media_attachments[i].url = status.media_attachments[i].remote_url; -} -media_views += (` -
-
- -
`); -} else { -media_views += (` -
- -
`); +for(let i in media_embeds) { +if(Number(i) === 1) { +media_views += (`
`); +media_views += media_embeds[i]; } +else media_views += media_embeds[i]; } media_views += "
"; } media_views += "
"; +var media_view = $("
"); +media_view.append(media_views); +if(status.sensitive) media_view.find(".media_attachment").addClass("sensitive"); +for(let i in audio_embeds) { +media_view.append(audio_embeds[i]); } -return media_views; +return media_view; } function link_preview_template(card) { if(localStorage.setting_link_previews == "true") { @@ -109,7 +118,9 @@ function poll_template(poll) { let poll_html = ""; var expires_at = new Date(new Date(poll.expires_at).getTime()-Date.now()); var expires_string; -if(expires_at.getUTCDate() == 2) expires_string = "1 "+__("day"); +if(expires_at.getUTCMonth() == 1) expires_string = "1 "+__("month"); +else if(expires_at.getUTCMonth() > 1) expires_string = (expires_at.getUTCMonth())+" "+__("months"); +else if(expires_at.getUTCDate() == 2) expires_string = "1 "+__("day"); else if(expires_at.getUTCDate() > 2) expires_string = (expires_at.getUTCDate()-1)+" "+__("days"); else if(expires_at.getUTCHours() == 1) expires_string = "1 "+__("hour"); else if(expires_at.getUTCHours() > 1) expires_string = expires_at.getUTCHours()+" "+__("hours"); @@ -1342,14 +1353,15 @@ ${toot_reblog_button}