diff --git a/suite/common/directory/directory.js b/suite/common/directory/directory.js index 5f04dcd959f2..2da469e16c65 100644 --- a/suite/common/directory/directory.js +++ b/suite/common/directory/directory.js @@ -155,3 +155,31 @@ function Boot() setTimeout("Boot()", 0); +function doSort(sortColName) +{ + var node = document.getElementById(sortColName); + if (!node) return(false); + + // determine column resource to sort on + var sortResource = node.getAttribute('resource'); + + // switch between ascending & descending sort (no natural order support) + var sortDirection="ascending"; + var isSortActive = node.getAttribute('sortActive'); + if (isSortActive == "true") + { + var currentDirection = node.getAttribute('sortDirection'); + if (currentDirection == "ascending") + { + sortDirection = "descending"; + } + } + + var isupports = Components.classes["component://netscape/rdf/xul-sort-service"].getService(); + if (!isupports) return(false); + var xulSortService = isupports.QueryInterface(Components.interfaces.nsIXULSortService); + if (!xulSortService) return(false); + xulSortService.Sort(node, sortResource, sortDirection); + + return(false); +} diff --git a/suite/common/directory/directory.xul b/suite/common/directory/directory.xul index 226c143c9cbb..ca649c2cc65b 100644 --- a/suite/common/directory/directory.xul +++ b/suite/common/directory/directory.xul @@ -26,6 +26,7 @@ @@ -44,7 +45,6 @@ - @@ -52,11 +52,15 @@ + + + + - &directoryWindow.filename.label; - &directoryWindow.contentlength.label; - &directoryWindow.lastmodified.label; + + + diff --git a/xpfe/components/directory/directory.css b/xpfe/components/directory/directory.css index 279274fd16d4..3c04ddde1c2b 100644 --- a/xpfe/components/directory/directory.css +++ b/xpfe/components/directory/directory.css @@ -22,11 +22,10 @@ */ -tree { - background-color: #ccccdd; +treecol[sortActive="true"] { + background-color: lightgray; } - /* Hide the twisty when type != DIRECTORY (XXX is there a != in CSS) */ treeitem[type="FILE"] > treerow > treecell > .tree-icon > .twisty { list-style-image: none; diff --git a/xpfe/components/directory/directory.js b/xpfe/components/directory/directory.js index 5f04dcd959f2..2da469e16c65 100644 --- a/xpfe/components/directory/directory.js +++ b/xpfe/components/directory/directory.js @@ -155,3 +155,31 @@ function Boot() setTimeout("Boot()", 0); +function doSort(sortColName) +{ + var node = document.getElementById(sortColName); + if (!node) return(false); + + // determine column resource to sort on + var sortResource = node.getAttribute('resource'); + + // switch between ascending & descending sort (no natural order support) + var sortDirection="ascending"; + var isSortActive = node.getAttribute('sortActive'); + if (isSortActive == "true") + { + var currentDirection = node.getAttribute('sortDirection'); + if (currentDirection == "ascending") + { + sortDirection = "descending"; + } + } + + var isupports = Components.classes["component://netscape/rdf/xul-sort-service"].getService(); + if (!isupports) return(false); + var xulSortService = isupports.QueryInterface(Components.interfaces.nsIXULSortService); + if (!xulSortService) return(false); + xulSortService.Sort(node, sortResource, sortDirection); + + return(false); +} diff --git a/xpfe/components/directory/directory.xul b/xpfe/components/directory/directory.xul index 226c143c9cbb..ca649c2cc65b 100644 --- a/xpfe/components/directory/directory.xul +++ b/xpfe/components/directory/directory.xul @@ -26,6 +26,7 @@ @@ -44,7 +45,6 @@ - @@ -52,11 +52,15 @@ + + + + - &directoryWindow.filename.label; - &directoryWindow.contentlength.label; - &directoryWindow.lastmodified.label; + + +