PageSourceSearch

https://www.nihonbungeisha.co.jp/js/15/calendar.js?u=2026031317

js nihonbungeisha.co.jp collected 2026-09-24 18:06:51 UTC 2,917 bytes, 96 lines download raw bytes

1$(function() {
2  var events = {};
3  var year = new Date().getFullYear();
4  var monthNum = new Date().getMonth() + 1;
5  var month = monthNum.toString().padStart(2, "0");
6  $.ajax({
7    url: "/calendar/?year="+year+"&month="+month+"&api=true",
8    data: {
9      action: 'api',
10      year: year,
11      month: month
12    },
13    dataType: 'json',
14    success: function(data) {
15      // ページ表示時のカレンダーデータ取得
16      events = {};
17      for(var date in data) {
18        for(var category in data[date]) {
19          if(typeof events[date] == "undefined") {
20            events[date] = {title:''};
21          }
22          events[date]['title'] += data[date][category]['name'] + "\n";
23        }
24      }
25    },
26    complete: function() {
27      var weeklist =  ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
28      var option = {
29        week: weeklist,
30        moveTime: 0,
31      };
32
33      // カレンダー表示設定
34      $('#calendarView').calendar({
35        week: weeklist,
36        moveTime: 0,
37        events: events,
38        beforeMove: function(option,y, m) {
39          // 月切り替え時の前処理 → カレンダーデータ取得
40          // https://rewish.jp/blog/releases/jquery_calendar#addEvent
41          events = {};
42          $.ajax({
43            url: "/calendar/?year="+y+"&month="+m+"&api=true",
44            data: {
45              action: 'api',
46              year: y,
47              month: m
48            },
49            dataType: 'json',
50            async: false,
51            success: function(data) {
52              for(var date in data) {
53                for(var category in data[date]) {
54                  if(typeof events[date] == "undefined") {
55                    events[date] = {title:''};
56                  }
57                  events[date]['title'] += data[date][category]['name'] + "\n";
58                }
59              }
60            }
61          });
62          option.events =  events;
63        },
64        afterMove: function(option,y, m) {
65          // 月切り替え時の後処理 → カレンダークリック時の処理
66          pages(y,m);
67        }
68      });
69
70      // ページ表示時のカレンダークリック時の処理設定
71      pages(year,month);
72
73      $(".todayLink").hide();
74    },
75    // エラー確認用
76    // error: function(xhr, status, error) {
77    //   console.error('AJAX Error:', status, error);
78    //   console.error('Response Text:', xhr.responseText);
79    // },
80
81  });
82});
83function pages(y,m) {
84  // カレンダー 見出しクリック時の処理
85  $('#calendar .caption').click(function(){
86    location.href = "/calendar/?year="+y+"&month="+m;
87  });
88  // カレンダー 日付部分クリック時の処理
89  $('#calendar table td.event').click(function(){
90    setLink($(this).attr('id'));
91  });
92}
93function setLink(val) {
94  val = val.split("-");
95  location.href = "/calendar/?year="+val[1]+"&month="+val[2]+"#d"+val[3];
96}

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.