зеркало из https://github.com/mozilla/gecko-dev.git
sidebar
This commit is contained in:
Родитель
4f3be700d7
Коммит
a51bad5007
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ Contributor(s): ______________________________________. -->
|
|||
|
||||
|
||||
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/content/sidebar/sidebarOverlay.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/sidebar/sidebar.css" type="text/css"?>
|
||||
|
||||
<?xul-overlay href="chrome://communicator/content/platformCommunicatorOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://browser/content/bookmarks/bookmarksOverlay.xul"?>
|
||||
|
@ -707,6 +709,11 @@ Contributor(s): ______________________________________. -->
|
|||
oncommand="BrowserHome();"/>
|
||||
</hbox>
|
||||
<toolbarseparator/>
|
||||
<toolbarbutton id="search-button" class="toolbarbutton-1"
|
||||
label="&searchButton.label;" persist="hidden"
|
||||
oncommand="openPanel('chrome://communicator/content/search/search-panel.xul',
|
||||
this.getAttribute('label'));"/>
|
||||
<toolbarseparator/>
|
||||
<toolbarbutton id="print-button" class="toolbarbutton-1"
|
||||
label="&printButton.label;" persist="hidden"
|
||||
oncommand="BrowserPrint();"
|
||||
|
@ -907,15 +914,28 @@ Contributor(s): ______________________________________. -->
|
|||
|
||||
</toolbox>
|
||||
|
||||
<!-- we only need to handle |ondragdrop| because everything else is
|
||||
taken care of by the builtin behavior inside the tabbrowser -->
|
||||
<vbox id="appcontent" flex="1"
|
||||
ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);">
|
||||
<hbox flex="1">
|
||||
<vbox id="boxSidebar" hidden="true" flex="1" persist="hidden width">
|
||||
<sidebarheader id="sidebarhdrSidebar" class="sidebarheader-main"
|
||||
type="box" persist="label"
|
||||
collapse="after">
|
||||
<toolbarbutton id="sidebar-close-button" oncommand="SidebarShowHide();"
|
||||
tooltiptext="close"/>
|
||||
</sidebarheader>
|
||||
<browser id="browserSidebar" flex="1" persist="src"/>
|
||||
</vbox>
|
||||
<splitter id="splitterSidebar" collapse="before" persist="state hidden"
|
||||
class="chromeclass-extrachrome sidebar-splitter"
|
||||
align="center" onmouseup="SidebarFinishClick();">
|
||||
<grippy class="sidebar-splitter-grippy"
|
||||
onclick="SidebarCleanUpExpandCollapse();"/>
|
||||
</splitter>
|
||||
<tabbrowser id="content"
|
||||
flex="1" contenttooltip="aHTMLTooltip"
|
||||
contentcontextmenu="contentAreaContextMenu"
|
||||
onclick="return contentAreaClick(event);"/>
|
||||
</vbox>
|
||||
onclick="return contentAreaClick(event);"
|
||||
ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);"/>
|
||||
</hbox>
|
||||
|
||||
<statusbar id="status-bar" class="chromeclass-status"
|
||||
ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);">
|
||||
|
|
|
@ -192,3 +192,5 @@
|
|||
<!ENTITY location.label "Location:">
|
||||
<!ENTITY location.accesskey "L">
|
||||
<!ENTITY openCmd2.commandkey "d">
|
||||
|
||||
<!ENTITY searchButton.label "Search">
|
|
@ -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);
|
||||
}
|
||||
|
|
Двоичные данные
browser/base/resources/skin/buttons.gif
Двоичные данные
browser/base/resources/skin/buttons.gif
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 3.0 KiB После Ширина: | Высота: | Размер: 3.5 KiB |
Загрузка…
Ссылка в новой задаче