Add link to unknown media

This commit is contained in:
Cutls 2019-05-16 00:11:09 +09:00
parent 3a06820f1e
commit bfade31849
3 changed files with 9 additions and 2 deletions

View File

@ -193,6 +193,8 @@ var lang={
"lang_parse_unvoted":"Show the result without voting", "lang_parse_unvoted":"Show the result without voting",
"lang_parse_endedvote":"Expired", "lang_parse_endedvote":"Expired",
"lang_parse_thread":"Show thread", "lang_parse_thread":"Show thread",
"lang_parse_unknown":"Attached file",
"lang_parse_nsfw":"NSFW media",
//misskey //misskey
"lang_misskeyparse_renote":"Repost", "lang_misskeyparse_renote":"Repost",
"lang_misskeyparse_renoteqt":"Renote", "lang_misskeyparse_renoteqt":"Renote",

View File

@ -195,6 +195,8 @@ var lang={
"lang_parse_unvoted":"結果だけ見る", "lang_parse_unvoted":"結果だけ見る",
"lang_parse_endedvote":"終了済み", "lang_parse_endedvote":"終了済み",
"lang_parse_thread":"会話を表示", "lang_parse_thread":"会話を表示",
"lang_parse_unknown":"添付ファイル",
"lang_parse_nsfw":"閲覧注意",
//misskey //misskey
"lang_misskeyparse_renote":"再投稿", "lang_misskeyparse_renote":"再投稿",
"lang_misskeyparse_renoteqt":"引用", "lang_misskeyparse_renoteqt":"引用",

View File

@ -585,7 +585,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var sense = "sensitive" var sense = "sensitive"
var blur=media.blurhash var blur=media.blurhash
if(blur){ if(blur){
nsfwmes='<div class="nsfw-media">NSFW media</div>' nsfwmes='<div class="nsfw-media">'+lang.lang_parse_nsfw+'</div>'
purl=parseBlur(blur) purl=parseBlur(blur)
var sense="" var sense=""
} }
@ -593,12 +593,15 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var sense = "" var sense = ""
var blur=null var blur=null
} }
if(media.type=="unknown"){
viewer = viewer +'<a href="'+media.remote_url+'">['+lang.lang_parse_unknown+']</a> '
}else{
viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',\'' + viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',\'' +
acct_id + '\')" id="' + id + '-image-' + key2 + '" data-url="' + url + 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="' + '" data-type="' + media.type + '" class="img-parsed img-link" style="width:calc(' + cwdt + '% - 1px); height:'+imh+';"><img draggable="false" src="' +
purl + '" class="' + sense + purl + '" class="' + sense +
' toot-img pointer">'+nsfwmes+'</a>'; ' toot-img pointer">'+nsfwmes+'</a>';
}
}); });
media_ids = media_ids.slice(0, -1) ; media_ids = media_ids.slice(0, -1) ;
} else { } else {