No more spoilers in editorials

Revision en5, by mgoncharov, 2017-03-12 14:00:30

demo

If you read editorial after solving one of the archived problems and don't want to spoil unsolved ones, you might find this custom javascript extension snippet useful:

$(function() {
if ($("a.tag:contains('editorial'),a.tag:contains('tutorial')").length === 0) return;
$(".content h2, .content h3").each(function(a,b) {
  var <span class="tex-span"><i>h</i> = </span>(b);
  var $t = $h.nextUntil('h2, h3');
  $h.after("<a href='#' class='show-spoiler'>show</a>");
  var $l = $h.next('.show-spoiler');
  $l.click(function() {
    $t.css('visibility', 'visible');
    $l.remove();
    return false;
  });
  $t.css('visibility', 'hidden');
});
})

I have not tested it on each and every editorial ^_^ upd1: fixed issue with picking 'editorial' links from new's block

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English mgoncharov 2017-03-12 14:00:30 75
en4 English mgoncharov 2017-03-06 00:28:37 61 Tiny change: ';\n})\n```' -> ';\n})\n```\n\nI have not tested it on each and every editorial ^_^' (published)
en3 English mgoncharov 2017-03-06 00:27:12 98 Tiny change: '1lJ1vP.gif)\n\n```js' -> '1lJ1vP.gifv)\n\n```js'
en2 English mgoncharov 2017-03-06 00:16:31 82
en1 English mgoncharov 2017-03-06 00:12:29 761 Initial revision (saved to drafts)