PageSourceSearch

https://uic.must.edu.mo/js/min-height.js

js must.edu.mo collected 2026-09-25 09:22:04 UTC 2,678 bytes, 83 lines download raw bytes

1;((doc) => {
2
3    window.onload = () => {
4        init();
5
6        const clienHeight = document.documentElement.clientHeight; // 可視窗口高度
7        const clienWidth = document.documentElement.clientWidth; // 可視窗口寬度
8        const main = doc.querySelector('main');
9        const footer = doc.querySelector('footer');
10        const nav = doc.querySelector('nav');
11        if (clienWidth >= 1024) {
12            main.style.minHeight = clienHeight - nav.offsetHeight - footer.offsetHeight - 60 + 'px';
13        } else if (clienWidth < 1024) {
14            main.style.minHeight = clienHeight - nav.offsetHeight - footer.offsetHeight - 60 + 'px';
15        }
16
17        const loadingModal = doc.querySelector('#loading-modal');
18        if (loadingModal) {
19            loadingModal.classList.add('hidden')
20        }
21
22
23    }
24
25    const AGREE_COOKIE = "agree_cookie";
26    // window.onload =
27
28    function init() {
29        let cookie = getCookie(AGREE_COOKIE);
30        if (!cookie) {
31            setCookie(AGREE_COOKIE, "suc", 2);
32        }
33    }
34
35    /**
36     * 获取cookie
37     *
38     * @param cname
39     * @returns {string}
40     */
41    function getCookie(cname) {
42        let name = cname + "=";
43        let ca = document.cookie.split(';');
44        for (let i = 0; i < ca.length; i++) {
45            let c = ca[i];
46            while (c.charAt(0) == ' ') c = c.substring(1);
47            if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
48        }
49        return "";
50    }
51
52    /**
53     * 设置cookie
54     */
55    function setCookie(cname, cvalue, exdays) {
56        let d = new Date();
57        d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
58        let expires = "expires=" + d.toUTCString();
59        document.cookie = cname + "=" + cvalue + "; " + expires  + ";path=/";
60    }
61
62    /**
63     * 清除cookie
64     * @param name
65     */
66    function clearCookie(name) {
67        setCookie(name, '', -1);
68    }
69
70    // // 監聽窗口變化
71    // window.addEventListener('resize', () => {
72    //     const clienHeight = document.documentElement.clientHeight; // 可視窗口高度
73    //     const clienWidth = document.documentElement.clientWidth; // 可視窗口寬度
74    //     const main = doc.querySelector('main');
75    //     const footer = doc.querySelector('footer');
76    //     const nav = doc.querySelector('nav');
77    //     if (clienWidth >= 1024) {
78    //         main.style.minHeight = clienHeight - nav.offsetHeight - footer.offsetHeight - 60 + 'px';
79    //     } else if (clienWidth < 1024) {
80    //         main.style.minHeight = clienHeight - nav.offsetHeight - footer.offsetHeight - 60 + 'px';
81    //     }
82    // })
83})(document);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.