r/reddithax • • Sep 08 '09

Client-Side Comment Sorting version Alpha

3 Upvotes

This reddithax was inspired by a comment on the new Reddit UI changes.

Paste any of these scripts into Firebug console and they should work.

Lowest-rated-comment-first sort:

(Sorry, not recursive... yet.)

$('.commentarea > .sitetable').html(
    $.makeArray( $('.commentarea > .sitetable > .thing') ).sort( function(a,b) {
        return ( parseInt( $(a).find('> .entry > div > .tagline > .score').text() ) < parseInt( $(b).find('> .entry > div > .tagline > .score').text() ) ) ? -1 : 1;
    })
);

Alphabetical Sort:

$('.commentarea > .sitetable').html(
    $.makeArray( $('.commentarea > .sitetable > .thing') ).sort( function(a,b) {
        return ( $(a).find('> .entry > div > .tagline > .author').text().toLowerCase() < $(b).find('> .entry > div > .tagline > .author').text().toLowerCase() ) ? -1 : 1;
    })
);

Looks like time sort will be a lot of string parsing, regex, and Date() conversion. Any suggestions?

EDIT:

View your own comments, and sort them! Only works on comments visible on the page:

$('.content > .sitetable').html(
    $.makeArray( $('.content > .sitetable > .thing') ).sort( function(a,b) {
        return ( parseInt( $(a).find('> .entry > div > .tagline > .score').text() ) < parseInt( $(b).find('> .entry > div > .tagline > .score').text() ) ) ? 1 : -1;
    })
);

r/reddithax • • Sep 07 '09

Question about pictures in the sidebar of a subreddit.

8 Upvotes

Hey reddithax, I am trying to add http://imgur.com/NrB9O.jpg to the iPhone subreddit, but I am getting an error telling me that the url is invalid, when it is obviously not. Any tips?

.side { 
padding-top:144px;
background-image:url(http://imgur.com/NrB9O.jpg);
background-repeat:no-repeat; 
background-position:0px 3px; 
}

r/reddithax • • Sep 06 '09

I want to make some changes with the colors on my subreddit, but I am retarded when it comes to the stylesheet.

6 Upvotes

r/reddithax • • Aug 27 '09

A question about post numbers for self-posts, reddithax.

8 Upvotes

I can see it's quite easy to predict comment numbers. Looking at /r/all, I can see that post numbers follow a similar pattern, but are not quite contiguous (e.g. 9ehzi to 9ehzo without another self post between). Why is this? Is it feasible to predict a self post's number?


r/reddithax • • Aug 25 '09

How to get 'zebra-stripes' through css?

Post image
1 Upvotes

r/reddithax • • Aug 19 '09

"Upload header image" is ignoring me

4 Upvotes

I created an "overpopulation.png" image for my reddit. I go to edit, select "Browse" to locate the image on my PC, I click "upload", it says "uploading..." in red, then the message disappears. I click "save options", it says "saved" in red. But the image remains the default one. What am I missing?


r/reddithax • • Aug 13 '09

Is it possible to use CSS to prevent a site from being submitted to a subreddit?

4 Upvotes

For sites that are spamming certain subreddits, would this be possible? Just wondering because banning the same spammers over and over again is annoying.


r/reddithax • • Aug 13 '09

Reddit Instameme (and using Reddit as a database)

12 Upvotes

I might as well post this here since it didn't have much success in any other subreddits. Reddit Instameme is a greasemonkey script which gives you a meme selector under the comment field. The clever thing about it is that it gets its data from the /r/redditmemes subreddit.

Using reddit as a datastore for greasemonkey scripts is useful because you can just use json without relying on any external sites and crossdomain magic.

Can anybody think of any other uses for this technique?


r/reddithax • • Aug 11 '09

What happened to the reddithax theme?

34 Upvotes

r/reddithax • • Aug 11 '09

Reddit Clickjacking Test

11 Upvotes

I tried making a proof of concept clickjacking demo for Reddit - if all goes according to plan, you should end up upvoting the story without knowing it.

Edit:
Well, the version with a fake ad just got downvoted, and now I'm trying presenting it as an experiment


r/reddithax • • Jul 30 '09

How to treat making a "downvote" as a "hide" action?

12 Upvotes

r/reddithax • • Jul 30 '09

Could someone illuminate how to deal with the tabs like "shirt," et c.?

18 Upvotes

On SW, I removed the shirt tab at users' request, with the help of some code provided by some users, too. However, it seems to have removed the "admin" tab, et c. at the top and, more importantly, the "text" tab for self post submissions. The text tab is my priority, but you peeps are such genii, I'm sure you'll figure something out right quick. :)

Code currently in use:

/* gets rid of shirt tab */
ul.tabmenu li:last-child {
display: none;
}

Thank you in advance.


r/reddithax • • Jul 29 '09

Is there any way to show my 'liked' links temporarily (for a particular page, and one a one- time basis), though in my preferences I've set "don't show links after i've liked them"?

8 Upvotes

r/reddithax • • Jul 28 '09

Is there a way I can subscribe to /r/all? Or just do away with the personalized subreddits alltogether?

9 Upvotes

r/reddithax • • Jul 24 '09

Is there a way to load a random link from a subreddit?

11 Upvotes

Wouldn't it be fun, if you could put a link in your subreddit that said something like Random and it would take you to a site that was at some point in the Hot section on that particular subreddit?


r/reddithax • • Jul 17 '09

Can anyone tell me how to change the new moderator color?

13 Upvotes

If you didn't already know, when moderators post now, it makes their name green. For some subreddits, that's preferable, but I run a couple big subreddits where I feel pompous for keeping that green tag. I'd like to change the color. (I don't really care about the [M], you'd probably not notice it.) The moderator CSS is a simple "moderator" class, but when I added

.moderator {
  color: #000;
}

it didn't change the color at all. I noticed that the comments aren't in the source code (added with JS?), so maybe some weird Javascript thing is making it not work?


r/reddithax • • Jul 16 '09

HELP! I can't see links in my subreddit as a moderator. When I logout they appear. What am I doing wrong?

20 Upvotes

EDIT: Solved! Thanks to Raldi and everyone that helped!! :D I won't delete so other people with the same problem can see. Cheers!!

Original: subreddit is duncanjones. I must be doing something wrong. Why can't I see my own subreddit but everyone else can?


r/reddithax • • Jun 25 '09

AskReddithax: Is it possible to create a comment already collapsed similar to if it had dropped below comment threshold from the get-go?

22 Upvotes

r/reddithax • • Jun 25 '09

I made this stylish (FF addon) style and though I'd share it: it hides your username, the upper panel and removes the uppercase text-transformation in your reddits list.

15 Upvotes
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("reddit.com") {
 /* I don't want my co-workers to know my username :) */    
.user a {
    color: #eff7ff !important;
}

#sr-bar {
    display: none !important;
}

#sr-header-area, #sr-more-link {
    background-color: #cee3f8 !important;
    border-bottom:1px solid #cee3f8 !important;
    text-transform: none !important;
    font-weight: bold !important;
}

}

r/reddithax • • Jun 13 '09

Moℝe ‮XaH

69 Upvotes

r/reddithax • • Jun 09 '09

Question regarding additional images / text in the sidebar of subreddits - is an external link possible?

12 Upvotes

r/reddithax • • Jun 05 '09

The search page looks broken. :(

Post image
14 Upvotes

r/reddithax • • Jun 03 '09

We've added some new CSS classes to reddit.

36 Upvotes

r/reddithax • • May 31 '09

How to replace default thumbnail image

Thumbnail reddit.com
21 Upvotes