PageSourceSearch

https://controladoria-geral.sorocaba.sp.gov.br/acesso-a-informacao…/php_file_tree/php_file_tree.js

js sorocaba.sp.gov.br collected 2026-10-01 11:43:34 UTC 2,433 bytes, 62 lines download raw bytes

1/*
2    == PHP FILE TREE JAVASCRIPT EXTENSION (Versão Corrigida) ==
3*/
4
5function init_php_file_tree() {
6    if (!document.getElementsByTagName) return;
7    
8    var aMenus = document.getElementsByTagName("LI");
9    for (var i = 0; i < aMenus.length; i++) {
10        var mclass = aMenus[i].className;
11        if (mclass.indexOf("pft-directory") > -1) {
12            var submenu = aMenus[i].childNodes;
13            for (var j = 0; j < submenu.length; j++) {
14                if (submenu[j].tagName == "A") {
15                    
16                    submenu[j].onclick = function() {
17                        var node = this.nextSibling;
18                                                
19                        while (1) {
20                            if (node != null) {
21                                if (node.tagName == "UL") {
22                                    var d = (node.style.display == "none"); // Verifica se está oculto (sem aspas extras)
23                                    node.style.display = (d) ? "block" : "none";
24                                    this.className = (d) ? "open" : "closed";
25                                    return false;
26                                }
27                                node = node.nextSibling;
28                            } else {
29                                return false;
30                            }
31                        }
32                        return false;
33                    }
34                    
35                    submenu[j].className = (mclass.indexOf("open") > -1) ? "open" : "closed";
36                }
37                
38                if (submenu[j].tagName == "UL")
39                    submenu[j].style.display = (mclass.indexOf("open") > -1) ? "block" : "none";
40            }
41        }
42    }
43    return false;
44}
45
46// --- CORREÇÃO PRINCIPAL ---
47// Removemos 'window.onload =' que causa conflitos.
48// Usamos addEventListener, que é o padrão seguro e moderno.
49if (window.addEventListener) {
50    window.addEventListener("load", init_php_file_tree, false);
51} else if (window.attachEvent) {
52    window.attachEvent("onload", init_php_file_tree);
53} else {
54    // Fallback apenas se o navegador for muito antigo
55    var oldOnLoad = window.onload;
56    window.onload = function() {
57        if (typeof oldOnLoad == 'function') {
58            oldOnLoad();
59        }
60        init_php_file_tree();
61    };
62}

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.