context: function SiteBrowser(){    var fileBrowser = document.getElementById("filesBrowserSites");        this.addURL = function add(url, fileIndex)    {        var parsedURL = new ParsedURL(url);        var divs = fileBrowser.getElementsByTagName("div");                if (divs.length == 0) {             addNewDomain(parsedURL, fileIndex);        } else {            var isNew = true;            for (var i = 0; i < divs.length; i++) {                if (divs[i].id == parsedURL.domain) {                    var uls = divs[i].getElementsByTagName("ul");                    var ul = (uls.length > 0) ? uls[0] : document.createElement("ul");                    var li = document.createElement("li");                                        li.id = fileIndex;                    li.addEventListener("click", fileBrowserMouseEvents, false);                    li.title = li.innerText = parsedURL.relativePath ? parsedURL.relativePath : "/";                    ul.appendChild(li);                    isNew = false;                    break;                }            }            if (isNew) {                addNewDomain(parsedURL, fileIndex);            }        }    }        this.selectInitialFile = function sf()    {        if (currentFile == -1)            document.getElementById("1").className = "active";    }        function addNewDomain(parsedURL, fileIndex)    {        var div = document.createElement("div");        var ul = document.createElement("ul");        var li = document.createElement("li");                div.id = div.innerText = div.title = parsedURL.domain;        div.addEventListener("click", fileBrowserMouseEvents, false);        // Maybe we can add some roll-overs here...        //div.addEventListener("mouseover", fileBrowserMouseEvents, false);        //div.addEventListener("mouseout", fileBrowserMouseEvents, false);        li.id = fileIndex;        li.addEventListener("click", fileBrowserMouseEvents, false);        li.title = li.innerText = parsedURL.relativePath ? parsedURL.relativePath : "/";        ul.appendChild(li);        div.appendChild(ul);        fileBrowser.appendChild(div);            }        function removeFile(fileIndex)    {        var theFile = document.getElementById(fileIndex);        // If we are removing the last file from its site, go ahead and remove the whole site        if (theFile.parentNode.childNodes.length < 2) {             var theSite = theFile.parentNode.parentNode;            theSite.removeChildren();            theSite.parentNode.removeChild(theSite);        }        else            theFile.parentNode.removeChild(theFile);    }}
meta: 5650	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5650/7bcec024f50d21cb15912dadeb1c92b50dc3450c/debugger.js/clean/WebKitTools/Drosera/debugger.js