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