diff --git a/README.md b/README.md index d8f86d0..f3bf37a 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Follow or Mastodon account and never miss an important update: [@halcyon@social. ## Instances These instances are publicly accessible and usable by everyone, no matter which Mastodon instance you use. -- https://halcyon.toromino.de - 1.1.2 +- https://halcyon.toromino.de - 1.1.3 - https://social.dev-wiki.de - 1.1.1 -- https://halcyon.bka.li - 1.1.2 +- https://halcyon.bka.li - 1.1.3 - https://halcyon.tilde.team - 1.1.2 - https://itter.photog.social - 1.1.1 - https://halcyon.cybre.space - Outdated @@ -20,6 +20,7 @@ These instances are publicly accessible and usable by everyone, no matter which You have your own Halcyon instance and want it to be listed here? Create an issue with the link and we will add it to the list. ## Blog +- Release of Version 1.1.3 - New function link previews introduced and bug when replying an toot which already has replies below it fixed (reply to undefined) - Release of Version 1.1.2 - Privacy modes are now correctly displayed and used for replies,use username if display name doesn't exist,bugs on search page fixed - Release of Version 1.1.1 - Fixed error 404 when viewing profile of own instance,numbers below profile on the left do now change during session,added nginx config - [Release of Version 1.1.0 and upcoming features](http://nikisoft.myblog.de/nikisoft/art/11389499/Halcyon-What-we-did-and-what-we-will-do) diff --git a/assets/css/style.css b/assets/css/style.css index 359485b..309e5f4 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -2337,3 +2337,49 @@ border-bottom: none; .media_detail .toot_entry .media_views { display: none; } +.switch { +width: 60px; +height: 30px; +margin:auto; +margin-top:8px; +margin-bottom:16px; +} +.switch input { +width: 60px; +height: 30px; +position: absolute; +filter: alpha(opacity=0); +opacity: 0; +outline: none; +z-index: 9; +} +.switch input:hover { +cursor: pointer; +} +.switch-btn { +background: #AAB8C2; +width: 100%; +height: 100%; +border-radius: 20px; +position: relative; +} +.switch-btn span { +background: #fff; +width: 26px; +height: 26px; +display: block; +border-radius: 50%; +position: absolute; +top: 2px; +left: 2px; +-webkit-transition: all .5s; +-moz-transition: all .5s; +-o-transition: all .5s; +transition: all .5s; +} +.switch input:checked + .switch-btn span { +left: 32px; +} +.switch input:checked + .switch-btn { +background: #189EFC; +} diff --git a/assets/js/halcyon/halcyonFunctions.js b/assets/js/halcyon/halcyonFunctions.js index 4b7c4d7..c87c528 100644 --- a/assets/js/halcyon/halcyonFunctions.js +++ b/assets/js/halcyon/halcyonFunctions.js @@ -43,6 +43,71 @@ const tags = $(this).attr('href').match(/https:\/\/.+..+\/tags\/(.+)\/?/); if (tags) { $(this).attr('href','/search?q='+tags[1]); } +if(localStorage.setting_link_previews == "true") { +if(!window.cards) { +cards = new Array(); +} +if(!$(this).attr("class") && $(this).parent().parent().parent().parent().parent().attr("sid") != undefined) { +if(!cards[$(this).parent().parent().parent().parent().parent().attr("sid")]) { +var this_id = $(this).parent().parent().parent().parent().parent().attr("sid"); +api.get("statuses/"+$(this).parent().parent().parent().parent().parent().attr("sid")+"/card",function(data) { +cards[this_id] = data; +if($(".toot_entry[sid="+this_id+"]").children().children("section").children("article").children(".link_preview").length == 0 && data.url) { +$(".toot_entry[sid="+this_id+"]").children().children("section").children("article").append( +$("
").addClass("media_views").addClass("link_preview").attr("sid",this_id).attr("media_length",1).css("height","unset").data("url",data.url).append( +$("").attr("src",data.image).width(data.width).css("max-width","200px").css("float","left").css("margin-right","5px")).append( +$("").text(data.title)).append($("
")).append( +$("").text(data.description)).append($("
")).append( +$("").css("color","#777777").text(data.url)).click(function(e) { +e.stopPropagation(); +window.open($(this).data("url"),"_blank"); +}) +); +} +if($(".main_status[sid="+this_id+"]").children().children("section").children("article").children(".link_preview").length == 0 && data.url) { +$(".main_status[sid="+this_id+"]").children().children("section").children("article").append( +$("
").addClass("media_views").addClass("link_preview").attr("sid",this_id).attr("media_length",1).css("height","unset").data("url",data.url).append( +$("").attr("src",data.image).width(data.width).css("max-width","200px").css("float","left").css("margin-right","5px")).append( +$("").text(data.title)).append($("
")).append( +$("").text(data.description)).append($("
")).append( +$("").css("color","#777777").text(data.url)).click(function(e) { +e.stopPropagation(); +window.open($(this).data("url"),"_blank"); +}) +); +} +}); +} +else { +var this_id = $(this).parent().parent().parent().parent().parent().attr("sid"); +data = cards[this_id]; +if($(".toot_entry[sid="+this_id+"]").children().children("section").children("article").children(".link_preview").length == 0 && data.url) { +$(".toot_entry[sid="+this_id+"]").children().children("section").children("article").append( +$("
").addClass("media_views").addClass("link_preview").attr("sid",this_id).attr("media_length",1).css("height","unset").data("url",data.url).append( +$("").attr("src",data.image).width(data.width).css("max-width","200px").css("float","left").css("margin-right","5px")).append( +$("").text(data.title)).append($("
")).append( +$("").text(data.description)).append($("
")).append( +$("").css("color","#777777").text(data.url)).click(function(e) { +e.stopPropagation(); +window.open($(this).data("url"),"_blank"); +}) +); +} +if($(".main_status[sid="+this_id+"]").children().children("section").children("article").children(".link_preview").length == 0 && data.url) { +$(".main_status[sid="+this_id+"]").children().children("section").children("article").append( +$("
").addClass("media_views").addClass("link_preview").attr("sid",this_id).attr("media_length",1).css("height","unset").data("url",data.url).append( +$("").attr("src",data.image).width(data.width).css("max-width","200px").css("float","left").css("margin-right","5px")).append( +$("").text(data.title)).append($("
")).append( +$("").text(data.description)).append($("
")).append( +$("").css("color","#777777").text(data.url)).click(function(e) { +e.stopPropagation(); +window.open($(this).data("url"),"_blank"); +}) +); +} +} +} +} }); } function getConversionedDate(key, value) { diff --git a/assets/js/halcyon/halcyonUI.js b/assets/js/halcyon/halcyonUI.js index 3f88cd0..3405d19 100644 --- a/assets/js/halcyon/halcyonUI.js +++ b/assets/js/halcyon/halcyonUI.js @@ -1204,7 +1204,7 @@ ${media_views}