Skip to content

Commit

Permalink
Apply minor improvements
Browse files Browse the repository at this point in the history
Change-Id: Ib62d4aea30c2f2656fde5c4b76b2e187be5c82c8
  • Loading branch information
jwbth committed Sep 17, 2024
1 parent 0ecb458 commit ff8f3ba
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Comment.layers.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
}

@media (prefers-color-scheme: dark) {
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os {
.darkTheme-commentVars();
}
Expand Down
2 changes: 1 addition & 1 deletion src/CommentForm.less
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@
}
}

@media (prefers-color-scheme: dark) {
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os {
.darkTheme-invertTools();
}
Expand Down
3 changes: 2 additions & 1 deletion src/addCommentLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ async function initialize() {
.append($spanRegularPrototype)
.prepend(' ');
prototypes.add('wrapperRegular', $wrapperRegularPrototype[0]);
prototypes.add('wrapperRelevant',
prototypes.add(
'wrapperRelevant',
$wrapperRegularPrototype
.clone()
.addClass('cd-commentLink-relevant')[0]
Expand Down
13 changes: 8 additions & 5 deletions src/commentFormRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,12 @@ export default {
.save()
.get(mw.config.get('wgPageName'))
?.commentForms
.map((data) => {
.filter((data) => {
const target = this.getTargetByData(data.targetData);
if (data.targetWithOutdentedRepliesData) {
data.targetWithOutdentedReplies = this.getTargetByData(data.targetWithOutdentedRepliesData);
data.targetWithOutdentedReplies = this.getTargetByData(
data.targetWithOutdentedRepliesData
);
}
if (
target?.isActionable &&
Expand All @@ -330,13 +332,14 @@ export default {
haveRestored = true;
} catch (e) {
console.warn(e);
return data;
return true;
}
} else {
return data;
return true;
}

return false;
})
.filter(defined)
);

if (haveRestored) {
Expand Down
2 changes: 1 addition & 1 deletion src/global.less
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ a:not([href]) {
}
}

@media (prefers-color-scheme: dark) {
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os {
--cd-color-subtler: @color-subtler-darktheme;
}
Expand Down
2 changes: 1 addition & 1 deletion src/navPanel.less
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
}
}

@media (prefers-color-scheme: dark) {
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os {
.darkTheme-refreshButton();
}
Expand Down
2 changes: 1 addition & 1 deletion src/talkPage.less
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ ol > .cd-thread-button-container > .cd-thread-button {
}
}

@media (prefers-color-scheme: dark) {
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os {
.darkTheme-talkPage();
}
Expand Down
2 changes: 1 addition & 1 deletion src/toc.less
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}
}

@media (prefers-color-scheme: dark) {
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os {
.darkTheme-addedCommentList();
}
Expand Down

0 comments on commit ff8f3ba

Please sign in to comment.