PageSourceSearch

https://sasaru.media/assets/js/monthly_tag.js?v=20200817

js sasaru.media collected 2026-10-02 10:03:42 UTC 3,067 bytes, 98 lines download raw bytes

1function htmlspecialchars(str){
2	str = str.replace(/&/g,"&");
3	str = str.replace(/"/g,""");
4	str = str.replace(/'/g,"'");
5	str = str.replace(/</g,"<");
6	str = str.replace(/>/g,">");
7	return str;
8}
9function disp_monthly_tag(date){
10	//タグ表示
11	$.ajax({
12		type: "POST",
13		url: "/lib/get_monthly_tag.php",
14		dataType: "json",
15		data: JSON.stringify({article_date:date}),
16		success : function(data, dataType){
17			$("section#monthly_tag ul.c-words__list").children("li").remove();
18			$("section#monthly_tag ul.c-words__list .c-btn.more").remove();
19			var tag = "";
20			var cnt = 0;
21			var max = 20;
22			for(var val of data)
23			{
24				var hidden = (cnt >= max) ? " hidden" : "";
25				tag  = '<li class="c-words__list__item' + hidden + '">';
26				tag += '<a href="/category/index.html?tag=' + htmlspecialchars(val) + '"';
27				tag += ' class="c-words__list__link">';
28				tag += '#' + val;
29				tag += '</a>';
30				tag += '</li>';
31				
32				cnt++;
33				
34				$("section#monthly_tag ul.c-words__list").append(tag);
35			}
36			if(cnt > max)
37			{
38				tag = '<div class="c-btn more"><button class="c-btn__item c-btn__item--normal">もっと見る</button></div>';
39				$("section#monthly_tag ul.c-words__list").append(tag);
40			}
41		},
42		error : function(xhr, textStatus, errorThrown){
43			console.log("xhr : " + xhr.status);
44			console.log("textStatus : " + textStatus);
45			console.log("errorThrown : " + errorThrown.message);
46		}
47	});
48}
49function disp_year(current=""){
50	//年月表示
51	$("section#monthly_tag select#year").children("option").remove();
52	for(var val of date_list)
53	{
54		var year = "<option value='" + val["year"] + "'>" + val["year"] + "å¹´</option>";
55		$("section#monthly_tag select#year").append(year);
56	}
57}
58function disp_month(key){
59	$("section#monthly_tag select#month").children("option").remove();
60	var ary = new Array();
61	for(var val of date_list)
62	{
63		if(val["year"] == key)
64		{
65			ary = val["month"];
66			break;
67		}
68	}
69	for(var val of ary)
70	{
71		var month = "<option value='" + val + "'>" + val + "月</option>";
72		$("section#monthly_tag select#month").append(month);
73	}
74}
75$(function(){
76	$("section#monthly_tag select#year , section#monthly_tag select#month").change(function(){
77		if($(this).attr("id") == "year")
78		{
79			var current = $("section#monthly_tag select#year").val();
80			disp_month(current);
81		}
82		var date = $("section#monthly_tag select#year").val() + "-" + $("section#monthly_tag select#month").val();
83		disp_monthly_tag(date);
84	});
85	$(document).on("click", ".c-words--white .c-btn.more button", function(){
86		$(".c-words--white .c-words__list__item.hidden").removeClass("hidden");
87		$(".c-words--white .c-btn.more").fadeOut("normal", function(){
88			$(".c-words--white .c-btn.more").remove();
89		});
90	});
91	
92	//初期処理
93	disp_year();
94	var key = $("section#monthly_tag select#year").val();
95	disp_month(key);
96	var date = $("section#monthly_tag select#year").val() + "-" + $("section#monthly_tag select#month").val();
97	disp_monthly_tag(date);
98});

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.