Skip to content

Commit d98a0a8

Browse files
committed
FEATURE: Filter for empty replies
1 parent 4896922 commit d98a0a8

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

index.html

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ <h1>Instant View Open Issues</h1>
1717

1818
<div class="filter-box">
1919
<input type="checkbox" id="self-made-cb" name="check" onchange="filter_self_made()"><label class="checkbox-label">Only self-made issues</label></input>
20+
<input type="checkbox" id="reply-cb" name="check" onchange="filter_no_reply()"><label class="checkbox-label">Only without reply</label></input>
2021
</div>
2122

2223
<div class="search-box">

iv_script.js

+20
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,26 @@ function filter_self_made() {
3535
}
3636
}
3737

38+
function filter_no_reply() {
39+
checkbox = document.getElementById("reply-cb")
40+
list = document.getElementById("main-list");
41+
list.innerHTML = "";
42+
43+
if (checkbox.checked) {
44+
for (i = 0; i < issue_data.length; i++) {
45+
var issue = issue_data[i];
46+
var regExp = /https:\/\/instantview\.telegram\.org\/contest\/(.*?)\/template[0-9]+\/issue[0-9]+\/?/g;
47+
var domain_name = regExp.exec(issue.url)[1]
48+
if (issue.creator_comment == "") {
49+
var container = create_issue(issue.url, domain_name, issue.author, issue.template_creator, issue.comment, issue.creator_comment);
50+
list.appendChild(container);
51+
}
52+
}
53+
} else {
54+
load_all_issues();
55+
}
56+
}
57+
3858
function load_all_issues() {
3959
list = document.getElementById("main-list");
4060
list.innerHTML = "";

0 commit comments

Comments
 (0)