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

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