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

Feature: option to move comments actions (permalink, save-RES, parent, report, reply, etc) to the top of the comment (comment header) #5515

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/modules/betteReddit.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@
title: 'betteRedditRestrictScrollEventsTitle',
advanced: true,
},
commentActionButtonsOnCommentHeader: {
type: 'boolean',
value: false,
description: 'betteRedditCommentActionButtonsOnCommentHeaderDesc',
title: 'betteRedditCommentActionButtonsOnCommentHeaderTitle',
},
};

module.exclude = [
Expand Down Expand Up @@ -297,6 +303,10 @@
});
}

if (module.options.commentActionButtonsOnCommentHeader.value){
commentActionButtonsOnCommentHeader();
}

const user = loggedInUser();
if (module.options.restoreSavedTab.value && user && document.querySelector('.with-listing-chooser:not(.profile-page)')) {
restoreSavedTab(user);
Expand Down Expand Up @@ -577,3 +587,13 @@
element.dataset.text = element.textContent;
element.textContent = '';
}

function commentActionButtonsOnCommentHeader() {
$(document).ready(function () {

Check failure on line 592 in lib/modules/betteReddit.js

View workflow job for this annotation

GitHub Actions / lint_flow

Unexpected function expression

Check failure on line 592 in lib/modules/betteReddit.js

View workflow job for this annotation

GitHub Actions / lint_flow

Unexpected space before function parentheses
$('ul.flat-list.buttons')
.slice(1)
.each(function () {

Check failure on line 595 in lib/modules/betteReddit.js

View workflow job for this annotation

GitHub Actions / lint_flow

Unexpected space before function parentheses
$(this).parent().find('p.tagline').append($(this));
});
});
}
6 changes: 6 additions & 0 deletions locales/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,12 @@
"betteRedditVideoViewed": {
"message": "[Views: $1]"
},
"betteRedditCommentActionButtonsOnCommentHeaderTitle": {
"message": "Comment Action Buttons on Comment Header"
},
"betteRedditCommentActionButtonsOnCommentHeaderDesc": {
"message": "Moves the comment action buttons from the bottom of the comment to the top (comment header)."
},
"commentDepthDefaultCommentDepthTitle": {
"message": "Default Comment Depth"
},
Expand Down