From 8bb4599929e56fe2aef7c2596319da86fde020cf Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Sun, 24 Apr 2022 21:03:03 +0200 Subject: [PATCH] Set all data fields per each element --- AnimeBytes/ab-mediainfo.user.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/AnimeBytes/ab-mediainfo.user.js b/AnimeBytes/ab-mediainfo.user.js index bc0e2da..c0b7dca 100644 --- a/AnimeBytes/ab-mediainfo.user.js +++ b/AnimeBytes/ab-mediainfo.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name AnimeBytes Mediainfo Improvements // @author WeebDataHoarder -// @version 1.27.1 +// @version 1.27.3 // @downloadURL https://git.gammaspectra.live/WeebDataHoarder/userscripts/raw/branch/master/AnimeBytes/ab-mediainfo.user.js // @updateURL https://git.gammaspectra.live/WeebDataHoarder/userscripts/raw/branch/master/AnimeBytes/ab-mediainfo.user.js // @description AnimeBytes Mediainfo Improvements. Adds several listing and matching releases against mediainfo utilities. MIT license @@ -1908,6 +1908,7 @@ if( let entryText = []; + let fields = []; ["icons", "source", "video", "audio", "text", "other"].forEach((k) => { let td = document.createElement("td"); td.style["max-width"] = "calc(80% / " + torrentTableColspan + ")"; @@ -1944,7 +1945,6 @@ if( a.classList.add("userscript-highlight", "torrent-page"); a.querySelectorAll("span.userscript-highlight").forEach((e) => { - let fields = []; e.getAttributeNames().forEach((name) => { if(name.match(/^data-/) !== null){ let attr = e.getAttribute(name); @@ -1952,7 +1952,6 @@ if( fields.push(attr); } }); - a.setAttribute("data-fields", fields.join(" ")) }); } @@ -1963,6 +1962,12 @@ if( entryText.push(td.textContent.trim()); }); + if(settings.getSetting("script_abHighlights2Emulation")) { + lastTd.parentElement.querySelectorAll("td > a.userscript-highlight").forEach((e) => { + e.setAttribute("data-fields", fields.join(" ")) + }) + } + if(settings.getSetting("script_deliciousCompatMode")){ let hiddenParent = torrent.elements.link.closest("td"); let span = document.createElement("span");