From 9210ca7dab5783a909f9322b5b7d6fb60236cb90 Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Thu, 27 Jul 2006 14:53:33 +0000 Subject: [PATCH] Fix 49934: gopher support, minor restructuring of directory viewer. necko: r=darin,dougt sr=rpotts other: r=waterson,mstoltz,jag sr=alecf Fix 70404: assertionsf or datetime and finger. r=dougt, sr=rpotts Both patches by Bradley Baetz (bbaetz@cs.mcgill.ca) --- suite/common/directory/directory.js | 40 ++++++++++++++++++---------- suite/common/directory/directory.xul | 6 ++++- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/suite/common/directory/directory.js b/suite/common/directory/directory.js index db76f7c56601..2bc836df8fcf 100644 --- a/suite/common/directory/directory.js +++ b/suite/common/directory/directory.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 4; c-basic-offset: 4; -*- +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- * * The contents of this file are subject to the Netscape Public * License Version 1.1 (the "License"); you may not use this file @@ -18,6 +18,7 @@ * Rights Reserved. * * Contributor(s): + * Bradley Baetz */ /* @@ -56,7 +57,7 @@ const nsISupportsWString = Components.interfaces.nsISupportsWString; function debug(msg) { // Uncomment to print out debug info. - // dump(msg); + //dump(msg); } @@ -167,9 +168,10 @@ function Init() debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } - + } + if (baseURI && (baseURI.indexOf("file://") != 0)) { // Note: DON'T add the HTTPIndex datasource into the tree - // for file URLs, only do it for FTP URLs; the "rdf:files" + // for file URLs, only do it for FTP/Gopher/etc URLs; the "rdf:files" // datasources handles file URLs tree.database.AddDataSource(HTTPIndex.DataSource); } @@ -209,8 +211,6 @@ function Init() tree.setAttribute("ref", baseURI); } - - function DoUnload() { var tree = document.getElementById("tree"); @@ -232,21 +232,33 @@ function OnClick(event, node) return(false); var tree = document.getElementById("tree"); - if( tree.selectedItems.length == 1 ) - { + if( tree.selectedItems.length == 1 ) { var selectedItem = tree.selectedItems[0]; - var theID = selectedItem.getAttribute("id"); - - window._content.location.href = theID; - + var url = selectedItem.getAttribute("URL"); + + window._content.location.href = url; + // set window title var theWindow = window._content.parentWindow; if (theWindow) - theWindow.title = theID; - } + theWindow.title = url; + } } +function OnMouseOver(event, node) +{ + if (node.nodeName != "treeitem") + return false; + var url = node.getAttribute("URL"); + window._content.status = url; + return true; +} +function OnMouseOut(event, node) +{ + window._content.status = ""; + return true; +} function doSort(sortColName) { diff --git a/suite/common/directory/directory.xul b/suite/common/directory/directory.xul index 2bede14fa4ab..27eb60f04e7d 100644 --- a/suite/common/directory/directory.xul +++ b/suite/common/directory/directory.xul @@ -43,6 +43,7 @@