25
$\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$
9
  • 1
    $\begingroup$ Nice script! If you want prettier buttons, you could use a <input type="submit"> instead, but looks great otherwise! $\endgroup$
    – Doorknob Mod
    Commented Oct 8, 2014 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$ Commented Oct 8, 2014 at 13:53
  • 1
    $\begingroup$ Ah, right, I meant <input type="button">. That should be a bit less... excessive. $\endgroup$
    – Doorknob Mod
    Commented Oct 9, 2014 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$ Commented Oct 9, 2014 at 0:02
  • $\begingroup$ @Doorknob input[type=submit] has the same orange styling as input[type=button]. Only button is grey :-) $\endgroup$
    – Joe
    Commented Oct 9, 2014 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$ Commented Oct 9, 2014 at 1:07
  • $\begingroup$ Nice script! You know where it would fit great? Code Review :-) $\endgroup$
    – Schism
    Commented Oct 17, 2014 at 23:02
  • $\begingroup$ This would be awesome on codegolf.stackexchange.com too $\endgroup$ Commented Dec 12, 2014 at 15:27
  • $\begingroup$ This is simply awesome :D $\endgroup$
    – ABcDexter
    Commented Jul 20, 2016 at 7:46

1 Answer 1

10
$\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$
8
  • $\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$ Commented Oct 8, 2014 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$ Commented Oct 9, 2014 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
    Commented Oct 9, 2014 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$ Commented Oct 9, 2014 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
    Commented Oct 9, 2014 at 14:03
  • $\begingroup$ @doppelgreener updated to version 0.5 with a couple of features d'alar'cop mentioned in chat $\endgroup$
    – Joe
    Commented Dec 5, 2014 at 10:24
  • $\begingroup$ Great work guys! :) $\endgroup$
    – A E
    Commented Dec 5, 2014 at 13:12
  • $\begingroup$ Fix for HTTPS. $\endgroup$
    – EKons
    Commented Mar 27, 2019 at 19:58

You must log in to answer this question.

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