Improved: attached video on Pleroma

This commit is contained in:
Cutls 2019-05-16 00:17:47 +09:00
parent bfade31849
commit 3cde6d0bff

View File

@ -593,15 +593,26 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var sense = "" var sense = ""
var blur=null var blur=null
} }
if(media.type=="unknown"){ if(media.pleroma){
viewer = viewer +'<a href="'+media.remote_url+'">['+lang.lang_parse_unknown+']</a> ' if(media.pleroma.mime_type.indexOf("video") !== -1){
viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',' +
acct_id + ')" id="' + id + '-image-' + key2 + '" data-url="' + url +
'" data-type="video" class="img-parsed"><video src="' +
purl + '" class="' + sense +
' toot-img pointer" style="max-width:100%;"></a></span>';
}
}else{ }else{
viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',\'' + if(media.type=="unknown"){
acct_id + '\')" id="' + id + '-image-' + key2 + '" data-url="' + url + viewer = viewer +'<a href="'+media.remote_url+'">['+lang.lang_parse_unknown+']</a> '
'" data-type="' + media.type + '" class="img-parsed img-link" style="width:calc(' + cwdt + '% - 1px); height:'+imh+';"><img draggable="false" src="' + }else{
purl + '" class="' + sense + viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',\'' +
' toot-img pointer">'+nsfwmes+'</a>'; acct_id + '\')" id="' + id + '-image-' + key2 + '" data-url="' + url +
} '" data-type="' + media.type + '" class="img-parsed img-link" style="width:calc(' + cwdt + '% - 1px); height:'+imh+';"><img draggable="false" src="' +
purl + '" class="' + sense +
' toot-img pointer">'+nsfwmes+'</a>';
}
}
}); });
media_ids = media_ids.slice(0, -1) ; media_ids = media_ids.slice(0, -1) ;
} else { } else {