diff --git a/app/js/platform/first.js b/app/js/platform/first.js index f88f0eaa..8ffcee26 100644 --- a/app/js/platform/first.js +++ b/app/js/platform/first.js @@ -103,8 +103,10 @@ function formattimeutc(date) { } postMessage(['sendSinmpleIpc', 'custom-css-request'], '*') -function makeCID() { - return uuid() +incrementid=0 +function makeCID() +{ + return incrementid++ } function rgbToHex(color) { diff --git a/app/js/tl/card.js b/app/js/tl/card.js index 2e0e4c05..97407abc 100644 --- a/app/js/tl/card.js +++ b/app/js/tl/card.js @@ -335,7 +335,17 @@ function cardCheck(tlid) { } } -function mov(id, tlid, type, rand, target) { +function mov(id, tlid, type, rand, target) +{ + mouseover=localStorage.getItem('mouseover') + switch (mouseover) + { + case 'yes': if (type=='mv') $(target).removeClass('hide-actions'); break; + case 'click': if (type=='cl') $(target).toggleClass('hide-actions'); break; + case 'no': break; + } +} +/*function mov(id, tlid, type, rand, target) { const dropdownTrigger = `dropdown_${rand}` let elm = document.querySelector(`#timeline_${tlid} #${dropdownTrigger}`) if(tlid == 'notf') { @@ -383,7 +393,7 @@ function mov(id, tlid, type, rand, target) { //$(tlide + " [toot-id=" + id + "] .area-actions").toggleClass("hide") //$(tlide + " [toot-id=" + id + "] .area-side").toggleClass("hide") } -} +}*/ function resetmv(type) { var mouseover = localStorage.getItem('mouseover') diff --git a/app/js/tl/misskeyparse.js b/app/js/tl/misskeyparse.js index c53f7479..05674342 100644 --- a/app/js/tl/misskeyparse.js +++ b/app/js/tl/misskeyparse.js @@ -771,7 +771,7 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { } else { var actemojick = false } - var rand = uuid() + var rand = makeCID() templete = templete + '
' + diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index fc233c9b..643548f2 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -594,7 +594,6 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type, onlyContent) { if (toot.poll) { var poll = pollParse(toot.poll, acct_id, false) } - var mediack = toot.media_attachments[0] //メディアがあれば var media_ids = '' @@ -985,7 +984,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type, onlyContent) { menuct++ } //このトゥート内のアクションを完了させるために、適当にIDを振る - var rand = uuid() + var rand = makeCID() //プラグイン機構 var pluginBOT = plugins.buttonOnToot var pluginHtml = '' @@ -1057,7 +1056,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type, onlyContent) {
- @@ -1395,7 +1394,7 @@ function client(name) { } //Poll Parser function pollParse(poll, acct_id, emojis) { - var rand = uuid() + var rand = makeCID() var datetype = localStorage.getItem('datetype') var anime = localStorage.getItem('animation') if (anime == 'yes' || !anime) { diff --git a/app/js/tl/src.js b/app/js/tl/src.js index 4e464bfb..7e4f8ca4 100644 --- a/app/js/tl/src.js +++ b/app/js/tl/src.js @@ -30,7 +30,7 @@ function src(mode, offset) { `) var add = '' } else { - var add = '&type=accounts&offset=' + $('#src-accts .cvo').length + var add = '&type=accounts&offset=' + $('#src-accts .cusr').length } var q = $('#src').val() @@ -92,6 +92,11 @@ function src(mode, offset) { #${escapeHTML(tag)}
` + } else if (!tag.history) { + tags+=` + #${escapeHTML(tag.name)} + +
` } else { tags = tags + graphDraw(tag, acct_id) } diff --git a/app/js/tl/tl.js b/app/js/tl/tl.js index 958d96a9..5f632cb1 100644 --- a/app/js/tl/tl.js +++ b/app/js/tl/tl.js @@ -285,6 +285,7 @@ function stremaingSubscribe(type, acct_id, data, unsubscribe) { let name = data if (data.name) name = data.name arr.push(name) + console.log(data.any, data.all, acct_id, type) if (data.any) arr = arr.concat(data.any.split(',')) if (data.all) arr = arr.concat(data.all.split(',')) for (const tag of arr) { diff --git a/app/js/ui/img.js b/app/js/ui/img.js index 5c59352c..65f1733f 100644 --- a/app/js/ui/img.js +++ b/app/js/ui/img.js @@ -22,20 +22,40 @@ function imgv(id, key, acct_id) { murl = ourl } $(document).ready(function () { - if (type == 'image') { - $('#imagemodal').modal('open') - imageXhr(id, key, murl) - $('#imagewrap').dragScroll() // ドラッグスクロール設定 - $('#imgmodal').show() - $('#imagemodal').attr('data-key', key) - $('#imagemodal').attr('data-id', id) - } else if (type == 'video' || type == 'gifv') { - $('#video').attr('src', murl) - $('#videomodal').modal('open') - $('#imgmodal').show() + 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') + 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) { var key = $('#imagemodal').attr('data-key') @@ -47,6 +67,9 @@ function imgCont(type) { } var murl = $('#' + id + '-image-' + key).attr('data-url') var ourl = $('#' + id + '-image-' + key).attr('data-original') + if (!ourl || ourl == 'null') { + ourl = murl + } var type = $('#' + id + '-image-' + key).attr('data-type') $('#imagemodal').attr('data-id', id) $('#imagemodal').attr('data-acct', acct_id) @@ -54,7 +77,7 @@ function imgCont(type) { $('#imagemodal').attr('data-image', murl) //表示はリモートを使うか(どちらにしろコピーはオリジナル) var remote_img = localStorage.getItem('remote_img') - if (remote_img == 'yes' && ourl != 'null') { + if (remote_img == 'yes') { murl = ourl } if (murl) { @@ -336,7 +359,10 @@ function openFinder(dir) { postMessage(['openFinder', dir], '*') } function stopVideo() { - document.getElementById('video').pause() + video=document.getElementById('video') + video.pause() + video.src='' + //document.getElementById('video').pause() } function copyImgUrl() { var murl = $('#imagemodal').attr('data-original')