From f45ab949b2aed529d09a47c8945d5df34301230d Mon Sep 17 00:00:00 2001 From: Zergling_man Date: Sun, 11 Jul 2021 13:27:41 +1000 Subject: [PATCH 1/6] Mouseover/click for action buttons now works properly in notification trays, and unique ID for elements is now actually unique. --- app/js/platform/first.js | 6 ++++-- app/js/tl/card.js | 14 ++++++++++++-- app/js/tl/parse.js | 2 +- app/view/pl-PL/index.html | 2 +- app/view/pl-PL/setting.html | 4 ++-- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/js/platform/first.js b/app/js/platform/first.js index d2d9528c..dc273e75 100644 --- a/app/js/platform/first.js +++ b/app/js/platform/first.js @@ -99,8 +99,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/parse.js b/app/js/tl/parse.js index 0a8c99fb..71ca5ef8 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -994,7 +994,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 = '' diff --git a/app/view/pl-PL/index.html b/app/view/pl-PL/index.html index 424abec2..e6066b30 100644 --- a/app/view/pl-PL/index.html +++ b/app/view/pl-PL/index.html @@ -26,7 +26,7 @@