From c7ed4b5be9bc71965968d153ba2ee589a9fb01f0 Mon Sep 17 00:00:00 2001 From: marcustyphoon Date: Sun, 2 Jun 2024 13:27:33 -0700 Subject: [PATCH] Quick Tags/Trim Reblogs: Fix buttons in Russian and Hindi (#1460) --- src/scripts/quick_tags.js | 6 +++--- src/scripts/trim_reblogs.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scripts/quick_tags.js b/src/scripts/quick_tags.js index ad9817530..68cf19a63 100644 --- a/src/scripts/quick_tags.js +++ b/src/scripts/quick_tags.js @@ -2,7 +2,6 @@ import { cloneControlButton, createControlButtonTemplate } from '../util/control import { keyToCss } from '../util/css_map.js'; import { dom } from '../util/dom.js'; import { filterPostElements, getTimelineItemWrapper, postSelector } from '../util/interface.js'; -import { translate } from '../util/language_data.js'; import { megaEdit } from '../util/mega_editor.js'; import { modalCancelButton, modalCompleteButton, showErrorModal, showModal } from '../util/modals.js'; import { onNewPosts, pageModifications } from '../util/mutations.js'; @@ -218,8 +217,9 @@ const processPosts = postElements => filterPostElements(postElements).forEach(po const existingButton = postElement.querySelector(`.${buttonClass}`); if (existingButton !== null) { return; } - const editButton = postElement.querySelector(`footer ${controlIconSelector} a[href*="/edit/"][aria-label=${translate('Edit')}]`); - if (!editButton) { return; } + const editIcon = postElement.querySelector(`footer ${controlIconSelector} a[href*="/edit/"] use[href="#managed-icon__edit"]`); + if (!editIcon) { return; } + const editButton = editIcon.closest('a'); const clonedControlButton = cloneControlButton(controlButtonTemplate, { click: togglePopupDisplay }); const controlIcon = editButton.closest(controlIconSelector); diff --git a/src/scripts/trim_reblogs.js b/src/scripts/trim_reblogs.js index fc91a079a..d1736313e 100644 --- a/src/scripts/trim_reblogs.js +++ b/src/scripts/trim_reblogs.js @@ -2,7 +2,6 @@ import { createControlButtonTemplate, cloneControlButton } from '../util/control import { keyToCss } from '../util/css_map.js'; import { dom } from '../util/dom.js'; import { filterPostElements, postSelector } from '../util/interface.js'; -import { translate } from '../util/language_data.js'; import { showModal, hideModal, modalCancelButton, showErrorModal } from '../util/modals.js'; import { onNewPosts } from '../util/mutations.js'; import { notify } from '../util/notifications.js'; @@ -160,8 +159,9 @@ const processPosts = postElements => filterPostElements(postElements).forEach(as const existingButton = postElement.querySelector(`.${buttonClass}`); if (existingButton !== null) { return; } - const editButton = postElement.querySelector(`footer ${controlIconSelector} a[href*="/edit/"][aria-label=${translate('Edit')}]`); - if (!editButton) { return; } + const editIcon = postElement.querySelector(`footer ${controlIconSelector} a[href*="/edit/"] use[href="#managed-icon__edit"]`); + if (!editIcon) { return; } + const editButton = editIcon.closest('a'); const { trail = [], content = [] } = await timelineObject(postElement); const items = trail.length + (content.length ? 1 : 0);