-
-
Notifications
You must be signed in to change notification settings - Fork 884
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
Show subscription on reddit #1031
Show subscription on reddit #1031
Conversation
Allow to see number of new comments, etc.
var url = ''; | ||
var threads = $("#newCommentsTable tr"); // use the table to keep the selected sorting | ||
for(var i = 1, len = threads.length; i < len; i++) { // i = 1 to avoid the table header | ||
url += ',t3_' + $(threads[i]).find('td:first span[thread]').attr('thread'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use RES's data directly? this is the dashboard, RES creates all the DOM itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To allow people to sort by clicking on header of the table, then opening link in the sorted way choosen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i suppose that's an okay reason.
I still have some nitpicks with that for
loop, but it's just style-- not mission-critical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea true, now it's better.
Replace this horrible for for a pretty each
@@ -58,6 +58,16 @@ modules['newCommentCount'] = { | |||
var showDiv = $('<div class="show">Show:</div>') | |||
var subscriptionFilter = $('<select id="subscriptionFilter"><option>subscribed threads</option><option>all threads</option></select>') | |||
$(showDiv).append(subscriptionFilter); | |||
var openOnReddit = $('<div class="addButton" id="openOnReddit">Open on Reddit</div>'); | |||
$(openOnReddit).click(function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can simply be openOnReddit.click
since openOnReddit
is already a jQuery object: ideally, you should rename it to $openOnReddit
so it's clear that it is a jQuery object. Same with the showDiv
variable above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the same notation than above in the code (I.e. showDiv
for exemple).
Thanks mc10
Thanks andytuba
Show subscription on reddit
See #1027.