Skip to content

Commit

Permalink
Fix incorrect styles on track scrobble history page (#35)
Browse files Browse the repository at this point in the history
Put the checkboxes  on the left side of the tracks, make "Delete selected scrobbles" bold red, remove fix for redesigned library (the class new-design), as the old design isn't used anymore

Fixes #28
  • Loading branch information
CennoxX authored Feb 3, 2024
1 parent f833e91 commit 96abb83
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion manifest-v2.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Last.FM Unscrobbler",
"version": "1.6.1",
"version": "1.6.3",
"description": "Delete multiple scrobbles from your Last.FM profile.",
"manifest_version": 2,
"permissions": ["activeTab", "declarativeContent"],
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Last.FM Unscrobbler",
"version": "1.6.1",
"version": "1.6.3",
"description": "Delete multiple scrobbles from your Last.FM profile.",
"manifest_version": 3,
"permissions": ["activeTab", "declarativeContent", "scripting"],
Expand Down
19 changes: 9 additions & 10 deletions unscrobbler.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.chartlist .chartlist-checkbox {
width: 10px;
padding-top: 4px;
padding-left: 12px;
}

Expand All @@ -20,27 +21,25 @@
padding-right: 26px;
}

/** New design styles **/
.chartlist-loved {
display: none !important;
}

.new-design .chartlist-checkbox {
.chartlist-checkbox {
margin-right: 20px;
margin-bottom: 1px;
}

.new-design .chartlist-loved {
display: none;
}

.new-design .chartlist-checkbox input {
.chartlist-checkbox input {
width: 14px;
height: 14px;
}

.new-design .select-all-btn {
.select-all-btn {
font-size: 16px;
}

.new-design .delete-selected-scrobbles-btn {
.delete-selected-scrobbles-btn {
font-weight: 600;
color: #d92323;
color: #d92323 !important;
}
9 changes: 2 additions & 7 deletions unscrobbler.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function unscrobbler() {
* table data element for each checkbox and append it to the scrobble row.
*/
scrobbleRows.forEach((row) => {
const loveTableData = row.querySelector('.chartlist-loved');
const insertTableData = row.querySelector('.chartlist-loved, .chartlist-name');

// Create the checkbox container, which will be appended to the scrobble row.
const checkboxTableData = document.createElement('td');
Expand Down Expand Up @@ -70,7 +70,7 @@ function unscrobbler() {
});

// Insert the checkbox before the track heart icon.
row.insertBefore(checkboxTableData, loveTableData);
row.insertBefore(checkboxTableData, insertTableData);

// Add checkbox click trigger on row click event.
row.addEventListener('click', (event) => {
Expand Down Expand Up @@ -164,11 +164,6 @@ function unscrobbler() {
const checkboxes = section.querySelectorAll('input[name="unscrobble-checkbox"]');
checkboxes.forEach((checkbox) => (checkbox.checked = false));
}

// Check if the page has the redesigned library
if (document.querySelectorAll('.chartlist-artist').length > 0) {
document.body.classList.add('new-design');
}
}

// Check if user is logged in and can use the extension on the current page
Expand Down

0 comments on commit 96abb83

Please sign in to comment.