From e75fac8cbec6d45dbc9626d77e23e5f22b94c4db Mon Sep 17 00:00:00 2001 From: nipos Date: Mon, 25 Feb 2019 18:18:21 +0100 Subject: [PATCH] Fixed login with Pleroma,fixed compatibility with Pawoo (older Mastodon),added support for prefers-color-scheme,some more fixes --- README.md | 4 +- assets/js/halcyon/halcyonFunctions.js | 4 + assets/js/halcyon/halcyonSettings.js | 18 +++++ assets/js/halcyon/halcyonTemplates.js | 104 ++++++++++++++++++++++---- assets/js/halcyon/halcyonUI.js | 2 + assets/js/mastodon.js/mastodon.js | 2 + authorize/mastodon-api/mastodon.php | 2 +- authorize/mastodon.php | 4 +- header.php | 11 ++- login/auth.php | 2 +- login/header.php | 7 +- login/login.php | 2 +- settings_appearance.php | 7 +- version.txt | 2 +- 14 files changed, 143 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 4fa1328..7491a8c 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,11 @@ We moved our instances list to a wiki page: https://notabug.org/halcyon-suite/ha ## 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 +or read our new documentation pages to install it manually: https://www.halcyon.social/documentation.php?page=install ## Blog +- Release of Version 2.2.3 - Fixed login with Pleroma,fixed compatibility with Pawoo (older Mastodon),added support for prefers-color-scheme,some more fixes +- Our new information website [halcyon.social](https://www.halcyon.social) came online - Release of Version 2.2.2 - Fix autocomplete,fix double scrollbars in overlay,add emojis at cursor position,confirm when closing compose window,add czech translation - Release of Version 2.2.1 - Many small bugfixes (details see release notes) and improved compatibility to the new Pleroma API - [Release of Version 2.2.0 - Privacy-focused media streaming and more](https://nikisoft.myblog.de/nikisoft/art/11644403/Privacy-focused-media-streaming-and-more-The-new-Halcyon-2-2-0) diff --git a/assets/js/halcyon/halcyonFunctions.js b/assets/js/halcyon/halcyonFunctions.js index a6fa80a..1724465 100644 --- a/assets/js/halcyon/halcyonFunctions.js +++ b/assets/js/halcyon/halcyonFunctions.js @@ -271,6 +271,7 @@ localStorage.setItem("current_following_count_link",getRelativeURL(AccountObj["u localStorage.setItem("current_followers_count_link",getRelativeURL(AccountObj["url"],AccountObj["id"],'/followers')); localStorage.setItem("current_favourites_link",getRelativeURL(AccountObj["url"],AccountObj["id"],'/favourites')); 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"); @@ -284,6 +285,7 @@ current_statuses_count_link = localStorage.getItem("current_statuses_count_link" current_following_count_link = localStorage.getItem("current_following_count_link"); current_followers_count_link = localStorage.getItem("current_followers_count_link"); current_favourites_link = localStorage.getItem("current_favourites_link"); +current_filters = JSON.parse(localStorage.getItem("current_filters")); current_search_history = JSON.parse(localStorage.getItem("current_search_history")); setCurrentProfile(); }); @@ -339,6 +341,7 @@ emoji.url = data[i].url; emojis.push(emoji); } localStorage.setItem("current_custom_emojis",JSON.stringify(emojis)); +$(document).trigger("emojiready"); }); api.get("filters",function(data) { localStorage.setItem("current_filters",JSON.stringify(data)); @@ -373,6 +376,7 @@ current_blocked_accts = localStorage.getItem("current_blocked_accts"); current_muted_accts = localStorage.getItem("current_muted_accts"); current_filters = JSON.parse(localStorage.getItem("current_filters")); current_search_history = JSON.parse(localStorage.getItem("current_search_history")); +$(document).trigger("emojiready"); $(function() {setCurrentProfile()}); } function setCurrentProfile() { diff --git a/assets/js/halcyon/halcyonSettings.js b/assets/js/halcyon/halcyonSettings.js index 71b2b32..227253d 100644 --- a/assets/js/halcyon/halcyonSettings.js +++ b/assets/js/halcyon/halcyonSettings.js @@ -173,6 +173,10 @@ else if(window.location.pathname == "/settings/appearance") { $('#js-settings_nav_appearance').toggleClass('view'); $(function() { $(".post_streaming_wrap input[name='post_streaming'][value='"+localStorage.getItem("setting_post_stream")+"']")[0].checked = true; +if($("#setting_dark_theme").attr("default") == "default") { +$("#setting_dark_theme_reset").hide(); +if(window.matchMedia("prefers-color-scheme:dark").matches) $("#setting_dark_theme")[0].checked = true; +} if(localStorage.setting_link_previews == "true") { $("#setting_link_previews")[0].checked = true; } @@ -209,6 +213,7 @@ localStorage.setItem("setting_post_stream", $(this).val()); putMessage(__("Changed setting to")+" "+$(this).val()); }); $("#setting_dark_theme").change(function() { +$("#setting_dark_theme_reset").fadeIn(); if(this.checked) { $.cookie("darktheme","true",{path:'/',expires:3650}); $(document.body).append($("").attr("rel","stylesheet").attr("href","/assets/css/dark.css")); @@ -220,6 +225,19 @@ $("link[href='/assets/css/dark.css']").remove(); putMessage(__("Dark theme disabled")); } }); +$("#setting_dark_theme_reset").click(function() { +$.cookie("darktheme","unset",{path:'/',expires:3650}); +$("#setting_dark_theme_reset").fadeOut(); +if(window.matchMedia("prefers-color-scheme:dark").matches) { +$("#setting_dark_theme")[0].checked = true; +if($("link[href='/assets/css/dark.css']").length == 0) $(document.body).append($("").attr("rel","stylesheet").attr("href","/assets/css/dark.css")); +} +else { +$("#setting_dark_theme")[0].checked = false; +$("link[href='/assets/css/dark.css']").remove(); +} +putMessage(__("Dark theme reset to standard")); +}); $("#setting_link_previews").change(function() { if(this.checked) { localStorage.setItem("setting_link_previews","true"); diff --git a/assets/js/halcyon/halcyonTemplates.js b/assets/js/halcyon/halcyonTemplates.js index 6a12f67..cfc3045 100644 --- a/assets/js/halcyon/halcyonTemplates.js +++ b/assets/js/halcyon/halcyonTemplates.js @@ -82,9 +82,13 @@ for(i=0;i"); } status.account.display_name = htmlEscape(status.account.display_name); -for(i=0;i"); } +for(var i=0;i"; } +if(status.replies_count) { +toot_replies_count = status.replies_count; +} if (status.reblogs_count) { toot_reblogs_count = status.reblogs_count; } @@ -204,7 +212,7 @@ ${status.content}
${toot_reblog_button} @@ -237,6 +245,10 @@ status.reblog.account.display_name = htmlEscape(status.reblog.account.display_na for(i=0;i"); } +for(var i=0;i"; } +if(status.reblog.replies_count) { +toot_replies_count = status.reblog.replies_count; +} if (status.reblog.reblogs_count) { toot_reblogs_count = status.reblog.reblogs_count; } @@ -351,7 +367,7 @@ ${status.reblog.content}
@@ -387,6 +403,10 @@ status.account.display_name = htmlEscape(status.account.display_name); for(i=0;i"); } +for(var i=0;i"; } +if(status.replies_count) { +toot_replies_count = status.replies_count; +} if (status.reblogs_count) { toot_reblogs_count = status.reblogs_count; } @@ -489,7 +513,7 @@ ${status.content}
@@ -541,6 +565,10 @@ NotificationObj.status.account.display_name = htmlEscape(NotificationObj.status. for(i=0;i"); } +for(var i=0;i"); } +for(var i=0;i"); } +for(var i=0;i"; } +if(NotificationObj.status.replies_count) { +toot_replies_count = NotificationObj.status.replies_count; +} if (NotificationObj.status.reblogs_count) { toot_reblogs_count = NotificationObj.status.reblogs_count; } @@ -735,7 +775,7 @@ ${NotificationObj.status.account.display_name} `); -history.pushState(null, null, getRelativeURL(status.account.url, status.account.id, '/status/'+status.id)); +history.pushState(null, null, status_account_link.replace("?mid=",'/status/'+status.id+"?mid=")); html.find(".toot_article").append(media_views); return html } else { @@ -1072,6 +1120,7 @@ if(status.account.acct.indexOf("@") == -1) status_account_link = "/@"+status.ac else status_account_link = "/@"+status.account.acct+"?mid="+status.account.id; let alart_text= "", article_option= "", +toot_replies_count = "", toot_reblogs_count= "", toot_favourites_count = "", media_views = ""; @@ -1086,6 +1135,10 @@ status.reblog.account.display_name = htmlEscape(status.reblog.account.display_na for(i=0;i"); } +for(var i=0;i"; } +if(status.reblog.replies_count) { +toot_replies_count = status.reblog.replies_count; +} if (status.reblog.reblogs_count) { toot_reblogs_count = status.reblog.reblogs_count; } @@ -1182,7 +1238,7 @@ ${status.reblog.content}
@@ -1280,7 +1336,7 @@ ${current_instance_charlimit}
`); -history.pushState(null, null, getRelativeURL(status.reblog.account.url, status.reblog.id, '/status/'+status.reblog.id)); +history.pushState(null, null, status_reblog_account_link.replace("?mid=",'/status/'+status.reblog.id+"?mid=")); html.find(".toot_article").append(media_views); return html } @@ -1317,6 +1373,7 @@ const status_datetime= getRelativeDatetime(Date.now(), getConversionedDate(null, status_attr_datetime = getConversionedDate(null, status.created_at); let alart_text= "", article_option= "", +toot_replies_count = "", toot_reblogs_count= "", toot_favourites_count = "", media_views = ""; @@ -1327,6 +1384,10 @@ status.account.display_name = htmlEscape(status.account.display_name); for(i=0;i"); } +for(var i=0;i"; } +if(status.replies_count) { +toot_replies_count = status.replies_count; +} if (status.reblogs_count) { toot_reblogs_count = status.reblogs_count; } @@ -1413,7 +1477,7 @@ ${status.account.display_name}