Description
As it appears the sandbox on meta is here to stay, I've written a very simple userscript that will allow you to collapse sandbox answers to reduce clutter. (This may be able to be replaced when the fancy sandbox viewer thingy is finished, but for now it'll make navigating the sandbox a little easier.)
Screenshot
Code
stackexchange-codegolf-sandbox-collapse.user.js
:
// ==UserScript==
// @name stackexchange-codegolf-sandbox-collapse
// @namespace http://keyboardfire.com/
// @license MIT
// @description A simple userscript for collapsing sandbox answers
// @version 1.0.0
// @match *://meta.codegolf.stackexchange.com/*
// ==/UserScript==
if ($('#question-header a').text().indexOf('Proposed Question Sandbox') > -1) {
$('.answer').each(function() {
var ans = $(this);
var ansPosted = $('.post-text', ans).children().length === 1;
var btnMessage = '(' + (ansPosted ? 'challenge posted; ' : '') + 'click to toggle view)';
$('table', ans).wrap($('<div>').addClass('posted-challenge').css('display', ansPosted ? 'none' : ''));
ans.prepend($('<input>').attr('type', 'button').css('margin-bottom', '20px').val(btnMessage).click(function() {
$(this).parent().find('.posted-challenge').toggle('slow');
}));
});
}
Issues
- feature-request status-planned: Show title, tags (if included), and votes even when collapsed