View state of ongoing polls,Fix some links,fix search for urls,add Chinese translation,update media API
|
@ -1,4 +1,4 @@
|
|||
config.ini
|
||||
.ftpconfig
|
||||
data/
|
||||
|
||||
.htpasswd
|
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 |
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
@ -289,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>
|
||||
|
@ -327,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>
|
||||
|
@ -366,7 +367,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>
|
||||
|
@ -474,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">
|
||||
|
|
|
@ -1316,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) {
|
||||
|
@ -2298,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_-]+)/);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 =
|
||||
|
|