// ==UserScript== // @name Stash StashID Icon // @namespace https://github.com/7dJx1qP/stash-userscripts // @description Adds checkmark icon to performer and studio cards that have a stashid // @version 0.1.2 // @author 7dJx1qP // @match http://localhost:9999/* // @grant unsafeWindow // @grant GM_addStyle // @require https://raw.githubusercontent.com/7dJx1qP/stash-userscripts/master/src\StashUserscriptLibrary.js // ==/UserScript== (function () { 'use strict'; const { stash, Stash, waitForElementId, waitForElementClass, waitForElementByXpath, getElementByXpath, insertAfter, createElementFromHTML, } = unsafeWindow.stash; GM_addStyle(` .peformer-stashid-icon { position: absolute; top: 10px; right: 5px; } .favorite ~ .peformer-stashid-icon { right: 42px; } .studio-stashid-icon { position: absolute; top: 10px; right: 5px; } .col-3.d-xl-none .studio-stashid-icon { position: relative; top: 0; right: 0; } `); function createCheckmarkElement() { return createElementFromHTML(``); } function addPerformerStashIDIcons(performerDatas) { for (const performerCard of document.querySelectorAll('.performer-card')) { const performerLink = performerCard.querySelector('.thumbnail-section > a'); if (performerLink) { const performerUrl = performerLink.href; const performerId = performerUrl.split('/').pop(); const performerData = performerDatas[performerId]; if (performerData?.stash_ids.length) { const el = createElementFromHTML(`