-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathamqExpandSearchANNID.user.js
57 lines (50 loc) · 1.95 KB
/
amqExpandSearchANNID.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// ==UserScript==
// @name AMQ Expand Search ANN ID
// @namespace https://github.com/TheJoseph98
// @version 1.2
// @description Allows the user to search anime by ANNID in Expand Library
// @author TheJoseph98
// @match https://animemusicquiz.com/*
// @grant none
// @require https://github.com/joske2865/AMQ-Scripts/raw/master/common/amqScriptInfo.js
// @downloadURL https://github.com/joske2865/AMQ-Scripts/raw/master/amqExpandSearchANNID.user.js
// @updateURL https://github.com/joske2865/AMQ-Scripts/raw/master/amqExpandSearchANNID.user.js
// ==/UserScript==
// Wait until the LOADING... screen is hidden and load script
if (typeof Listener === "undefined") return;
let loadInterval = setInterval(() => {
if ($("#loadingScreen").hasClass("hidden")) {
clearInterval(loadInterval);
setup();
}
}, 500);
const version = "1.2";
function setup() {
$("#elQuestionFilterInput").attr("placeholder", "Search anime, song, artist or ANN ID");
ExpandQuestionListEntry.prototype.applySearchFilter = function (regexFilter, stricter) {
if (this.annId === parseInt($("#elQuestionFilterInput").val())) {
this.resetSearchFilter();
return true;
}
if (stricter && !this.active) {
return false;
}
if (regexFilter.test(this.name)) {
this.resetSearchFilter();
} else {
this.songList.forEach(entry => {
entry.applySearchFilter(regexFilter, stricter);
});
this.updateDisplay();
}
};
AMQ_addScriptData({
name: "Expand Search by ANN ID",
author: "TheJoseph98",
version: version,
link: "https://github.com/joske2865/AMQ-Scripts/raw/master/amqExpandSearchANNID.user.js",
description: `
<p>Allows the user to search expand library by ANN ID in addition to searching by anime name, song name and artist</p>
`
});
}