Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
nipos | dfdfccc044 | |
nipos | 82ae0882d1 | |
nipos | eabad44fea | |
nipos | aadcb94355 |
|
@ -1,4 +1,4 @@
|
|||
config.ini
|
||||
.ftpconfig
|
||||
data/
|
||||
|
||||
.htpasswd
|
|
@ -31,6 +31,10 @@ RewriteRule ^federated/?$ federated\.php [NC,L]
|
|||
RewriteBase /notifications
|
||||
RewriteRule ^notifications/?$ notifications\.php [NC,L]
|
||||
|
||||
# Bookmarks
|
||||
RewriteBase /bookmarks
|
||||
RewriteRule ^bookmarks/?$ bookmarks\.php [NC,L]
|
||||
|
||||
# Who to follow
|
||||
RewriteBase /whotofollow
|
||||
RewriteRule ^whotofollow/?$ who_to_follow\.php [NC,L]
|
||||
|
|
|
@ -67,6 +67,12 @@ halcyon.domain.tld {
|
|||
r ^/notifications/?$
|
||||
to /notifications.php
|
||||
}
|
||||
|
||||
# Bookmarks
|
||||
rewrite {
|
||||
r ^/bookmarks/?$
|
||||
to /bookmarks.php
|
||||
}
|
||||
|
||||
# Who to follow
|
||||
rewrite {
|
||||
|
|
|
@ -28,6 +28,9 @@ 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.9 - View state of ongoing polls,Fix some links,fix search for urls,add Chinese translation,update media API
|
||||
- Release of Version 2.4.8 - Add support for bookmarks,add support for announcements,add support for emoji reactions
|
||||
- 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
|
||||
|
|
|
@ -587,7 +587,7 @@ border-bottom:0 solid #E6ECF0;
|
|||
background-color:#189EFC;
|
||||
color:#fff;
|
||||
}
|
||||
.toot_entry .toot_entry_body .toot_content .toot_article a,#main .article_wrap .left_column .profile_section_wrap > .profile_bio a {
|
||||
.toot_entry .toot_entry_body .toot_content .toot_article a,#main .article_wrap .left_column .profile_section_wrap > .profile_bio a,.announcement .announcement_content .announcement_text a {
|
||||
color:#189EFC;
|
||||
}
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction button,.toot_detail .toot_footer .toot_reaction button {
|
||||
|
@ -690,3 +690,35 @@ color:#189EFC;
|
|||
background-color:#189EFC;
|
||||
color:#1B2836;
|
||||
}
|
||||
.announcement {
|
||||
background-color:#243447;
|
||||
border:1px solid #000;
|
||||
}
|
||||
.announcement_icon {
|
||||
color:#AAB8C2;
|
||||
}
|
||||
.announcement_text {
|
||||
color:#EEE;
|
||||
}
|
||||
.emoreact {
|
||||
border:1px solid #189EFC;
|
||||
}
|
||||
.emoreact .emoreact_count {
|
||||
color:#189EFC;
|
||||
}
|
||||
.emoreact.active,
|
||||
.emoreact:hover {
|
||||
background-color:#189EFC;
|
||||
}
|
||||
.emoreact.active .emoreact_count,
|
||||
.emoreact:hover .emoreact_count {
|
||||
color:#FFFFFF;
|
||||
}
|
||||
.emoreact_add {
|
||||
border:1px solid #189EFC;
|
||||
color:#189EFC;
|
||||
}
|
||||
.emoreact_add:hover {
|
||||
background-color:#189EFC;
|
||||
color:#FFFFFF;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ transition: all 0.5s ease-in-out;
|
|||
-webkit-transition: all 0.5s ease-in-out;
|
||||
display: none;
|
||||
font-family:"apple color emoji","segoe ui emoji",notocoloremoji,"segoe ui symbol","android emoji",emojisymbols,"emojione mozilla";
|
||||
color:initial;
|
||||
}
|
||||
ul.lsx-emojipicker-tabs {
|
||||
margin: 0;
|
||||
|
|
|
@ -915,7 +915,9 @@ font-size: 14px;
|
|||
line-height: 20px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.toot_entry .toot_entry_body .toot_content .toot_article a,.halcyon_link {
|
||||
.toot_entry .toot_entry_body .toot_content .toot_article a,
|
||||
.announcement .announcement_content .announcement_text a,
|
||||
.halcyon_link {
|
||||
color: #2588D0;
|
||||
}
|
||||
.toot_entry .toot_entry_body .toot_content .toot_article.content_warning .status_content {
|
||||
|
@ -925,7 +927,7 @@ display: none;
|
|||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
width: 240px;
|
||||
width: 320px;
|
||||
height: 21px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
@ -956,18 +958,22 @@ font-weight: 600;
|
|||
.toot_entry .toot_entry_body .toot_content .toot_reaction .reply_button:hover {
|
||||
color: #1DA1F2;
|
||||
}
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .boost_button[reblogged="null"]:hover,
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .boost_button[reblogged="false"]:hover,
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .boost_button[reblogged="true"],
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .boost_button[reblogged="null"]:hover .reaction_count,
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .boost_button[reblogged="false"]:hover .reaction_count,
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .boost_button[reblogged="true"] .reaction_count {
|
||||
color: #17BF63;
|
||||
}
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .fav_button[favourited="null"]:hover,
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .fav_button[favourited="false"]:hover,
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .fav_button[favourited="true"],
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .fav_button[favourited="null"]:hover .reaction_count,
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .fav_button[favourited="false"]:hover .reaction_count,
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .fav_button[favourited="true"] .reaction_count {
|
||||
color: #FFAD1A;
|
||||
}
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .bookmark_button[bookmarked="false"]:hover,
|
||||
.toot_entry .toot_entry_body .toot_content .toot_reaction .bookmark_button[bookmarked="true"] {
|
||||
color: #FF5050;
|
||||
}
|
||||
.media_views {
|
||||
margin: 8px 0;
|
||||
height: 336px;
|
||||
|
@ -1112,6 +1118,15 @@ border: 1px solid #E6ECF0;
|
|||
border-radius: 5px;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
.timeline .notice_entry .notice_entry_body .notice_emoji {
|
||||
float:left;
|
||||
margin-left:-3px;
|
||||
margin-right:5px;
|
||||
}
|
||||
.timeline .notice_entry .notice_entry_body .notice_emoji img {
|
||||
height:34px;
|
||||
width:unset;
|
||||
}
|
||||
.timeline .notice_entry .notice_entry_body .toot_header {
|
||||
height: 17px;
|
||||
}
|
||||
|
@ -1148,6 +1163,9 @@ background: #17BF63;
|
|||
.timeline .toot_entry .font-icon.favourite {
|
||||
background: #FFAD1A;
|
||||
}
|
||||
.timeline .toot_entry .font-icon.reaction {
|
||||
background: #FBA457;
|
||||
}
|
||||
.timeline .toot_entry .font-icon.poll {
|
||||
background: #FF4040;
|
||||
top:0;
|
||||
|
@ -2535,7 +2553,7 @@ font-weight: 300;
|
|||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
width: 230px;
|
||||
width: 320px;
|
||||
height: 21px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
@ -2578,6 +2596,10 @@ color: #17BF63;
|
|||
.toot_detail .toot_footer .toot_reaction .fav_button[favourited="true"] .reaction_count {
|
||||
color: #FFAD1A;
|
||||
}
|
||||
.toot_detail .toot_footer .toot_reaction .bookmark_button[bookmarked="false"]:hover,
|
||||
.toot_detail .toot_footer .toot_reaction .bookmark_button[bookmarked="true"] {
|
||||
color: #FF5050;
|
||||
}
|
||||
.toot_detail .status_form {
|
||||
border-top: 1px solid #E6ECF0;
|
||||
border-bottom: 1px solid #E6ECF0;
|
||||
|
@ -2746,6 +2768,90 @@ border:0 solid #189EFC;
|
|||
border-left-width:5px;
|
||||
border-right-width:5px;
|
||||
}
|
||||
.announcement_wrap {
|
||||
display:flex;
|
||||
flex-wrap:wrap;
|
||||
width:1200px;
|
||||
margin:auto;
|
||||
margin-top:2px;
|
||||
}
|
||||
.announcement {
|
||||
margin-left:5px;
|
||||
margin-right:5px;
|
||||
margin-top:10px;
|
||||
width:100%;
|
||||
padding:15px;
|
||||
border-radius: 5px;
|
||||
background-color:#fff;
|
||||
border:1px solid #E6ECF0;
|
||||
}
|
||||
.announcement_icon {
|
||||
float:left;
|
||||
color:rgb(101,119,134);
|
||||
}
|
||||
.announcement_content {
|
||||
float:left;
|
||||
margin-left:10px;
|
||||
width:calc(100% - 58px);
|
||||
}
|
||||
.announcement_text {
|
||||
color:#333;
|
||||
font-size:14px;
|
||||
padding:5px;
|
||||
}
|
||||
.announcement_reactions {
|
||||
float:left;
|
||||
}
|
||||
.announcement_date {
|
||||
float:right;
|
||||
}
|
||||
.emoreact {
|
||||
margin:3px;
|
||||
padding:3px;
|
||||
border-radius:3px;
|
||||
border:1px solid #189EFC;
|
||||
cursor:pointer;
|
||||
}
|
||||
.emoreact .emoji {
|
||||
vertical-align:-4px;
|
||||
}
|
||||
.emoreact .emoreact_count {
|
||||
margin-left:3px;
|
||||
vertical-align:-2px;
|
||||
color:#189EFC;
|
||||
}
|
||||
.emoreact.active,
|
||||
.emoreact:hover {
|
||||
background-color:#189EFC;
|
||||
}
|
||||
.emoreact.active .emoreact_count,
|
||||
.emoreact:hover .emoreact_count {
|
||||
color:#FFFFFF;
|
||||
}
|
||||
.emoreact_add {
|
||||
margin:3px;
|
||||
border-radius:3px;
|
||||
border:1px solid #189EFC;
|
||||
cursor:pointer;
|
||||
color:#189EFC;
|
||||
font-size:18px;
|
||||
padding-left:5px;
|
||||
padding-right:5px;
|
||||
padding-top:4px;
|
||||
vertical-align:-3px;
|
||||
}
|
||||
.emoreact_add:hover {
|
||||
background-color:#189EFC;
|
||||
color:#FFFFFF;
|
||||
}
|
||||
.emoreact_add .lsx-emojipicker-appender {
|
||||
display:inline-block;
|
||||
left:15px;
|
||||
}
|
||||
.status_reactions {
|
||||
margin-left:-3px;
|
||||
margin-top:5px;
|
||||
}
|
||||
@media(max-width:1199px) {
|
||||
#main .profile_nav_wrap .profile_nav {
|
||||
width:900px;
|
||||
|
@ -2756,7 +2862,8 @@ width:590px;
|
|||
#js-follows_profile {
|
||||
width:600px;
|
||||
}
|
||||
#main .article_wrap {
|
||||
#main .article_wrap,
|
||||
#main .announcement {
|
||||
width:900px;
|
||||
}
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 434 KiB After Width: | Height: | Size: 434 KiB |
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 361 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
@ -71,7 +71,7 @@ $(liNode).data("value",prepend+ele[resultname]+" ");
|
|||
$(liNode).addClass("account_box").append($("<div>").addClass("icon_box").append($("<img>").attr("src",ele.avatar).css("float","left")))
|
||||
.append($("<div>").addClass("label_box").append($("<span>").addClass("dn").append($("<h3>").html(ele.display_name).addClass("emoji_poss"))).append($("<span>").addClass("un").html(prepend+ele.acct)));
|
||||
}
|
||||
else if(resultname == "name") {
|
||||
else if(prepend == "#") {
|
||||
$(liNode).data("value",prepend+ele[resultname]+" ");
|
||||
$(liNode).addClass("account_box").append($("<div>").addClass("icon_box").append($("<span>").addClass("emoji_poss").html("#️⃣").css("float","left").css("font-size","32px")))
|
||||
.append($("<div>").addClass("label_box").append($("<span>").addClass("dn").append($("<h3>").html(prepend+ele[resultname]))));
|
||||
|
|
|
@ -6,7 +6,7 @@ var settings = {};
|
|||
$.fn.lsxEmojiPicker = function(options) {
|
||||
if(options == "destroy") {
|
||||
$(this).off("click");
|
||||
$(this).children().remove();
|
||||
$(this).children(".lsx-emojipicker-appender").remove();
|
||||
}
|
||||
else {
|
||||
settings = $.extend({
|
||||
|
@ -14,7 +14,9 @@ width: 280,
|
|||
height: 200,
|
||||
twemoji: false,
|
||||
closeOnSelect: true,
|
||||
onSelect: function(em){}
|
||||
customEmojis: true,
|
||||
onSelect: function(em){},
|
||||
onClose: function(){}
|
||||
}, options);
|
||||
var appender = $('<div></div>')
|
||||
.addClass('lsx-emojipicker-appender');
|
||||
|
@ -29,7 +31,7 @@ var spinner = $('<div></div>')
|
|||
spinnerContainer.append(spinner);
|
||||
var customemojis = JSON.parse(localStorage.current_custom_emojis);
|
||||
var addhide = "";
|
||||
if(customemojis.length > 0) {
|
||||
if(customemojis.length > 0 && settings.customEmojis) {
|
||||
addhide = " hidden";
|
||||
var emojiCustomContainer = $('<div></div>')
|
||||
.addClass('lsx-emojipicker-emoji lsx-emoji-tab lsx-emoji-custom')
|
||||
|
@ -61,7 +63,7 @@ var emojiFlagsContainer = $('<div></div>')
|
|||
.css({'width': settings.width, 'height': settings.height});
|
||||
var tabs = $('<ul></ul>')
|
||||
.addClass('lsx-emojipicker-tabs');
|
||||
if(customemojis.length > 0) {
|
||||
if(customemojis.length > 0 && settings.customEmojis) {
|
||||
var customEmoji = $('<li></li>')
|
||||
.addClass('selected')
|
||||
.html("*⃣")
|
||||
|
@ -82,7 +84,7 @@ $(this).addClass('selected');
|
|||
$('.lsx-emoji-tab').addClass('hidden');
|
||||
emojiPeopleContainer.removeClass('hidden');
|
||||
});
|
||||
if(customemojis.length == 0) {
|
||||
if(customemojis.length == 0 || !settings.customEmojis) {
|
||||
peopleEmoji.addClass("selected");
|
||||
}
|
||||
var natureEmoji = $('<li></li>')
|
||||
|
@ -148,7 +150,7 @@ $(this).addClass('selected');
|
|||
$('.lsx-emoji-tab').addClass('hidden');
|
||||
emojiFlagsContainer.removeClass('hidden');
|
||||
});
|
||||
if(customemojis.length > 0) {
|
||||
if(customemojis.length > 0 && settings.customEmojis) {
|
||||
tabs.append(customEmoji);
|
||||
}
|
||||
tabs.append(peopleEmoji)
|
||||
|
@ -159,7 +161,7 @@ tabs.append(peopleEmoji)
|
|||
.append(objectsEmoji)
|
||||
.append(symbolsEmoji)
|
||||
.append(flagsEmoji);
|
||||
if(customemojis.length > 0) {
|
||||
if(customemojis.length > 0 && settings.customEmojis) {
|
||||
createCustomEmojiTab(emojiCustomContainer,container);
|
||||
}
|
||||
createEmojiTab('people',emojiPeopleContainer,container);
|
||||
|
@ -172,7 +174,7 @@ createEmojiTab('symbols',emojiSymbolsContainer,container);
|
|||
createEmojiTab('flags',emojiFlagsContainer,container);
|
||||
//wrapper.append(spinnerContainer);
|
||||
wrapper.append(tabs);
|
||||
if(customemojis.length > 0) {
|
||||
if(customemojis.length > 0 && settings.customEmojis) {
|
||||
wrapper.append(emojiCustomContainer);
|
||||
}
|
||||
wrapper.append(emojiPeopleContainer)
|
||||
|
@ -205,6 +207,7 @@ if(!$(e.target).parent().hasClass('lsx-emojipicker-tabs')
|
|||
&& !$(e.target).parent().parent().hasClass('lsx-emoji-tab')){
|
||||
if(container.is(':visible')){
|
||||
container.hide();
|
||||
settings.onClose();
|
||||
} else {
|
||||
container.show();
|
||||
}
|
||||
|
@ -228,6 +231,7 @@ settings.onSelect({
|
|||
});
|
||||
if(settings.closeOnSelect){
|
||||
wrapper.hide();
|
||||
settings.onClose();
|
||||
}
|
||||
});
|
||||
container.append(emoticon);
|
||||
|
@ -247,17 +251,17 @@ if(Object.keys(sortedemojis).length != 1 || !sortedemojis.hasOwnProperty(__("Gen
|
|||
for(var i=0;i < sortedemojis[category].length;i++) {
|
||||
var selectedEmoji = sortedemojis[category][i];
|
||||
var emoticon = $('<span></span>')
|
||||
.data('value',selectedEmoji.url)
|
||||
.attr('title',selectedEmoji.code)
|
||||
.html($("<img>").addClass("emoji").attr("src",selectedEmoji.url));
|
||||
emoticon.click(function(e){
|
||||
e.preventDefault();
|
||||
settings.onSelect({
|
||||
'name':$(this).attr('title'),
|
||||
'value':$(this).data('value')
|
||||
'value':$(this).attr('title')
|
||||
});
|
||||
if(settings.closeOnSelect){
|
||||
wrapper.hide();
|
||||
settings.onClose();
|
||||
}
|
||||
});
|
||||
container.append(emoticon);
|
||||
|
|
|
@ -60,7 +60,7 @@ di[re[4]] = re[3];
|
|||
return di;
|
||||
}
|
||||
function replaceInternalLink() {
|
||||
$(".toot_article a,.profile_bio a,.follows_profile_bio a").each(function(i) {
|
||||
$(".toot_article a,.profile_bio a,.follows_profile_bio a,.announcement_text 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_%]+)\/?$/);
|
||||
|
@ -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);
|
||||
|
@ -228,10 +234,10 @@ api.get("instance",function(data) {
|
|||
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;
|
||||
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;
|
||||
|
@ -454,7 +460,7 @@ ctx.fillText("😗",-2,4);
|
|||
return ctx.getImageData(0,0,1,1).data[3] > 0;
|
||||
}
|
||||
function openStatus(link) {
|
||||
api.search("q="+encodeURIComponent(link),function(response) {
|
||||
api.search("q="+encodeURIComponent(link)+"&resolve=true",function(response) {
|
||||
if(response.statuses.length > 0) {
|
||||
var data = response.statuses[0];
|
||||
if(data.account.acct.indexOf("@") == -1) {
|
||||
|
@ -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) {
|
||||
$("<span>"+text+"</span>").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 += (`
|
||||
<div class="media_attachment" otype="video/gifv" mediacount="0">
|
||||
<iframe src="https://${server_setting_invidious}/embed/${watchid}" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe src="/media/invidious.php?server=${server_setting_invidious}&id=${watchid}" frameborder="0" allowfullscreen></iframe>
|
||||
</div>`);
|
||||
}
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -676,7 +745,7 @@ case "private":status.halcyon.privacy_mode=__("Followers-only");status.halcyon.p
|
|||
case "direct":status.halcyon.privacy_mode=__("Direct");status.halcyon.privacy_icon="envelope";status.halcyon.checked_direct=" checked";break;
|
||||
}
|
||||
if(status.halcyon.privacy_icon == "globe" || status.halcyon.privacy_icon == "unlock-alt") {
|
||||
status.halcyon.footer_width = " style='width:320px'";
|
||||
status.halcyon.footer_width = " style='width:400px'";
|
||||
status.halcyon.reblog_button = (`<div class="toot_reaction">
|
||||
<button class="boost_button" tid="${status.id}" reblogged="${status.reblogged}">
|
||||
<i class="fa fa-fw fa-retweet"></i>
|
||||
|
@ -706,6 +775,8 @@ status.halcyon.own_toot_buttons += (`</ul><ul><li><a href="https://${current_ins
|
|||
status.halcyon.account_state_icons = "";
|
||||
if(status.account.locked == true) status.halcyon.account_state_icons += " <i class='fa fa-lock'></i>";
|
||||
if(status.account.bot == true) status.halcyon.account_state_icons += " <img src='/assets/images/robot.svg' class='emoji'>";
|
||||
status.halcyon.reactions = "";
|
||||
if(status.pleroma && status.pleroma.emoji_reactions) status.halcyon.reactions = (`<div class="status_reactions">${parse_reactions(status.pleroma.emoji_reactions)}</div>`);
|
||||
status.content = checkStatusLinks(status.content);
|
||||
return status;
|
||||
}
|
||||
|
@ -767,3 +838,49 @@ replace_emoji();
|
|||
}
|
||||
}
|
||||
}
|
||||
function prepareAnnouncement(announcement) {
|
||||
for(i=0;i<announcement.emojis.length;i++) {
|
||||
announcement.content = announcement.content.replace(new RegExp(":"+announcement.emojis[i].shortcode+":","g"),"<img src='"+announcement.emojis[i].url+"' class='emoji'>");
|
||||
}
|
||||
for(var i=0;i<announcement.mentions.length;i++) {
|
||||
if(announcement.mentions[i].acct.indexOf("@") == -1) announcement.content = announcement.content.replace(new RegExp('href="'+announcement.mentions[i].url+'"',"g"),'href="/@'+announcement.mentions[i].acct+'@'+current_instance+'?mid='+announcement.mentions[i].id+'" data-mid="'+announcement.mentions[i].id+'"');
|
||||
else announcement.content = announcement.content.replace(new RegExp('href="'+announcement.mentions[i].url+'"',"g"),'href="/@'+announcement.mentions[i].acct+'?mid='+announcement.mentions[i].id+'" data-mid="'+announcement.mentions[i].id+'"');
|
||||
}
|
||||
return announcement;
|
||||
}
|
||||
function parse_reactions(reaction_data) {
|
||||
var reactions = (`<div class="emoreact_wrap">`);
|
||||
for(var i=0;i<reaction_data.length;i++) {
|
||||
var is_active = "";
|
||||
if(reaction_data[i].me) is_active = " active";
|
||||
var emoji;
|
||||
if(reaction_data[i].url) emoji = (`<span><img class="emoji" src="${reaction_data[i].url}"></span>`);
|
||||
else emoji = (`<span class="emoji_poss">${reaction_data[i].name}</span>`);
|
||||
reactions += (`<span class="emoreact${is_active}" emoji="${reaction_data[i].name}">${emoji}<span class="emoreact_count">${reaction_data[i].count}</span></span>`);
|
||||
}
|
||||
reactions += (`<span class="emoreact_add"><i class="fa fa-smile-o"></i></span>`);
|
||||
reactions += (`</div>`);
|
||||
return reactions;
|
||||
}
|
||||
function enableReactionPicker(that) {
|
||||
$(that).find(".emoreact_add").click(function() {
|
||||
$(this).off("click");
|
||||
(function(that) {
|
||||
$(that).lsxEmojiPicker({
|
||||
closeOnSelect:true,
|
||||
twemoji:!checkEmojiSupport(),
|
||||
onSelect:function(emoji) {
|
||||
api.put("announcements/"+$(that).closest(".announcement").attr("aid")+"/reactions/"+emoji.value,function() {});
|
||||
},
|
||||
onClose:function() {
|
||||
$(that).lsxEmojiPicker("destroy");
|
||||
setTimeout(function() {enableReactionPicker($(that).closest(".announcement"))},0);
|
||||
}
|
||||
}).click();
|
||||
})(this);
|
||||
});
|
||||
}
|
||||
function addZero(num) {
|
||||
if(num < 10) return "0"+num;
|
||||
else return num;
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -131,8 +131,9 @@ else if(expires_at.getUTCMinutes() == 1) expires_string = "1 "+__("minute");
|
|||
else if(expires_at.getUTCMinutes() > 1) expires_string = expires_at.getUTCMinutes()+" "+__("minutes");
|
||||
else if(expires_at.getUTCSeconds() == 1) expires_string = "1 "+__("second");
|
||||
else expires_string = expires_at.getUTCSeconds()+" "+__("seconds");
|
||||
if(poll.voted || poll.expired) {
|
||||
poll_html = (`<div class="poll_box">`);
|
||||
const poll_random = Math.round(Math.random()*1000);
|
||||
if(poll.voted || poll.expired || poll.seeresult) {
|
||||
poll_html = (`<div class="poll_box poll_${poll.id}" data-poll="${poll.id}" data-random="${poll_random}" id="poll_${poll.id}_${poll_random}">`);
|
||||
optionsort = [...poll.options];
|
||||
optionsort.sort(function(a,b) {return a.votes_count - b.votes_count});
|
||||
optionsort.reverse();
|
||||
|
@ -143,11 +144,11 @@ if(poll.options[i].winner) winner = " poll_winner";
|
|||
poll_html += (`<div class="poll_result_option"><span class="poll_bar${winner}" style="width:${poll.options[i].votes_count/poll.votes_count*100}%"></div>
|
||||
<label class="poll_result_label"><strong>${Math.round(poll.options[i].votes_count/poll.votes_count*100) || 0}%</strong> <span class="emoji_poss">${poll.options[i].title}</span></label>`);
|
||||
}
|
||||
if(poll.expired) poll_html += (`<br/><span class="poll_footer">${poll.votes_count} ${__("votes")} • ${__("Final results")}</span>`);
|
||||
else poll_html += (`<br/><span class="poll_footer">${poll.votes_count} ${__("votes")} • ${expires_string} ${__("left")}</span>`);
|
||||
if(poll.expired) poll_html += (`<br/><span class="poll_footer">${poll.votes_count} ${__("votes")} • ${__("Final results")} • <a href="javascript:void(0)" class="poll_refresh">${__("Refresh")}</a></span></span>`);
|
||||
else if(poll.seeresult) poll_html += (`<br/><span class="poll_footer">${poll.votes_count} ${__("votes")} • ${expires_string} ${__("left")} • <a href="javascript:void(0)" class="poll_refresh">${__("Back")}</a></span>`);
|
||||
else poll_html += (`<br/><span class="poll_footer">${poll.votes_count} ${__("votes")} • ${expires_string} ${__("left")} • <a href="javascript:void(0)" class="poll_refresh">${__("Refresh")}</a></span>`);
|
||||
}
|
||||
else {
|
||||
const poll_random = Math.round(Math.random()*1000);
|
||||
poll_html = (`<div class="poll_box poll_box_form poll_${poll.id}" data-poll="${poll.id}" data-random="${poll_random}" id="poll_${poll.id}_${poll_random}">`);
|
||||
for(var i=0;i<poll.options.length;i++) {
|
||||
if(poll.multiple) {
|
||||
|
@ -160,7 +161,7 @@ poll_html += (`<div class="radiobox"><input type="radio" id="poll_${poll.id}_${p
|
|||
}
|
||||
}
|
||||
poll_html += (`<button class="halcyon_button poll_vote"><span>${__("Vote")}</span></button>
|
||||
${poll.votes_count} ${__("votes")} • ${expires_string} ${__("left")}`);
|
||||
${poll.votes_count} ${__("votes")} • ${expires_string} ${__("left")} • <a href="javascript:void(0)" class="poll_show_result">${__("Show results")}</a>`);
|
||||
}
|
||||
poll_html += (`</div>`);
|
||||
return poll_html;
|
||||
|
@ -226,6 +227,7 @@ ${status.content}
|
|||
</span>
|
||||
${status.halcyon.preview_object}
|
||||
</article>
|
||||
${status.halcyon.reactions}
|
||||
<footer class="toot_footer"${status.halcyon.footer_width}>
|
||||
<div class="toot_reaction">
|
||||
<button class="reply_button" tid="${status.id}" mentions='${JSON.stringify(status.mentions)}' display_name="${status.account.display_name}" privacy="${status.visibility}" content_warning="${htmlEscape(status.spoiler_text)}">
|
||||
|
@ -241,6 +243,11 @@ ${status.halcyon.reblog_button}
|
|||
</button>
|
||||
</div>
|
||||
<div class="toot_reaction">
|
||||
<button class="bookmark_button" tid="${status.id}" bookmarked="${status.bookmarked}">
|
||||
<i class="fa fa-fw fa-bookmark"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toot_reaction">
|
||||
<button>
|
||||
<i class="fa fa-fw fa-${status.halcyon.privacy_icon}" title="${status.halcyon.privacy_mode}"></i>
|
||||
</button>
|
||||
|
@ -283,7 +290,7 @@ const html = (`
|
|||
<section class="toot_content">
|
||||
<header class="toot_header">
|
||||
<div class="text_ellipsis">
|
||||
<a href="${NotificationObj.status.halcyon.author_link}">
|
||||
<a href="${NotificationObj.status.halcyon.account_link}">
|
||||
<span class="displayname emoji_poss">
|
||||
${NotificationObj.status.account.display_name}
|
||||
</span>
|
||||
|
@ -321,7 +328,7 @@ html = (`
|
|||
<section class="toot_content">
|
||||
<header class="toot_header">
|
||||
<div class="text_ellipsis">
|
||||
<a href="${NotificationObj.status.halcyon.author_link}">
|
||||
<a href="${NotificationObj.status.halcyon.account_link}">
|
||||
<span class="displayname emoji_poss">
|
||||
${NotificationObj.status.account.display_name}
|
||||
</span>
|
||||
|
@ -340,6 +347,45 @@ ${NotificationObj.status.account.display_name}
|
|||
</li>`);
|
||||
return $(html);
|
||||
}
|
||||
else if(NotificationObj.type === 'pleroma:emoji_reaction') {
|
||||
NotificationObj.status = prepareStatus(NotificationObj.status);
|
||||
const html = (`
|
||||
<li sid="${NotificationObj.status.id}" class="notice_entry emoji_reaction toot_entry">
|
||||
<div class="notice_author_box">
|
||||
<a href="${notice_author_link}">
|
||||
<div class="icon_box">
|
||||
<img src="${NotificationObj.account.avatar}">
|
||||
</div>
|
||||
</a>
|
||||
<i class="fa fa-fw fa-smile-o font-icon reaction"></i>
|
||||
<a class="notice_author" href="${notice_author_link}">
|
||||
<span class="emoji_poss">${NotificationObj.account.display_name}</span> ${__('reacted to Your Toot')}
|
||||
</a>
|
||||
</div>
|
||||
<div class="notice_entry_body">
|
||||
<span class="notice_emoji emoji_poss">${NotificationObj.emoji}</span>
|
||||
<section class="toot_content">
|
||||
<header class="toot_header">
|
||||
<div class="text_ellipsis">
|
||||
<a href="${NotificationObj.status.halcyon.account_link}">
|
||||
<span class="displayname emoji_poss">
|
||||
${NotificationObj.status.account.display_name}
|
||||
</span>
|
||||
<span class="username">
|
||||
@${NotificationObj.status.account.acct}${NotificationObj.status.halcyon.account_state_icons}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<article class="toot_article emoji_poss">
|
||||
<p>${NotificationObj.status.content}</p>
|
||||
</article>
|
||||
<footer class="toot_footer"></footer>
|
||||
</section>
|
||||
</div>
|
||||
</li>`);
|
||||
return $(html);
|
||||
}
|
||||
else if(NotificationObj.type === 'mention' || NotificationObj.type === 'poll') {
|
||||
NotificationObj.status = prepareStatus(NotificationObj.status);
|
||||
var poll_notify = "";
|
||||
|
@ -395,6 +441,7 @@ ${NotificationObj.status.content}
|
|||
</span>
|
||||
${NotificationObj.status.halcyon.preview_object}
|
||||
</article>
|
||||
${NotificationObj.status.halcyon.reactions}
|
||||
<footer class="toot_footer"${NotificationObj.status.halcyon.footer_width}>
|
||||
<div class="toot_reaction">
|
||||
<button class="reply_button" tid="${NotificationObj.status.id}" mentions='${JSON.stringify(NotificationObj.status.mentions)}' display_name="${NotificationObj.account.display_name}" privacy="${NotificationObj.status.visibility}" content_warning="${htmlEscape(NotificationObj.status.spoiler_text)}">
|
||||
|
@ -410,6 +457,11 @@ ${NotificationObj.status.halcyon.reblog_button}
|
|||
</button>
|
||||
</div>
|
||||
<div class="toot_reaction">
|
||||
<button class="bookmark_button" tid="${NotificationObj.status.id}" bookmarked="${NotificationObj.status.bookmarked}">
|
||||
<i class="fa fa-fw fa-bookmark"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toot_reaction">
|
||||
<button>
|
||||
<i class="fa fa-fw fa-${NotificationObj.status.halcyon.privacy_icon}" title="${NotificationObj.status.halcyon.privacy_mode}"></i>
|
||||
</button>
|
||||
|
@ -423,7 +475,7 @@ html.find(".toot_article").append(NotificationObj.status.halcyon.poll_object);
|
|||
return html;
|
||||
} else if(NotificationObj.type === 'follow') {
|
||||
const html=(`
|
||||
<li sid="${NotificationObj.id}" class="notice_entry fol toot_entry">
|
||||
<li class="notice_entry fol toot_entry">
|
||||
<div class="notice_author_box">
|
||||
<a href="${notice_author_link}">
|
||||
<div class="icon_box">
|
||||
|
@ -526,6 +578,7 @@ ${status.content}
|
|||
${status.halcyon.preview_object}
|
||||
</article>
|
||||
<time datetime="${status.halcyon.attr_datetime}">${status.halcyon.attr_datetime}</time>
|
||||
${status.halcyon.reactions}
|
||||
</section>
|
||||
<footer class="toot_footer"${status.halcyon.footer_width}>
|
||||
<div class="toot_reaction">
|
||||
|
@ -542,6 +595,11 @@ ${status.halcyon.reblog_button}
|
|||
</button>
|
||||
</div>
|
||||
<div class="toot_reaction">
|
||||
<button class="bookmark_button" tid="${status.id}" bookmarked="${status.bookmarked}">
|
||||
<i class="fa fa-fw fa-bookmark"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toot_reaction">
|
||||
<button>
|
||||
<i class="fa fa-fw fa-${status.halcyon.privacy_icon}" title="${status.halcyon.privacy_mode}"></i>
|
||||
</button>
|
||||
|
@ -749,6 +807,7 @@ ${status.halcyon.alert_text}
|
|||
${status.content}
|
||||
</span>
|
||||
</article>
|
||||
${status.halcyon.reactions}
|
||||
<footer class="toot_footer"${status.halcyon.footer_width}>
|
||||
<div class="toot_reaction">
|
||||
<button class="reply_button" tid="${status.id}" mentions='${JSON.stringify(status.mentions)}' display_name="${status.account.display_name}" privacy="${status.visibility}" content_warning="${htmlEscape(status.spoiler_text)}">
|
||||
|
@ -764,6 +823,11 @@ ${status.halcyon.reblog_button}
|
|||
</button>
|
||||
</div>
|
||||
<div class="toot_reaction">
|
||||
<button class="bookmark_button" tid="${status.id}" bookmarked="${status.bookmarked}">
|
||||
<i class="fa fa-fw fa-bookmark"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toot_reaction">
|
||||
<button>
|
||||
<i class="fa fa-fw fa-${status.halcyon.privacy_icon}" title="${status.halcyon.privacy_mode}"></i>
|
||||
</button>
|
||||
|
@ -776,3 +840,25 @@ html.find(".toot_article").append(status.halcyon.media_views);
|
|||
html.find(".toot_article").append(status.halcyon.poll_object);
|
||||
return html;
|
||||
}
|
||||
function announcement_template(announcement) {
|
||||
var reactions;
|
||||
var datetime = "";
|
||||
reactions = parse_reactions(announcement.reactions);
|
||||
if(announcement.starts_at && announcement.ends_at) {
|
||||
var start = new Date(announcement.starts_at);
|
||||
var end = new Date(announcement.ends_at);
|
||||
datetime = (`<i class="fa fa-calendar"></i> ${start.getFullYear()}-${addZero(start.getMonth()+1)}-${addZero(start.getDate())}`);
|
||||
if(!announcement.all_day) datetime += (` <i class="fa fa-clock-o"></i> ${addZero(start.getHours())}:${addZero(start.getMinutes())}`);
|
||||
datetime += (` - <i class="fa fa-calendar"></i> ${end.getFullYear()}-${addZero(end.getMonth()+1)}-${addZero(end.getDate())}`);
|
||||
if(!announcement.all_day) datetime += (` <i class="fa fa-clock-o"></i> ${addZero(end.getHours())}:${addZero(end.getMinutes())}`);
|
||||
}
|
||||
announcement = prepareAnnouncement(announcement);
|
||||
const html=(`<div class="announcement" aid="${announcement.id}">
|
||||
<div class="announcement_icon"><i class="fa fa-3x fa-exclamation-triangle"></i></div>
|
||||
<div class="announcement_content">
|
||||
<div class="announcement_text emoji_poss">${announcement.content}</div>
|
||||
<div class="announcement_reactions">${reactions}</div>
|
||||
<div class="announcement_date">${datetime}</div>
|
||||
</div></div>`);
|
||||
return html;
|
||||
}
|
||||
|
|
|
@ -100,44 +100,132 @@ $(this).html('<i class="fa fa-fw fa-user-plus"></i><span>'+__('Follow')+'</span>
|
|||
putMessage(__("Unblocked this user"));
|
||||
return false;
|
||||
});
|
||||
$(document).on('click','.boost_button', function(e) {
|
||||
$(document).on('click','.boost_button',function(e) {
|
||||
e.stopPropagation();
|
||||
if($(this).attr('reblogged') !== 'true'){
|
||||
api.post("statuses/"+$(this).attr('tid')+"/reblog", function (data) {
|
||||
api.post("statuses/"+$(this).attr('tid')+"/reblog",function(data) {
|
||||
});
|
||||
$(this).attr('reblogged', "true");
|
||||
$(this).toggleClass('active');
|
||||
$(this).attr('reblogged',"true");
|
||||
$(this).addClass('active');
|
||||
$(".js_current_toots_count").html(++localStorage.current_statuses_count);
|
||||
} else {
|
||||
api.post("statuses/"+$(this).attr('tid')+"/unreblog", function (data) {
|
||||
}
|
||||
else {
|
||||
api.post("statuses/"+$(this).attr('tid')+"/unreblog",function(data) {
|
||||
});
|
||||
$(this).attr('reblogged', "hold");
|
||||
$(this).toggleClass('active');
|
||||
$(this).attr('reblogged',"null");
|
||||
$(this).removeClass('active');
|
||||
$(".js_current_toots_count").html(--localStorage.current_statuses_count);
|
||||
$(this).mouseout(function(e) {
|
||||
$(this).attr('reblogged', "null");
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(document).on('click','.fav_button', function(e) {
|
||||
$(document).on('click','.fav_button',function(e) {
|
||||
e.stopPropagation();
|
||||
if($(this).attr('favourited') !== 'true'){
|
||||
api.post("statuses/"+$(this).attr('tid')+"/favourite", function (data) {
|
||||
api.post("statuses/"+$(this).attr('tid')+"/favourite",function(data) {
|
||||
});
|
||||
$(this).attr('favourited', "true");
|
||||
$(this).toggleClass('active');
|
||||
} else {
|
||||
api.post("statuses/"+$(this).attr('tid')+"/unfavourite", function (data) {
|
||||
});
|
||||
$(this).attr('favourited', "hold");
|
||||
$(this).toggleClass('active');
|
||||
$(this).mouseout(function(e) {
|
||||
$(this).attr('favourited', "null");
|
||||
$(this).attr('favourited',"true");
|
||||
$(this).addClass('active');
|
||||
}
|
||||
else {
|
||||
api.post("statuses/"+$(this).attr('tid')+"/unfavourite",function(data) {
|
||||
});
|
||||
$(this).attr('favourited',"null");
|
||||
$(this).removeClass('active');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(document).on('click','.bookmark_button',function(e) {
|
||||
e.stopPropagation();
|
||||
if($(this).attr('bookmarked') !== 'true') {
|
||||
api.post("statuses/"+$(this).attr('tid')+"/bookmark",function(data) {
|
||||
});
|
||||
$(this).attr('bookmarked',"true");
|
||||
$(this).addClass('active');
|
||||
}
|
||||
else {
|
||||
api.post("statuses/"+$(this).attr('tid')+"/unbookmark",function(data) {
|
||||
});
|
||||
$(this).attr('bookmarked',"null");
|
||||
$(this).removeClass('active');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(document).on('click','.announcement .emoreact',function(e) {
|
||||
e.stopPropagation();
|
||||
if($(this).hasClass('active')) {
|
||||
(function(that) {
|
||||
api.delete("announcements/"+$(that).closest('.announcement').attr("aid")+"/reactions/"+$(that).attr("emoji"),function(data) {
|
||||
$(that).removeClass('active');
|
||||
});
|
||||
})(this);
|
||||
}
|
||||
else {
|
||||
(function(that) {
|
||||
api.put("announcements/"+$(that).closest('.announcement').attr("aid")+"/reactions/"+$(that).attr("emoji"),function(data) {
|
||||
$(that).addClass('active');
|
||||
});
|
||||
})(this);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(document).on('click','.status_reactions .emoreact',function(e) {
|
||||
e.stopPropagation();
|
||||
if($(this).hasClass('active')) {
|
||||
(function(that) {
|
||||
if($(that).closest('.toot_detail.main_status').length == 1) var sid = $(that).closest('.toot_detail.main_status').attr("sid");
|
||||
else var sid = $(that).closest('.toot_entry').attr("sid");
|
||||
api.delete("pleroma/statuses/"+sid+"/reactions/"+$(that).attr("emoji"),function(status) {
|
||||
$(".toot_entry[sid="+sid+"]").find(".status_reactions").children().remove();
|
||||
$(".toot_entry[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
|
||||
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").children().remove();
|
||||
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
|
||||
replace_emoji();
|
||||
});
|
||||
})(this);
|
||||
}
|
||||
else {
|
||||
(function(that) {
|
||||
if($(that).closest('.toot_detail.main_status').length == 1) var sid = $(that).closest('.toot_detail.main_status').attr("sid");
|
||||
else var sid = $(that).closest('.toot_entry').attr("sid");
|
||||
api.put("pleroma/statuses/"+sid+"/reactions/"+$(that).attr("emoji"),function(status) {
|
||||
$(".toot_entry[sid="+sid+"]").find(".status_reactions").children().remove();
|
||||
$(".toot_entry[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
|
||||
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").children().remove();
|
||||
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
|
||||
replace_emoji();
|
||||
});
|
||||
})(this);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(document).on('click','.status_reactions .emoreact_add',function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
$(document).on('click','.status_reactions .emoreact_add:not(.active)',function() {
|
||||
$(this).addClass("active");
|
||||
(function(that) {
|
||||
if($(that).closest('.toot_detail.main_status').length == 1) var sid = $(that).closest('.toot_detail.main_status').attr("sid");
|
||||
else var sid = $(that).closest('.toot_entry').attr("sid");
|
||||
$(that).lsxEmojiPicker({
|
||||
closeOnSelect:true,
|
||||
customEmojis:false,
|
||||
twemoji:!checkEmojiSupport(),
|
||||
onSelect:function(emoji) {
|
||||
api.put("pleroma/statuses/"+sid+"/reactions/"+emoji.value,function(status) {
|
||||
$(".toot_entry[sid="+sid+"]").find(".status_reactions").children().remove();
|
||||
$(".toot_entry[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
|
||||
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").children().remove();
|
||||
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
|
||||
replace_emoji();
|
||||
});
|
||||
},
|
||||
onClose:function() {
|
||||
$(that).lsxEmojiPicker("destroy");
|
||||
setTimeout(function() {$(that).removeClass("active")},0);
|
||||
}
|
||||
}).click();
|
||||
})(this);
|
||||
});
|
||||
$(document).on('click','.delete_button', function(e) {
|
||||
const sid = $(this).attr('tid');
|
||||
e.stopPropagation();
|
||||
|
@ -1097,8 +1185,28 @@ if ( current_count ) {
|
|||
$('#header .header_nav_list .notification_badge').removeClass('invisible');
|
||||
$('#header .header_nav_list .notification_badge').text( current_count );
|
||||
}
|
||||
api.stream("user", function(userstream) {
|
||||
if(userstream.event === "update" & location.pathname !== "/") {
|
||||
api.stream("user",function(userstream) {
|
||||
if(userstream.event == "filters_changed") {
|
||||
api.get("filters",function(data) {
|
||||
localStorage.setItem("current_filters",JSON.stringify(data));
|
||||
current_filters = data;
|
||||
});
|
||||
}
|
||||
else if(userstream.event == "announcement.reaction") {
|
||||
if($(".announcement[aid="+userstream.payload.announcement_id+"]").find(".emoreact[emoji="+userstream.payload.name+"]").length == 1) {
|
||||
if(userstream.payload.count == 0) $(".announcement[aid="+userstream.payload.announcement_id+"]").find(".emoreact[emoji="+userstream.payload.name+"]").remove();
|
||||
else $(".announcement[aid="+userstream.payload.announcement_id+"]").find(".emoreact[emoji="+userstream.payload.name+"]").find(".emoreact_count").text(userstream.payload.count);
|
||||
}
|
||||
else {
|
||||
var emoji;
|
||||
if(userstream.payload.url) emoji = (`<span><img class="emoji" src="${userstream.payload.url}"></span>`);
|
||||
else emoji = (`<span class="emoji_poss">${userstream.payload.name}</span>`);
|
||||
var reaction = (`<span class="emoreact" emoji="${userstream.payload.name}">${emoji}<span class="emoreact_count">${userstream.payload.count}</span></span>`);
|
||||
$(".announcement[aid="+userstream.payload.announcement_id+"]").find(".emoreact_add").before(reaction);
|
||||
replace_emoji();
|
||||
}
|
||||
}
|
||||
else if(userstream.event === "update" & location.pathname !== "/") {
|
||||
$('#header .header_nav_list .home_badge').removeClass('invisible');
|
||||
}
|
||||
else if(userstream.event === "notification" & location.pathname !== "/notifications") {
|
||||
|
@ -1116,6 +1224,7 @@ userstream.payload.account.display_name = userstream.payload.account.username;
|
|||
switch(userstream.payload.type) {
|
||||
case "favourite":pushNotification(__("New favourite"),userstream.payload.account.display_name+" "+__("favourited your toot"));break;
|
||||
case "reblog":pushNotification(__("New boost"),userstream.payload.account.display_name+" "+__("boosted your toot"));break;
|
||||
case "pleroma:emoji_reaction":pushNotification(__("New reaction"),userstream.payload.account.display_name+" "+__("reacted to your toot"));break;
|
||||
case "follow":pushNotification(__("New follower"),userstream.payload.account.display_name+" "+__("followed you"));$(".js_current_followers_count").html(++localStorage.current_followers_count);break;
|
||||
case "mention":pushNotification(__("New mention"),userstream.payload.account.display_name+" "+__("mentioned you"));break;
|
||||
case "poll":pushNotification(__("Poll finished"),__("A poll you participated in has ended"));break;
|
||||
|
@ -1207,7 +1316,7 @@ $(document).on('click','.player',function(e) {
|
|||
e.stopPropagation();
|
||||
});
|
||||
$(document).on('click','.toot_entry', function(e) {
|
||||
setOverlayStatus($(this).attr('sid'));
|
||||
if($(this).attr('sid')) setOverlayStatus($(this).attr('sid'));
|
||||
});
|
||||
})
|
||||
function setOverlayMedia(sid,mediacount) {
|
||||
|
@ -2015,8 +2124,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 +2197,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");
|
||||
|
@ -2145,14 +2298,43 @@ $(".poll_"+poll_id).remove();
|
|||
}
|
||||
return false;
|
||||
});
|
||||
$(document).on('click','.poll_show_result',function(e) {
|
||||
var poll_id = $(this).parent().data('poll');
|
||||
var poll_random = $(this).parent().data('random');
|
||||
if(poll_id !== null && poll_random !== null) {
|
||||
api.get('polls/'+poll_id,function(data) {
|
||||
data.seeresult = true;
|
||||
$("#poll_"+poll_id+"_"+poll_random).after(poll_template(data));
|
||||
$("#poll_"+poll_id+"_"+poll_random).remove();
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(document).on('click','.poll_refresh',function(e) {
|
||||
var poll_id = $(this).parent().parent().data('poll');
|
||||
var poll_random = $(this).parent().parent().data('random');
|
||||
if(poll_id !== null && poll_random !== null) {
|
||||
api.get('polls/'+poll_id,function(data) {
|
||||
$("#poll_"+poll_id+"_"+poll_random).after(poll_template(data));
|
||||
$("#poll_"+poll_id+"_"+poll_random).remove();
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(document).on('click','.link_preview',function(e) {
|
||||
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) {
|
||||
|
@ -2277,3 +2459,16 @@ shortcut.add("esc",function() {
|
|||
$("#js-overlay_content_wrap").click();
|
||||
});
|
||||
});
|
||||
$(document).ready(function() {
|
||||
api.get("announcements",function(data) {
|
||||
if(data.length > 0) {
|
||||
$(".article_wrap").before($("<div>").addClass("announcement_wrap"));
|
||||
for(var i=0;i<data.length;i++) {
|
||||
$(".announcement_wrap").append(announcement_template(data[i]));
|
||||
}
|
||||
replace_emoji();
|
||||
replaceInternalLink();
|
||||
$(".announcement").each(function() {enableReactionPicker(this)});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -218,14 +218,14 @@ postData = arguments[1];
|
|||
callback = arguments[2];
|
||||
}
|
||||
$.ajax({
|
||||
url: apiBase + endpoint,
|
||||
url: config.instance + "/api/v2/" + endpoint,
|
||||
type: "POST",
|
||||
data: postData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
headers: {"Authorization": "Bearer " + config.api_user_token},
|
||||
success: function(data, textStatus) {
|
||||
console.log("Successful POST API request to " +apiBase+endpoint);
|
||||
console.log("Successful POST API request to " +config.instance + "/api/v2/"+endpoint);
|
||||
callback(data,textStatus)
|
||||
},
|
||||
error: function(xhr, textStatus, errorThrown) {
|
||||
|
@ -386,19 +386,11 @@ var listener = function(event) {
|
|||
console.log("Got Data from Stream " + streamType);
|
||||
if(event.data.length != 0) {
|
||||
event = JSON.parse(event.data);
|
||||
if(event.event == "filters_changed") {
|
||||
api.get("filters",function(data) {
|
||||
localStorage.setItem("current_filters",JSON.stringify(data));
|
||||
current_filters = data;
|
||||
});
|
||||
}
|
||||
else {
|
||||
if(!Number.isInteger(JSON.parse(event.payload))) {
|
||||
event.payload = JSON.parse(event.payload);
|
||||
}
|
||||
onData(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
es.onmessage = listener;
|
||||
es.onclose = function(event) {
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
<?php include ('header.php'); ?>
|
||||
<main id="main" class="home">
|
||||
<div class="article_wrap">
|
||||
<aside class="left_column">
|
||||
<?php include dirname(__FILE__).('/widgets/side_current_user.php'); ?>
|
||||
</aside>
|
||||
<article class="center_column">
|
||||
<header class="timeline_header">
|
||||
<ul class="header_items">
|
||||
<li class="item toots view">
|
||||
<a href="#">
|
||||
<?=_('All')?>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
<div id="js-stream_update">
|
||||
<button>
|
||||
View <span></span> new Toots
|
||||
</button>
|
||||
</div>
|
||||
<ul id="js-timeline" class="timeline">
|
||||
</ul>
|
||||
<footer id="js-timeline_footer" class="timeline_footer">
|
||||
<i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
|
||||
</footer>
|
||||
</article>
|
||||
<aside class="right_column">
|
||||
<section class="side_widgets_wrap">
|
||||
<?php include dirname(__FILE__).('/widgets/side_who_to_follow.php'); ?>
|
||||
<?php include dirname(__FILE__).('/widgets/side_trending.php'); ?>
|
||||
<?php include dirname(__FILE__).('/widgets/side_firefox_addon.php'); ?>
|
||||
</section>
|
||||
<?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
|
||||
</aside>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
current_file = location.pathname;
|
||||
setTimeline("bookmarks");
|
||||
$('title').text('Halcyon / Bookmarks');
|
||||
</script>
|
||||
<?php include ('footer.php'); ?>
|
|
@ -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,19 +11,23 @@ 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
|
||||
invidious = invidiou.sh
|
||||
nitter = nitter.nixnet.xyz
|
||||
youplay_fallback = true
|
||||
invidious = invidious.snopyta.org
|
||||
nitter = nitter.13ad.de
|
||||
bibliogram = bibliogram.ggc-project.de
|
||||
|
||||
; 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
|
||||
; Proxy type can be set to none, socks5, socks4, http or https
|
||||
[Proxy]
|
||||
type = socks5
|
||||
domain = 127.0.0.1
|
||||
port = 9050
|
||||
type = none
|
||||
domain =
|
||||
port =
|
||||
username =
|
||||
password =
|
||||
|
|
|
@ -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');
|
||||
?>
|
||||
</div>
|
||||
|
|
|
@ -75,7 +75,8 @@ server_setting_youplay = <?=$config["Media"]["youplay"] ? "true" : "false"?>;
|
|||
server_setting_vimeo = <?=$config["Media"]["vimeo"] ? "true" : "false"?>;
|
||||
server_setting_unshorten = <?=$config["App"]["url_unshortener"] ? "true" : "false"?>;
|
||||
server_setting_invidious = <?=$config["Media"]["invidious"] ? "'".$config["Media"]["invidious"]."'" : "'invidiou.sh'"?>;
|
||||
server_setting_nitter = <?=$config["Media"]["nitter"] ? "'".$config["Media"]["nitter"]."'" : "'nitter.nixnet.xyz'"?>;
|
||||
server_setting_nitter = <?=$config["Media"]["nitter"] ? "'".$config["Media"]["nitter"]."'" : "'nitter.13ad.de'"?>;
|
||||
server_setting_bibliogram = <?=$config["Media"]["bibliogram"] ? "'".$config["Media"]["bibliogram"]."'" : "'bibliogram.dsrev.ru'"?>;
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -153,6 +154,9 @@ server_setting_nitter = <?=$config["Media"]["nitter"] ? "'".$config["Media"]["ni
|
|||
<a href="/direct"><?=_('Direct')?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/bookmarks"><?=_('Bookmarks')?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/settings"><?=_('Settings')?></a>
|
||||
</li>
|
||||
<li>
|
||||
|
|