PageSourceSearch

https://lruihao.cn/js/lib/file-tree.min.js

js lruihao.cn collected 2026-09-25 21:46:59 UTC 1,704 bytes, 1 lines download raw bytes

1"use strict";(()=>{var n=class{#e=document;on(e,t){this.#e.addEventListener(e,t)}off(e,t){this.#e.removeEventListener(e,t)}emit(e,...n){let t=n[0];this.#e.dispatchEvent(t!==0[0]?new CustomEvent(e,{detail:t}):new CustomEvent(e))}},s=new n;function t(t=document){t.querySelectorAll(".file-tree-toggle:not([data-init])").forEach(t=>{t.addEventListener("click",n=>{n.stopPropagation();let s=t.closest(".file-tree-folder"),o=s.classList.contains("is-collapsed");s&&s.classList.toggle("is-collapsed",!o);let i=t.closest(".file-tree-wrapper");e(i)}),t.dataset.init="true"}),e(t)}function e(e=document){e.querySelectorAll(".file-tree .file-tree").forEach(e=>{if(e.closest(".file-tree-item.is-collapsed")){e.style.removeProperty("--fi-file-tree-line-height");return}let t=Array.from(e.children).filter(e=>e.classList?.contains("file-tree-item"));if(!t.length){e.style.removeProperty("--fi-file-tree-line-height");return}let s=t[0].querySelector(".file-tree-label"),o=t[t.length-1].querySelector(".file-tree-label");if(!s||!o)return;let n=s.getBoundingClientRect(),i=o.getBoundingClientRect(),a=n.top+n.height/2,r=i.top+i.height/2,c=n.height/2+1/2+4,l=Math.max(0,r-a+c);e.style.setProperty("--fi-file-tree-line-height",`${l}px`)})}function o(t=document){t.querySelectorAll(".file-tree-folder").forEach(e=>e.classList.remove("is-collapsed")),e(t)}function i(){document.addEventListener("tab-container-changed",t=>{let n=t.panel||t.detail?.relatedTarget;n&&e(n)},!1),window.addEventListener("beforeprint",()=>{window.config.print?.expandFileTree&&o(document.getElementById("content"))}
1,!1),s.on("fixit:content-decrypted",({detail:e})=>{t(e.target)})}document.addEventListener("DOMContentLoaded",()=>{t(),i()},!1)})()

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.