File: default.js

package info (click to toggle)
ghostscript 10.0.0~dfsg-11%2Bdeb12u7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 98,252 kB
  • sloc: ansic: 891,828; python: 7,649; cpp: 6,493; cs: 6,209; sh: 6,043; java: 4,028; perl: 2,372; tcl: 1,639; makefile: 521; awk: 66; javascript: 43; yacc: 18
file content (53 lines) | stat: -rw-r--r-- 1,564 bytes parent folder | download
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
var showingBurgerMenu = false;

function showMenu() {
    showingBurgerMenu = !showingBurgerMenu;

    var mobileMenu = document.getElementById("burger-menu");

    if (showingBurgerMenu) {
        mobileMenu.classList.add("show");
    } else {
        mobileMenu.classList.remove("show");
    }

}

function copyText(buttonDiv) {
    for (var i=0;i<buttonDiv.parentNode.childNodes.length;i++) {

        if (buttonDiv.parentNode.childNodes[i].tagName!=undefined) {
            if (buttonDiv.parentNode.childNodes[i].tagName.toLowerCase()=="code") {
                var codeBlock = buttonDiv.parentNode.childNodes[i];
                var copyText = codeBlock.innerHTML;
                const textArea = document.createElement('textarea');
                textArea.textContent = copyText;
                document.body.append(textArea);
                textArea.select();
                document.execCommand("copy");
            }
        }
    }
}

function showCopyButton(preDiv) {
    for (var i=0;i<preDiv.childNodes.length;i++) {

        if (preDiv.childNodes[i].tagName!=undefined) {
            if (preDiv.childNodes[i].tagName.toLowerCase()=="button") {
                preDiv.childNodes[i].classList.add("show");
            }
        }
    }
}

function hideCopyButton(preDiv) {
    for (var i=0;i<preDiv.childNodes.length;i++) {

        if (preDiv.childNodes[i].tagName!=undefined) {
            if (preDiv.childNodes[i].tagName.toLowerCase()=="button") {
                preDiv.childNodes[i].classList.remove("show");
            }
        }
    }
}