Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fixes etc... #287

Merged
merged 10 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions css/compact-artist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ table[class*="releases_"] {
table[class*="releases_"],
table[class*="labelReleasesTable_"] {
tr[class*="textWithCoversRow_"] {
grid-template-columns: 72px 2fr 1fr 1fr .7fr .3fr .5fr .5fr;
grid-template-columns: 72px 2fr 1fr 1fr .7fr .3fr .5fr .5fr !important;
td {
padding: .25em !important;
}
Expand All @@ -152,7 +152,7 @@ table[class*="labelReleasesTable_"] {
table[class*="releases_"],
div[class*="releasesGrid_"] {
tr[class*="textWithCoversRow_"] {
grid-template-columns: 70px 2fr 1fr 1fr .7fr .3fr .5fr .5fr !important;
grid-template-columns: 70px 2fr 1fr 0fr .25fr 0fr 0fr .2fr !important;

button[class*="versionsButton_"] {
margin-top: 4px !important;
Expand Down
22 changes: 19 additions & 3 deletions css/dark-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6221,7 +6221,7 @@
}
}

/* Collection */
/* New Collection */
// new submission
[class*="newsubmission_"] {
background: var(--new-submission) !important;
Expand All @@ -6232,13 +6232,24 @@
background: var(--icon-disabled) !important;
color: var(--main-bg-color) !important;
}

// needs changes
[class*="needschanges_"] {
background: var(--needs-changes) !important;
color: var(--main-bg-color) !important;
}

button[class*="folderActionBtn_"] {
color: var(--link) !important;
}

[class*="itemCondition_"],
[class*="collectionStatsSubtitle_"],
[class*="collectionValueHeading_"] {
color: var(--text-muted) !important;
}



[class*="collectionListContainer_"] {
[class*="searchContainer_"] {
input::placeholder {
Expand Down Expand Up @@ -6392,6 +6403,11 @@
background: var(--filter-chip) !important;
}

div[class*="MuiSelect-select"][class*="Mui-disabled"] {
color: var(--button-disabled-text) !important;
-webkit-text-fill-color: auto !important;
}

[id*="mui-component-select-"] {
background: var(--input-bg) !important;
}
Expand Down Expand Up @@ -6443,7 +6459,7 @@

// inventory toast notifications

_ [class*="_ampedtoast_"] {
[class*="_ampedtoast_"] {
&[class*="_success_"] {
background: var(--in-collection-bg) !important;
}
Expand Down
7 changes: 5 additions & 2 deletions css/min-max-columns.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ table.release-table tr th:nth-child(4),
table.release-table tr th:nth-child(5),
td[data-header="Min"],
td[data-header="Med"],
td[data-header="Max"] {
display: none;
td[data-header="Max"],
[data-field="minimumvalue"],
[data-field="medianvalue"],
[data-field="maximumvalue"] {
display: none !important;
}
8 changes: 8 additions & 0 deletions css/new-release-page-fixes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@
margin-right: 0.5rem !important;
}
}

// Show credits toggle font-size
button[class*="toggle_"] {
svg,
span[class*="MuiTypography-labelSmall"] {
font-size: 12px;
}
}
}

// image zoom buttons
Expand Down
113 changes: 105 additions & 8 deletions js/extension/features/links-in-new-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,31 @@ rl.ready(() => {
page.classList.add('de-label');
}

// TODO: Remove selectors that worked on old pages (Release, Lists, Labels, Artist, Collection)
// TODO: DRY Refactor
let { linksInTabs } = rl.getPreference('featureData'),
// Artist
artThumbs = '#artist .card .image a',
artTitles = '#artist .card .title a',
artLabels = '#artist .card .label a',
artLists = '.de-artist #list a',
artLinks = '.de-artist [class*="textWithCoversRow_"] td a[class*="link_"]',
artMRToggles = '.de-artist [class*="versionsTextWithCoversRow_"] td a[class*="link_"]',
// Collection
colThumbs = '#collection .collection-image-wrapper a',
colThumbsLg = '#collection .card_large a',
colTitle = '#collection .release_list_table .collection-release-title-cell a',
// colNew = '[class*="itemContainer_"] a',
// Labels
labThumbs = '#label .card .image a',
labArtist = '#label .card .artist a',
labTitle = '#label .card .title a',
labLists = '.de-label #list a',
labLinks = '.de-label [class*="textWithCoversRow_"] td a[class*="link_"]',
labMRToggles = '.de-label [class*="versionsTextWithCoversRow_"] td a[class*="link_"]',
// Lists
listsOld = '#listitems .listitem_title.hide_mobile a, #listitems .marketplace_for_sale_count a',
listsNew = '[class*="itemContainer_"] a',
// Marketplace
mpItems = '.item_description a.item_description_title',
mpLabels = '.item_description .hide_mobile.label_and_cat a',
Expand All @@ -63,11 +73,11 @@ rl.ready(() => {
enabled = false;

let sections = {
artists: [artThumbs, artTitles, artLabels, artLists],
artists: [artThumbs, artTitles, artLabels, artLists, artLinks, artMRToggles],
collection: [colThumbs, colThumbsLg, colTitle],
dashboard: '.module_blocks a',
labels: [labThumbs, labArtist, labTitle, labLists],
lists: '#listitems .listitem_title.hide_mobile a, #listitems .marketplace_for_sale_count a',
labels: [labThumbs, labArtist, labTitle, labLists, labLinks, labMRToggles],
lists: [listsOld, listsNew],
marketplace: [mpItems, mpReleases, mpLabels, mpSellers, mpThumbs],
releases: [
relOtherVers,
Expand Down Expand Up @@ -108,8 +118,13 @@ rl.ready(() => {
}

if (enabled) {
// Modify links on page load
window.modifyLinks();
// Don't modify the header
rl.waitForElement('header[class*="_header_"] a').then(() => {
document.querySelector('a[class*="_button_"][class*="_home_"]').classList.add('de-ignore');
document.querySelectorAll('header[class*="_header_"] a').forEach(a => a.classList.add('de-ignore'));
window.modifyLinks();
});

rl.handlePaginationClicks(window.modifyLinks);

// Modify links on MR toggle
Expand All @@ -120,15 +135,41 @@ rl.ready(() => {
});
});
});
// React MR toggles
rl.waitForElement('[class*="versionsButton_"]').then(() => {
setTimeout(() => {
document.querySelectorAll('[class*="versionsButton_"]').forEach(toggle => {
toggle.addEventListener('click', () => {
rl.waitForElement('[class*="versionsTextWithCoversRow_"] [class*="title_"] a').then(() => {
window.modifyLinks();
});
});
});
}, 200);
});

if ( rl.pageIs('master', 'release') ) {
if ( linksInTabs.releases && rl.pageIs('master', 'release') ) {
if (reactVersion) {
// Guessing that recommendations are one of the last things to render on the page
// Maybe there is a better way to tell when all requests have finished?

rl.waitForElement('#release-actions').then(() => {
document.querySelectorAll('#release-actions a').forEach(a => a.classList.add('de-ignore'));
});

rl.waitForElement('#release-videos a').then(() => {
document.querySelectorAll('#release-videos a').forEach(a => a.classList.add('de-ignore'));
});

rl.waitForElement('#release-recommendations ul li a').then(() => {
window.modifyLinks();
});
}
// document.body.addEventListener('mouseover', (event) => {
// if ( event.target.tagName === 'A'
// && !event.target.className.startsWith('de-')
// && ![...event.target.classList].includes('de-ignore') ) {
// event.target.setAttribute('target', '_blank');
// }
// });
}

// Dashboard modules load async so wait for calls to finish
Expand All @@ -141,6 +182,62 @@ rl.ready(() => {
}, 200);
});
}
// New label page loads async so wait for calls to finish
if ( linksInTabs.labels && rl.pageIs('label') ) {

document.body.addEventListener('mouseover', (event) => {
if ( event.target.tagName === 'A'
&& ![...event.target.classList].includes('de-ignore')
// NOTE: event.target.role == 'option' refers to search result links in the nav
&& !event.target.role == 'option') {
event.target.setAttribute('target', '_blank');
}
});
}
// New artist page loads async so wait for calls to finish
if ( linksInTabs.artists && rl.pageIs('artist') ) {
document.body.addEventListener('mouseover', (event) => {
if ( event.target.tagName === 'A'
&& ![...event.target.classList].includes('de-ignore')
&& !event.target.role == 'option') {
event.target.setAttribute('target', '_blank');
}
});
}
// New lists page loads async so wait for calls to finish
if ( linksInTabs.lists && rl.pageIs('lists') ) {
document.body.addEventListener('mouseover', (event) => {
if ( event.target.tagName === 'A'
&& ![...event.target.classList].includes('de-ignore')
&& !event.target.role == 'option') {
event.target.setAttribute('target', '_blank');
}
});
}
// New collection page loads async so wait for calls to finish
if ( linksInTabs.collection && rl.pageIs('collection') ) {
// Don't modify nav links at top of page
// Old Collection
document.querySelectorAll('#page_content [class*="tabs-wrap"] a').forEach(link => link.classList.add('de-ignore'));
// New Collection
rl.waitForElement('[class*="horizontalLinks_"]').then(() => {
document.querySelectorAll('[class*="horizontalLinks_"] a').forEach(link => link.classList.add('de-ignore'));
});
// Don't modify random item
rl.waitForElement('[class*="randomItem_"]').then(() => {
document.querySelector('[class*="randomItem_"]').classList.add('de-ignore');
});

document.body.addEventListener('mouseover', (event) => {
if ( event.target.tagName === 'A'
&& !event.target.className.startsWith('de-')
&& ![...event.target.classList].includes('de-ignore')
&& !event.target.role == 'option') {
event.target.setAttribute('target', '_blank');
}
});
}

}
}
});
2 changes: 1 addition & 1 deletion js/extension/features/tracklist-readability-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

// title of show/hide dividers link
let text = show ? 'Hide' : 'Show',
styles = 'style="font-size: 12px; width: 115px; text-align: right; margin-top: .2rem; cursor: pointer; border: none; background: none;"',
styles = 'style="font-size: 12px; width: 115px; text-align: right; cursor: pointer; border: none; background: none;"',
trigger = `<button class="de-spacer-trigger" ${styles}>${text} Dividers</button>`;

document.querySelector('#release-tracklist header[class*="header_"]').insertAdjacentHTML('beforeend',trigger);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Discogs Enhancer",
"short_name": "Discogs Enhancer",
"description": "Adds a dark theme, block sellers, price comparisons, currency converter, configurable quick search, & more to Discogs!",
"version": "3.7.3",
"version": "3.7.4",
"author": "Matthew Salcido",
"homepage_url": "https://www.discogs-enhancer.com",
"action": {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discogs-enhancer",
"version": "3.7.3",
"version": "3.7.4",
"description": "A Chrome extension that adds useful functionality to Discogs.com! https://www.discogs-enhancer.com",
"main": "index.js",
"scripts": {
Expand Down
Loading