// ==UserScript==
// @name filter event by aj club name
// @namespace http://tampermonkey.net/
// @version 0.1
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @description add a club index in the head then you could get by event list by club!
// @author Matt
// @match https://www.audax-japan.org/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
function onlyUnique(value, index, self) {
return self.indexOf(value) === index;
}
function onlyShowme(event) {
$("table > tbody > tr").each(function () {
$(this).show();
if ($(this).find("td:nth-child(3)").text() !== event.target.text) {
$(this).hide();
}
});
}
var club_list = [];
var only_unique = [];
$("table > tbody > tr > td:nth-child(3)").each(function () {
club_list.push($(this).text());
only_unique = club_list.filter(onlyUnique).filter(function (e) {
return e !== ''
}).filter(function (e) {
return e !== '主催'
});
});
for (var i = 0; i < only_unique.length; i++) {
$("#post-21795 > div").prepend("<a id='" + only_unique[i] + "' style='padding:3px;cursor: context-menu;'>" + only_unique[i] + "</a>");
}
for (var j = 0; j < only_unique.length; j++) {
$("#" + only_unique[j]).click(onlyShowme);
}
})();
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme