Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
nipos | dfdfccc044 | |
nipos | 82ae0882d1 | |
nipos | eabad44fea |
|
@ -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,8 @@ We moved our instances list to our webpage: https://www.halcyon.social/instances
|
|||
or read our new documentation pages to install it manually: https://www.halcyon.social/documentation.php?page=install
|
||||
|
||||
## Blog
|
||||
- Release of Version 2.4.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
|
||||
|
|
|
@ -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 |
|
@ -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_%]+)\/?$/);
|
||||
|
@ -234,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;
|
||||
|
@ -460,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) {
|
||||
|
@ -745,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>
|
||||
|
@ -775,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;
|
||||
}
|
||||
|
@ -836,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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
@ -2189,6 +2298,29 @@ $(".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_-]+)/);
|
||||
|
@ -2327,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'); ?>
|
|
@ -19,15 +19,15 @@ url_unshortener = true
|
|||
youplay = true
|
||||
vimeo = true
|
||||
youplay_fallback = true
|
||||
invidious = invidiou.sh
|
||||
invidious = invidious.snopyta.org
|
||||
nitter = nitter.13ad.de
|
||||
bibliogram = bibliogram.dsrev.ru
|
||||
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 =
|
||||
|
|
|
@ -154,6 +154,9 @@ server_setting_bibliogram = <?=$config["Media"]["bibliogram"] ? "'".$config["Med
|
|||
<a href="/direct"><?=_('Direct')?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/bookmarks"><?=_('Bookmarks')?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/settings"><?=_('Settings')?></a>
|
||||
</li>
|
||||
<li>
|
||||
|
|