diff --git a/css/compact-artist.scss b/css/compact-artist.scss index 32a5dcad..b2fc0c31 100644 --- a/css/compact-artist.scss +++ b/css/compact-artist.scss @@ -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; } @@ -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; diff --git a/css/dark-theme.scss b/css/dark-theme.scss index 4125efac..f98f0639 100644 --- a/css/dark-theme.scss +++ b/css/dark-theme.scss @@ -6221,7 +6221,7 @@ } } - /* Collection */ + /* New Collection */ // new submission [class*="newsubmission_"] { background: var(--new-submission) !important; @@ -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 { @@ -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; } @@ -6443,7 +6459,7 @@ // inventory toast notifications - _ [class*="_ampedtoast_"] { + [class*="_ampedtoast_"] { &[class*="_success_"] { background: var(--in-collection-bg) !important; } diff --git a/css/min-max-columns.css b/css/min-max-columns.css index b82feb32..39d5cf85 100644 --- a/css/min-max-columns.css +++ b/css/min-max-columns.css @@ -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; } diff --git a/css/new-release-page-fixes.scss b/css/new-release-page-fixes.scss index d33dcfa2..7c0efb03 100644 --- a/css/new-release-page-fixes.scss +++ b/css/new-release-page-fixes.scss @@ -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 diff --git a/js/extension/features/links-in-new-tabs.js b/js/extension/features/links-in-new-tabs.js index 597acc0e..57d4fe98 100644 --- a/js/extension/features/links-in-new-tabs.js +++ b/js/extension/features/links-in-new-tabs.js @@ -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', @@ -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, @@ -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 @@ -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 @@ -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'); + } + }); + } + } } }); diff --git a/js/extension/features/tracklist-readability-react.js b/js/extension/features/tracklist-readability-react.js index 798b6208..b97fcb77 100644 --- a/js/extension/features/tracklist-readability-react.js +++ b/js/extension/features/tracklist-readability-react.js @@ -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 = ``; document.querySelector('#release-tracklist header[class*="header_"]').insertAdjacentHTML('beforeend',trigger); diff --git a/manifest.json b/manifest.json index a227c2ce..6dc9fabe 100644 --- a/manifest.json +++ b/manifest.json @@ -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": { diff --git a/package-lock.json b/package-lock.json index 6bb50bbd..56b30ea7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "discogs-enhancer", - "version": "3.7.3", + "version": "3.7.4", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index ff97d917..f76e025b 100644 --- a/package.json +++ b/package.json @@ -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": {