Fix for 98782 and a few other history bugs. r=ben sr=hewitt

This commit is contained in:
blakeross%telocity.com 2001-11-25 04:01:04 +00:00
parent 7faf639ae4
commit 4818f17267
4 changed files with 13 additions and 17 deletions

View File

@ -46,7 +46,7 @@ var gDeleteByHostname;
var gDeleteByDomain;
var gHistoryBundle;
var gHistoryStatus;
var gHistoryGrouping;
var gHistoryGrouping = "";
var gWindowManager = null;
function HistoryInit()
@ -77,17 +77,14 @@ function HistoryInit()
gPrefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
try {
var grouping = gPrefService.getCharPref("browser.history.grouping");
gHistoryGrouping = gPrefService.getCharPref("browser.history.grouping");
}
catch(e) {
gHistoryGrouping = "";
gHistoryGrouping = "day";
}
GroupBy(gHistoryGrouping);
if (gHistoryStatus) { // must be the window
switch(gHistoryGrouping) {
case "site":
document.getElementById("groupBySite").setAttribute("checked", "true");
break;
case "none":
document.getElementById("groupByNone").setAttribute("checked", "true");
break;
@ -114,7 +111,7 @@ function historyOnSelect()
gLastDomain = "";
var match;
var currentIndex = gHistoryOutliner.currentIndex;
var rowIsContainer = isContainer(gHistoryOutliner, currentIndex);
var rowIsContainer = gHistoryGrouping == "day" ? isContainer(gHistoryOutliner, currentIndex) : false;
var url = gHistoryOutliner.outlinerBoxObject.view.getCellText(currentIndex, "URL");
if (url && !rowIsContainer) {
@ -272,15 +269,17 @@ function GroupBy(groupingType)
{
var outlinerBody = document.getElementById("historyOutlinerBody");
switch(groupingType) {
case "day":
outlinerBody.setAttribute("ref", "NC:HistoryByDate");
break;
case "site":
outlinerBody.setAttribute("ref", "find:groupby=hostname");
break;
case "none":
outlinerBody.setAttribute("ref", "NC:HistoryRoot");
break;
case "site":
// xxx for now
outlinerBody.setAttribute("ref", "NC:HistoryByDate");
break;
case "day":
default:
outlinerBody.setAttribute("ref", "NC:HistoryByDate");
break;
}
gPrefService.setCharPref("browser.history.grouping", groupingType);
}

View File

@ -115,7 +115,6 @@
<menu id="groupingMenu" label="&groupBy.label;" accesskey="&groupBy.accesskey;">
<menupopup>
<menuitem id="groupByDay" label="&groupByDay.label;" accesskey="&groupByDay.accesskey;" type="radio" oncommand="GroupBy('day');"/>
<menuitem id="groupBySite" label="&groupBySite.label;" accesskey="&groupBySite.accesskey;" type="radio" oncommand="GroupBy('site');"/>
<menuitem id="groupByNone" label="&groupByNone.label;" accesskey="&groupByNone.accesskey;" type="radio" oncommand="GroupBy('none');"/>
</menupopup>
</menu>

View File

@ -1,5 +1,5 @@
<!ENTITY search.name.label "name">
<!ENTITY search.name.label "title">
<!ENTITY search.url.label "location">
<!ENTITY search.startswith.label "starts with">
<!ENTITY search.endswith.label "ends with">

View File

@ -18,8 +18,6 @@
<!ENTITY groupBy.accesskey "G">
<!ENTITY groupByDay.label "Day">
<!ENTITY groupByDay.accesskey "D">
<!ENTITY groupBySite.label "Site">
<!ENTITY groupBySite.accesskey "S">
<!ENTITY groupByNone.label "None">
<!ENTITY groupByNone.accesskey "N">
<!ENTITY historyWindowTitle.label "History">