old_contents: (function() {
    hljs.initHighlightingOnLoad();
    var $window = $(window);
    var scrollToTopButton = $(".scroll-to-top");
    $window.on("scroll", function() {
      if ($window.scrollTop() > 300) {
        scrollToTopButton.fadeIn();
      } else {
        scrollToTopButton.fadeOut();
      }
    });
    scrollToTopButton.on("click", function(event) {
      $("html, body").animate({
        scrollTop: 0
      }, "slow");
      return false;
    });
  })();
  
new_contents: (function() {
    hljs.initHighlightingOnLoad();
    var $window = $(window);
    var scrollToTopButton = $(".scroll-to-top");
    function checkScroll() {
      if ($window.scrollTop() > 300) {
        scrollToTopButton.fadeIn();
      } else {
        scrollToTopButton.fadeOut();
      }
    }
    checkScroll();
    $window.on("scroll", checkScroll);
    scrollToTopButton.on("click", function(event) {
      $("html, body").animate({
        scrollTop: 0
      }, "slow");
      return false;
    });
  })();
  
subject: Check scroll on load