PageSourceSearch

https://www.kaoritter.com/common/js/main.js

js kaoritter.com collected 2026-10-04 05:19:04 UTC 2,435 bytes, 85 lines download raw bytes

1$(function() {
2  var $window = $(window);
3
4  // Header Position Handler
5  var $header = $("#globalheader");
6  var startPos = 0;
7  var headerPositionHandlerThrottle;
8  var updateHeaderPosition = function() {
9    var scrollPos = $window.scrollTop();
10    var headerHeight = $header.outerHeight();
11    if (scrollPos > startPos && scrollPos > headerHeight) {
12      $header.css("top", "-" + headerHeight + "px");
13    } else {
14      $header.css("top", "0");
15    }
16    startPos = scrollPos;
17    headerPositionHandlerThrottle = null;
18  };
19
20  var headerPositionHandler = function() {
21    if (headerPositionHandlerThrottle) {
22      return;
23    }
24    headerPositionHandlerThrottle = setTimeout(updateHeaderPosition, 500);
25  };
26
27  updateHeaderPosition();
28  $window.on("scroll", headerPositionHandler);
29
30  // Content Padding Handler
31  var $content = $("#content");
32  var updateContentPadding = function() {
33    var windowWidth = $window.width();
34    var paddingTop = 28;
35    var headerHeight = $header.outerHeight();
36
37    if (windowWidth >= 768) {
38      paddingTop = headerHeight;
39    } else if (windowWidth >= 480) {
40      paddingTop = headerHeight + 28;
41    }
42
43    $content.css("padding-top", paddingTop + "px");
44  };
45
46  var contentPaddingHandlerDebounce;
47  var contentPaddingHandler = function() {
48    if (contentPaddingHandlerDebounce) {
49      clearTimeout(contentPaddingHandlerDebounce);
50    }
51    contentPaddingHandlerDebounce = setTimeout(updateContentPadding, 500);
52  };
53
54  updateContentPadding();
55  $window.on("resize", contentPaddingHandler);
56
57  // Resposive Header Button Handler
58  var $globalnavi = $("#globalnavi");
59  var $responsiveMenuButtonn = $("#responsive-menu-button");
60  $responsiveMenuButtonn.on("click", function() {
61    $globalnavi.slideToggle();
62    $responsiveMenuButtonn.toggleClass("responsive-btn-active");
63  });
64
65  // Search Header Handler
66  var MTNetSearchDataLayer = (window.MTNetSearchDataLayer =
67    window.MTNetSearchDataLayer || []);
68  function MTNetSearch() {
69    return MTNetSearchDataLayer.push(arguments);
70  }
71
72  var $searchOutput = $("#search-output");
73  if ($searchOutput.length) {
74    MTNetSearch("registerHandler", function(data) {
75      var query = (data && data.query) || "";
76      $searchOutput.text(query);
77    });
78  }
79
80  // Search Form Placeholder
81  $window.on("load", function() {
82    var $input = $("#mt-site-search-form__query");
83    $input.attr("placeholder", "記事を検索する");
84  });
85});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.