Блог пользователя mgoncharov

Автор mgoncharov, история, 8 лет назад, По-английски

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

  • Проголосовать: нравится
  • +109
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

Cool! I also did something like this some time ago: Unspoil. It's just a simple bookmarklet, so it should work on more browsers, and doesn't need any extensions. :)

(All the heavy work is being done by spoiler alert, so credits goes to them)