Commit c690da53 authored by kim's avatar kim 🖕🏿

follow url fix

parent e47dda31
......@@ -47,6 +47,8 @@ $(function() {
jQuery('#loading').show();
$.each(result, function(i, data) {
if(data.media_attachments.length) {
var domain = data.account.url;
var followUrl = domain.replace('@', 'users/');
lastid = data.id;
cats.push(lastid);
//check is not repeated
......@@ -55,7 +57,7 @@ $(function() {
var filename = data.media_attachments[0].url;
var ext = filename.substring(filename.lastIndexOf('.')+1, filename.length);
if(allow.includes(ext)) {
$('.gal').append('<div class="col-lg-3 col-md-4 col-xs-6"><div class="item d-block mb-4" style="background-image:url('+filename+');"><div class="desc text-center"><img src="'+data.account.avatar+'" class="rounded-circle" alt="'+data.account.display_name+'"><div class="name">'+data.account.display_name+'</div><a class="btn btn-primary" target="_blank" href="web+mastodon://follow?uri=acct:'+data.account.acct+'">Follow</a>&nbsp;<a class="btn btn-primary" data-lightbox="cats-'+data.id+'" data-title="#Mastocat by '+data.account.username+'" href="'+filename+'">Open</a><div class="counters"><ul><li>Toots<br>'+data.account.statuses_count+'</li><li>Followers<br>'+data.account.followers_count+'</li><li>Following<br>'+data.account.following_count+'</li></ul></div></div></div>');
$('.gal').append('<div class="col-lg-3 col-md-4 col-xs-6"><div class="item d-block mb-4" style="background-image:url('+filename+');"><div class="desc text-center"><img src="'+data.account.avatar+'" class="rounded-circle" alt="'+data.account.display_name+'"><div class="name">'+data.account.display_name+'</div><a class="btn btn-primary" target="_blank" href="'+followUrl+'/remote_follow">Follow</a>&nbsp;<a class="btn btn-primary" data-lightbox="cats-'+data.id+'" data-title="#Mastocat by '+data.account.username+'" href="'+filename+'">Open</a><div class="counters"><ul><li>Toots<br>'+data.account.statuses_count+'</li><li>Followers<br>'+data.account.followers_count+'</li><li>Following<br>'+data.account.following_count+'</li></ul></div></div></div>');
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment