annotate static/app.js @ 0:426b0f85a311 draft

" master branch Updating"
author lain
date Tue, 19 Jul 2022 07:36:57 +0000
parents
children c7f4f2ac38f2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
1
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
2 var content = document.getElementById("history_metadata_extractor_content") ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
3 document.getElementById("history_metadata_extractor_top").onclick = () => {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
4 content.scrollTo(0, 0) ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
5 } ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
6 document.getElementById("history_metadata_extractor_bottom").onclick = () => {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
7 content.scrollTo(0, content.scrollHeight) ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
8 } ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
9 var folded = false ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
10 document.getElementById("history_metadata_extractor_folder").onclick = (e) => {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
11 if (folded) {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
12 var func = (item) => item.classList.remove("d-none") ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
13 } else {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
14 var func = (item) => item.classList.add("d-none") ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
15 }
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
16 Array.prototype.forEach.call(document.getElementsByClassName("history_metadata_extractor_table"), func) ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
17 folded = ! folded ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
18 } ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
19
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
20 var kawaii = false ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
21 document.getElementById("glitter-generator").onclick = (e) => {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
22 if (kawaii) {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
23 var func = (item) => item.classList.remove("kawaii") ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
24 } else {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
25 var func = (item) => item.classList.add("kawaii") ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
26 }
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
27 Array.prototype.forEach.call(document.querySelectorAll("[class^=history_metadata_extractor_]"), func) ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
28 kawaii = ! kawaii ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
29 } ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
30
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
31 var show_deleted = true ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
32 document.getElementById("history_metadata_extractor_toggle_deleted").onclick = (e) => {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
33 show_deleted = !show_deleted ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
34 if (show_deleted) {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
35 var func = (item) => item.classList.remove("d-none") ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
36 } else {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
37 var func = (item) => item.classList.add("d-none") ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
38 }
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
39 Array.prototype.forEach.call(
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
40 document.getElementsByClassName("history_metadata_extractor_deleted"),
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
41 func
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
42 ) ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
43 } ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
44
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
45 Array.prototype.forEach.call(document.getElementsByClassName(
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
46 "history_metadata_extractor_h2"),
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
47 (h2) => {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
48 var table = h2.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
49 h2.onclick = (e) => {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
50 if (table.classList.contains("d-none")) {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
51 table.classList.remove("d-none") ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
52 } else {
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
53 table.classList.add("d-none") ;
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
54 }
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
55 }
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
56 }
426b0f85a311 " master branch Updating"
lain
parents:
diff changeset
57 )