diff --git a/browser/base/resources/content/browser.js b/browser/base/resources/content/browser.js index 18c0c9b09dc5..cf24d158472b 100644 --- a/browser/base/resources/content/browser.js +++ b/browser/base/resources/content/browser.js @@ -472,7 +472,7 @@ function Startup() // Add a capturing event listener to the content area // so we'll be notified when onloads complete. - var contentArea = document.getElementById("appcontent"); + var contentArea = document.getElementById("content"); contentArea.addEventListener("load", loadEventHandlers, true); contentArea.addEventListener("focus", contentAreaFrameFocus, true); @@ -2047,3 +2047,73 @@ function FillInHTMLTooltip(tipElement) return retVal; } + +function openPanel(aURI, aTitle) +{ + SidebarShowHide(); + var sidebarPane = document.getElementById("browserSidebar"); + sidebarPane.setAttribute("src", aURI); + var sidebarHeader = document.getElementById("sidebarhdrSidebar"); + sidebarHeader.setAttribute("label", aTitle); +} + +function SidebarShowHide() { + var sidebar_box = document.getElementById('boxSidebar'); + var sidebar_splitter = document.getElementById('splitterSidebar'); + + if (sidebar_is_hidden()) { + // for older profiles: + sidebar_box.setAttribute('hidden', 'false'); + if (sidebar_splitter.getAttribute('state') == 'collapsed') + sidebar_splitter.removeAttribute('state'); + sidebar_splitter.removeAttribute('hidden'); + } else { + sidebar_box.setAttribute('hidden', 'true'); + sidebar_splitter.setAttribute('hidden', 'true'); + } + persist_width(); + window._content.focus(); +} + +// sidebar_is_hidden() - Helper function for SidebarShowHide(). +function sidebar_is_hidden() { + var sidebar_box = document.getElementById('boxSidebar'); + return sidebar_box.getAttribute('hidden') == 'true'; +} + +function sidebar_is_collapsed() { + var sidebar_splitter = document.getElementById('splitterSidebar'); + return (sidebar_splitter && + sidebar_splitter.getAttribute('state') == 'collapsed'); +} + +function SidebarExpandCollapse() { + var sidebar_splitter = document.getElementById('splitterSidebar'); + var sidebar_box = document.getElementById('boxSidebar'); + if (sidebar_splitter.getAttribute('state') == 'collapsed') { + sidebar_splitter.removeAttribute('state'); + sidebar_box.setAttribute('hidden', 'false'); + } else { + sidebar_splitter.setAttribute('state', 'collapsed'); + sidebar_box.setAttribute('hidden', 'true'); + } +} +function persist_width() { + // XXX Mini hack. Persist isn't working too well. Force the persist, + // but wait until the width change has commited. + setTimeout("document.persist('boxSidebar', 'width');",100); +} + +function SidebarFinishClick() { + + // XXX Semi-hack for bug #16516. + // If we had the proper drag event listener, we would not need this + // timeout. The timeout makes sure the width is written to disk after + // the sidebar-box gets the newly dragged width. + setTimeout("persist_width()",100); +} + +// SidebarCleanUpExpandCollapse() - Respond to grippy click. +function SidebarCleanUpExpandCollapse() { + setTimeout("document.persist('boxSidebar', 'hidden');",100); +} diff --git a/browser/base/resources/content/browser.xul b/browser/base/resources/content/browser.xul index 58a16a035853..9895078ae043 100644 --- a/browser/base/resources/content/browser.xul +++ b/browser/base/resources/content/browser.xul @@ -22,6 +22,8 @@ Contributor(s): ______________________________________. --> + + @@ -707,6 +709,11 @@ Contributor(s): ______________________________________. --> oncommand="BrowserHome();"/> + + - - + + + + + - + onclick="return contentAreaClick(event);" + ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);"/> + diff --git a/browser/base/resources/locale/navigator.dtd b/browser/base/resources/locale/navigator.dtd index d46ddc5ac3e0..b2bf06a76594 100644 --- a/browser/base/resources/locale/navigator.dtd +++ b/browser/base/resources/locale/navigator.dtd @@ -192,3 +192,5 @@ + + \ No newline at end of file diff --git a/browser/base/resources/skin/browser.css b/browser/base/resources/skin/browser.css index e1016582fab0..90aa9d9d2442 100644 --- a/browser/base/resources/skin/browser.css +++ b/browser/base/resources/skin/browser.css @@ -138,6 +138,18 @@ -moz-image-region: rect(63px 138px 84px 115px) !important; } +#search-button { + -moz-image-region: rect(0px 161px 21px 138px) !important; +} + +#search-button:hover { + -moz-image-region: rect(42px 161px 63px 138px) !important; +} + +#search-button:hover:active { + -moz-image-region: rect(63px 161px 84px 138px) !important; +} + /* ::::: small primary toolbar buttons ::::: */ .toolbarbutton-1[toolbarmode="small"] { @@ -327,3 +339,14 @@ #security-button[level="broken"] { list-style-image: url("chrome://communicator/skin/icons/lock-broken.gif"); } + +#boxSidebar { + width: 162px; + min-height: 10px; + min-width: 30px; + max-width: 400px; +} + +sidebarheader[type="box"] { + -moz-binding: url(chrome://communicator/content/sidebar/sidebarBindings.xml#sidebar-header-box); +} diff --git a/browser/base/resources/skin/buttons.gif b/browser/base/resources/skin/buttons.gif index d6302811b36a..b625a0801187 100644 Binary files a/browser/base/resources/skin/buttons.gif and b/browser/base/resources/skin/buttons.gif differ