diff --git a/mozilla/browser/components/help/locale/en-US/help.dtd b/mozilla/browser/components/help/locale/en-US/help.dtd deleted file mode 100644 index a503b65daf6..00000000000 --- a/mozilla/browser/components/help/locale/en-US/help.dtd +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mozilla/browser/components/help/locale/en-US/help.properties b/mozilla/browser/components/help/locale/en-US/help.properties deleted file mode 100644 index 0e350e2ce68..00000000000 --- a/mozilla/browser/components/help/locale/en-US/help.properties +++ /dev/null @@ -1,2 +0,0 @@ -showSidebarLabel=Show Sidebar -hideSidebarLabel=Hide Sidebar diff --git a/mozilla/browser/components/help/locale/en-US/helpMenuOverlay.dtd b/mozilla/browser/components/help/locale/en-US/helpMenuOverlay.dtd deleted file mode 100644 index 7a9307ccc20..00000000000 --- a/mozilla/browser/components/help/locale/en-US/helpMenuOverlay.dtd +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - diff --git a/mozilla/toolkit/components/help/content/help.js b/mozilla/toolkit/components/help/content/help.js index d375d23e4dc..4f53b7a39e4 100644 --- a/mozilla/toolkit/components/help/content/help.js +++ b/mozilla/toolkit/components/help/content/help.js @@ -203,9 +203,9 @@ function loadHelpRDF() { // Cache Additional Datasources to Augment Search Datasources. if (panelID == "search") { emptySearchText = getAttribute(helpFileDS, panelDef, - NC_EMPTY_SEARCH_TEXT, "No search items found."); + NC_EMPTY_SEARCH_TEXT, null) || "No search items found."; emptySearchLink = getAttribute(helpFileDS, panelDef, - NC_EMPTY_SEARCH_LINK, "about:blank"); + NC_EMPTY_SEARCH_LINK, null) || "about:blank"; searchDatasources = datasources; // Don't try to display them yet! datasources = "rdf:null"; @@ -459,6 +459,7 @@ nsHelpStatusHandler.prototype = { }, onProgressChange : function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {}, + onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage) {}, onSecurityChange : function(aWebProgress, aRequest, state) {}, onLocationChange : function(aWebProgress, aRequest, aLocation) { UpdateBackForwardButtons(); @@ -539,7 +540,6 @@ function showPanel(panelId) { document.getElementById("help-toc-btn").removeAttribute("selected"); //add the selected style to the correct panel. theButton.setAttribute("selected", "true"); - document.commandDispatcher.advanceFocusIntoSubtree(theButton); } function findParentNode(node, parentNode) @@ -564,13 +564,15 @@ function findParentNode(node, parentNode) } function onselect_loadURI(tree) { - var row = tree.currentIndex; - if (row >= 0) { - var resource = tree.view.getResourceAtIndex(row); + try { + var resource = tree.view.getResourceAtIndex(tree.currentIndex); var link = tree.database.GetTarget(resource, NC_LINK, true); - if (link instanceof Components.interfaces.nsIRDFLiteral && link.Value) + if (link) { + link = link.QueryInterface(Components.interfaces.nsIRDFLiteral); loadURI(link.Value); - } + } + } catch (e) { + }// when switching between tabs a spurious row number is returned. } # doFind - Searches the help files for what is located in findText and outputs into @@ -745,8 +747,23 @@ function loadCompositeDS(datasources) { function getAttribute(datasource, resource, attributeResourceName, defaultValue) { var literal = datasource.GetTarget(resource, attributeResourceName, true); - return literal instanceof Components.interfaces.nsIRDFLiteral ? - literal.Value : defaultValue; + if (!literal) { + return defaultValue; + } + return getLiteralValue(literal, defaultValue); +} + +function getLiteralValue(literal, defaultValue) { + if (literal) { + literal = literal.QueryInterface(Components.interfaces.nsIRDFLiteral); + if (literal) { + return literal.Value; + } + } + if (defaultValue) { + return defaultValue; + } + return null; } # Write debug string to javascript console. @@ -791,3 +808,28 @@ function toggleSidebar() } } +// Shows the panel relative to the currently selected panel. +// Takes a boolean parameter - if true it will show the next panel, +// otherwise it will show the previous panel. +function showRelativePanel(goForward) { + var selectedIndex = -1; + var sidebarBox = document.getElementById("helpsidebar-box"); + var sidebarButtons = new Array(); + for (var i = 0; i < sidebarBox.childNodes.length; i++) { + var btn = sidebarBox.childNodes[i]; + if (btn.nodeName == "toolbarbutton") { + if (btn.getAttribute("selected") == "true") + selectedIndex = sidebarButtons.length; + sidebarButtons.push(btn); + } + } + if (selectedIndex == -1) + return; + selectedIndex += goForward ? 1 : -1; + if (selectedIndex >= sidebarButtons.length) + selectedIndex = 0; + else if (selectedIndex < 0) + selectedIndex = sidebarButtons.length - 1; + sidebarButtons[selectedIndex].doCommand(); +} + diff --git a/mozilla/toolkit/components/help/content/help.xul b/mozilla/toolkit/components/help/content/help.xul index 70fee454fab..1d26d304188 100644 --- a/mozilla/toolkit/components/help/content/help.xul +++ b/mozilla/toolkit/components/help/content/help.xul @@ -49,7 +49,7 @@ + @@ -103,11 +104,17 @@ command="Help:Find" modifiers="accel"/> + + + -# @@ -127,7 +133,7 @@ customizeable="true" label="&sidebarBtn.label;" command="Help:ToggleSidebar"/> @@ -135,7 +141,7 @@ onpopupshowing="createBackMenu(event);"/> - @@ -178,16 +184,17 @@ -# -