24
$\begingroup$

I've created a user script that hides comments and answers on Puzzling.SE's main site by default, and reveals them only when you want them revealed.

I've done this because I'm the sort of person who dislikes having potential spoilers or answers in view or at risk of being in view whilst I'm mulling over a puzzle. They're too tempting to glance at! I have to put mental effort into not scrolling, or averting my eyes from certain sections of the screen, and so on. There's so much more peace of mind for me in those answers simply not being there until I'm ready to look at them.

I'm also the sort of person who happens to be able to do something about it, because I can create user scripts. So I made a solution for this problem for myself, and thought some of you might want to use it too.

It's called the Puzzling.SE Empuzzler. You can get it here on Greasy Fork.

  • Chrome users ought to be able to add it straight away.
  • Firefox users will need Greasemonkey.

It runs exclusively on Puzzling main site questions, so it won't do its thing on any other SE site, nor on Puzzling Meta.

The result currently looks like this on this question:

there's buttons at the bottom: "Show comments on question", "Show answers", or "Show everything!"

see this bit right at the end. ↑ No comments or answers in sight until I want them there.

There may be places to improve it still. If there's anything it should do differently, or anything it doesn't do that it should, please let me know.

Todo

  1. Add a way to handle direct links to specific answers or comments.
  2. Logged-out users get a login prompt when they expand the comments section. Need to make sure this doesn't happen.
  3. Add a way to turn all spoilers in answers into regular un-spoilery quotes, since peoples' practice of spoiler-protecting their answers is redundant if you're using Empuzzler. Possibly also the same for questions, but separate.
$\endgroup$
  • 1
    $\begingroup$ Nice script! If you want prettier buttons, you could use a <input type="submit"> instead, but looks great otherwise! $\endgroup$ – Doorknob Oct 8 '14 at 11:43
  • $\begingroup$ @Doorknob Thanks! I've added a Show Everything! button, and tried out that style along the way - all three bright orange buttons together is glaring though, so I've decided to stick with the classic styling for now. When the site leaves beta, if its new skin has less vivid buttons, I'll see about switching over to the pretty ones again. $\endgroup$ – doppelgreener Oct 8 '14 at 13:53
  • 1
    $\begingroup$ Ah, right, I meant <input type="button">. That should be a bit less... excessive. $\endgroup$ – Doorknob Oct 9 '14 at 0:00
  • 1
    $\begingroup$ @Doorknob Don't both have the same style? That's the one I used actually ;) in the name of semantics I couldn't bring myself to use the submit type. $\endgroup$ – doppelgreener Oct 9 '14 at 0:02
  • $\begingroup$ @Doorknob input[type=submit] has the same orange styling as input[type=button]. Only button is grey :-) $\endgroup$ – Joe Oct 9 '14 at 0:04
  • $\begingroup$ @Doorknob if you already installed this; I've updated it and added (or, really, fixed) the auto-update. You might want to update to this version to get that auto-update going. (This message will self-destruct when acknowledged.) $\endgroup$ – doppelgreener Oct 9 '14 at 1:07
  • $\begingroup$ Nice script! You know where it would fit great? Code Review :-) $\endgroup$ – Schism Oct 17 '14 at 23:02
  • $\begingroup$ This would be awesome on codegolf.stackexchange.com too $\endgroup$ – Chrismas007 Dec 12 '14 at 15:27
  • $\begingroup$ This is simply awesome :D $\endgroup$ – ABcDexter Jul 20 '16 at 7:46
11
$\begingroup$

Latest version: version 0.5.1

Chrome:

  1. Download it
  2. Rename it .user.js
  3. Go to this URL: http://chrome://extensions/
  4. Drag the .js onto the list of extensions
  5. Allow any requested permissions
  6. Riddle In Peace

Not sure if you're too fussed, but I took the liberty to tidy it up a little bit - moved all the vars to the top, rewrote some parts, etc.

Feel free to ignore it :P

http://pastebin.com/9QNzrRnX


Update for 0.4 - see the changelog :-)

http://pastebin.com/j64sWkXb


And version 0.4.1, since I just spotted a bug where it wouldn't show the "Add Comment" link or a button to "Show comments" if there were no comments on a question.

enter image description here

$\endgroup$
  • $\begingroup$ Thanks, that's certainly brought some development rigour to my hastily thrown together script. :) There's lots of parts I'll integrate (I like your method of hiding the buttons more) and some I won't mainly due to style preferences. I'll take a deeper look soon when I have the time. $\endgroup$ – doppelgreener Oct 8 '14 at 23:34
  • $\begingroup$ I've merged in your clean-up with some small changes, and fixed the auto-update which I just realised I did wrong. $\endgroup$ – doppelgreener Oct 9 '14 at 1:05
  • $\begingroup$ @doppelgreener updated for 0.4 with a couple of changes I'd wanted to make yesterday but didn't have time for :-) $\endgroup$ – Joe Oct 9 '14 at 9:54
  • $\begingroup$ This is very cool. 8) And appears to operate well for questions with 0 comments and/or answers. Merged in. $\endgroup$ – doppelgreener Oct 9 '14 at 13:47
  • $\begingroup$ @doppelgreener It's a pretty awesome idea to be fair, I just refined it a little :P I'm fresh out of useful ideas for now though, I'm afraid $\endgroup$ – Joe Oct 9 '14 at 14:03
  • $\begingroup$ @doppelgreener updated to version 0.5 with a couple of features d'alar'cop mentioned in chat $\endgroup$ – Joe Dec 5 '14 at 10:24
  • $\begingroup$ Great work guys! :) $\endgroup$ – A E Dec 5 '14 at 13:12
  • $\begingroup$ Fix for HTTPS. $\endgroup$ – EKons Mar 27 at 19:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .