Polls now work again

This commit is contained in:
Zergling_man 2022-06-26 19:05:20 +10:00
parent d231297a5d
commit d94e829090
2 changed files with 32 additions and 12 deletions

View File

@ -1398,7 +1398,7 @@ function client(name) {
} }
//Poll Parser //Poll Parser
function pollParse(poll, acct_id, emojis) { function pollParse(poll, acct_id, emojis) {
var rand = uuid() var rand = makeCID()
var datetype = localStorage.getItem('datetype') var datetype = localStorage.getItem('datetype')
var anime = localStorage.getItem('animation') var anime = localStorage.getItem('animation')
if (anime == 'yes' || !anime) { if (anime == 'yes' || !anime) {

View File

@ -22,20 +22,40 @@ function imgv(id, key, acct_id) {
murl = ourl murl = ourl
} }
$(document).ready(function () { $(document).ready(function () {
if (type == 'image') { if (type == 'image') {display_image(murl,id,key)}
else if (type == 'video') {display_video(murl)}
else if (type == 'gifv')
{
if (remote_img == 'no') {display_video(murl)}
else
{
// Need to detect if it's a video or a gif, depends if it came from pleroma or mastodon
// Using extension is a bad idea but w/e
// Actually if it's from mastodon the extension will be mp4.
if (murl.endsWith('.mp4')) {display_video(murl)}
else {display_image(murl,id,key)}
}
}
})
}
function display_image(murl,id,key)
{
$('#imagemodal').modal('open') $('#imagemodal').modal('open')
imageXhr(id, key, murl) imageXhr(id, key, murl)
$('#imagewrap').dragScroll() // ドラッグスクロール設定 $('#imagewrap').dragScroll() // ドラッグスクロール設定
$('#imgmodal').show() $('#imgmodal').show()
$('#imagemodal').attr('data-key', key) $('#imagemodal').attr('data-key', key)
$('#imagemodal').attr('data-id', id) $('#imagemodal').attr('data-id', id)
} else if (type == 'video' || type == 'gifv') { }
function display_video(murl,id=null,key=null)
{
$('#video').attr('src', murl) $('#video').attr('src', murl)
$('#videomodal').modal('open') $('#videomodal').modal('open')
$('#imgmodal').show() $('#imgmodal').show()
} }
})
}
//イメージビューワーの送り //イメージビューワーの送り
function imgCont(type) { function imgCont(type) {
var key = $('#imagemodal').attr('data-key') var key = $('#imagemodal').attr('data-key')