Skip to content

Commit

Permalink
Merge pull request #261 from salcido/collection-box-fix-2
Browse files Browse the repository at this point in the history
Collection Box Fix Part Two
  • Loading branch information
salcido authored Nov 14, 2023
2 parents 6630c31 + 148e934 commit c7e600e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions html/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h2>&#x1F44B; Heads up!</h2>
<!-- Collection Box Fix -->
<div class="toggle-group">
<p class="label">Collection Box Fix</p>
<div class="meta hide">in collection box release page section</div>
<div class="meta hide">in collection wantlist box release page section</div>

<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="toggleCollectionBoxFix" checked>
Expand All @@ -117,7 +117,7 @@ <h2>&#x1F44B; Heads up!</h2>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-help-circle" color="#384047"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12" y2="17"></line></svg>
<div class="help-bubble">
<div class="help-text">
Moves the In Collection section back to it's original location on the Release Page.
Moves the Collection / Wantlist section back to it's original location on the Release Page.
</div>
<div class="arrow-right stroke"></div><div class="arrow-right"></div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions js/extension/features/collection-box-fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ rl.ready(() => {

if ( rl.pageIs('release') ) {

rl.waitForElement('div[class*="collection_"]').then(() => {
rl.waitForElement('div[class*="wrapper_"] div[class*="buttons_"]').then(() => {

let inCollection = document.querySelector('div[class*="collection_"]');
let collectionButtons = document.querySelector('div[class*="wrapper_"] div[class*="buttons_"]');

if ( inCollection ) {

let cBox = inCollection.closest('div[class*="side_"'),
let cBox = collectionButtons.closest('div[class*="side_"'),
info = document.getElementById('release-actions').closest('div[class*="side_"');

cBox.querySelector('br').remove();

info.insertAdjacentElement('afterend', cBox);
}
});
}
});


document.querySelectorAll('div[class*="wrapper_"] div[class*="buttons_"]');
16 changes: 10 additions & 6 deletions js/extension/features/tweak-discriminators-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,19 @@

generateCss(hide, superscript, unselectable, transparent);

document.querySelectorAll('div[class^="main_"] h1 a').forEach(s => {
rl.waitForElement('div[class*="root_"] div[class*="content_"] h1[class*="title_"] span a').then(() => {

let markup = `<span class="trim-me">$1</span><${elemType} class="de-discriminator">$2</${elemType}>`;
document.querySelectorAll('div[class^="main_"] h1 a').forEach(s => {

s.innerHTML = s.textContent.replace(re, markup);
let markup = `<span class="trim-me">$1</span><${elemType} class="de-discriminator">$2</${elemType}>`;

if ( superscript ) {
document.querySelectorAll('.trim-me').forEach(t => { t.textContent = t.textContent.trim(); });
}
s.innerHTML = s.textContent.replace(re, markup);

if ( superscript ) {
document.querySelectorAll('.trim-me').forEach(t => { t.textContent = t.textContent.trim(); });
}

});
});
}

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.6.0",
"version": "3.6.1",
"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.6.0",
"version": "3.6.1",
"description": "A Chrome extension that adds useful functionality to Discogs.com! https://www.discogs-enhancer.com",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit c7e600e

Please sign in to comment.