summaryrefslogtreecommitdiffstats
path: root/comm/suite/components/sidebar/content/sidebarOverlay.xul
blob: 0c1aa08566d844c63c7c48f44b269754643ae1c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?xml version="1.0"?> <!-- -*- Mode: HTML; indent-tabs-mode: nil -*- -->
<!--

 This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<!-- This overlay requires that the files it overlays has the menupopup
     contentAreaContextMenu defined for context menus to work correctly in
     certain custom tabs -->

<?xml-stylesheet href="chrome://communicator/content/sidebar/sidebarOverlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/sidebar/sidebar.css" type="text/css"?>

<!DOCTYPE overlay [
<!ENTITY % sidebarOverlayDTD SYSTEM "chrome://communicator/locale/sidebar/sidebarOverlay.dtd" >
%sidebarOverlayDTD;
]>

<overlay id="sidebarOverlay"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Overlay of broadcasterset to get our panels in -->
  <broadcasterset id="mainBroadcasterSet">
    <broadcaster id="viewBookmarksSidebar"
                 autoCheck="false"
                 type="checkbox"
                 group="sidebar"
                 sidebartitle="&sidebar.client-bookmarks.label;"
                 sidebarurl="chrome://communicator/content/bookmarks/bookmarksPanel.xul"
                 oncommand="toggleSidebar('viewBookmarksSidebar');"/>
    <broadcaster id="viewHistorySidebar"
                 autoCheck="false"
                 type="checkbox"
                 group="sidebar"
                 sidebartitle="&sidebar.client-history.label;"
                 sidebarurl="chrome://communicator/content/history/history-panel.xul"
                 oncommand="toggleSidebar('viewHistorySidebar');"/>
    <broadcaster id="viewSearchSidebar"
                 autoCheck="false"
                 type="checkbox"
                 group="sidebar"
                 sidebartitle="&sidebar.search.label;"
                 sidebarurl="chrome://communicator/content/search/search-panel.xul"
                 oncommand="toggleSidebar('viewSearchSidebar');"/>
    <broadcaster id="viewAddressbookSidebar"
                 autoCheck="false"
                 type="checkbox"
                 group="sidebar"
                 sidebartitle="&sidebar.client-addressbook.label;"
                 sidebarurl="chrome://messenger/content/addressbook/addressbook-panel.xul"
                 oncommand="toggleSidebar('viewAddressbookSidebar');"/>
  </broadcasterset>

  <command id="toggleSidebar" oncommand="SidebarShowHide();"/>
#ifndef XP_MACOSX
  <key id="showHideSidebar"
       keycode="VK_F9"
       command="toggleSidebar"/>
#else
  <key id="showHideSidebar"
       key="&showHideSidebarCmd.key;"
       modifiers="accel,alt"
       command="toggleSidebar"/>
#endif
  <menupopup id="sidebarPopup"
    onpopupshowing="SidebarInitContextMenu(this, document.popupNode);">
    <menuitem id="switch-ctx-item" label="&sidebar.switch.label;"
              accesskey="&sidebar.switch.accesskey;" default="true"
              oncommand="SidebarSelectPanel(document.popupNode,false,false);"/>
    <menuitem id="reload-ctx-item" label="&sidebar.reload.label;"
              accesskey="&sidebar.reload.accesskey;" disabled="true"
              oncommand="SidebarReloadPanel(document.popupNode);"/>
    <menuitem id="stop-ctx-item" label="&sidebar.loading.stop.label;"
              accesskey="&sidebar.loading.stop.accesskey;" disabled="true"
              oncommand="SidebarStopPanelLoad(document.popupNode);"/>
    <menuseparator/>
    <menuitem id="hide-ctx-item" label="&sidebar.hide.label;"
              accesskey="&sidebar.hide.accesskey;"
              oncommand="SidebarTogglePanel(document.popupNode);"/>
    <menuseparator/>
    <menuitem id="customize-ctx-item" label="&sidebar.customize.label;"
              accesskey="&sidebar.customize.accesskey;"
              oncommand="SidebarCustomize();"/>
  </menupopup>

  <!-- Overlay the sidebar panels -->
  <vbox id="sidebar-box" hidden="true" persist="hidden width collapsed">
    <splitter id="sidebar-panels-splitter" collapse="after" persist="state"
      onmouseup="PersistHeight();" hidden="true">
      <grippy/>
    </splitter>
    <vbox id="sidebar-panels-splitter-box" flex="1"
      persist="collapsed">
      <sidebarheader id="sidebar-title-box" class="sidebarheader-main"
        label="&sidebar.panels.label;" persist="hidden" type="box"
        collapse="after" onmouseup="PersistHeight();"
        tooltipopen="&sidebar.open.tooltip;"
        tooltipclose="&sidebar.close.tooltip;">
        <toolbarbutton type="menu" id="sidebar-panel-picker" class="tabbable"
          onpopupshowing="SidebarBuildPickerPopup();"
          label="&sidebar.picker.label;" >
          <menupopup id="sidebar-panel-picker-popup"
            datasources="rdf:null"
            ref="urn:sidebar:current-panel-list"
            oncommand="SidebarTogglePanel(event.target);" >
            <template>
              <rule>
                <conditions>
                  <content uri="?uri"/>
                  <triple subject="?uri"
                    predicate="http://home.netscape.com/NC-rdf#panel-list"
                    object="?panel-list"/>
                  <member container="?panel-list" child="?panel"/>
                  <triple subject="?panel"
                    predicate="http://home.netscape.com/NC-rdf#title"
                    object="?title" />
                </conditions>
                <bindings>
                  <binding subject="?panel"
                    predicate="http://home.netscape.com/NC-rdf#exclude"
                    object="?exclude"/>
                  <binding subject="?panel"
                    predicate="http://home.netscape.com/NC-rdf#prereq"
                    object="?prereq"/>
                </bindings>
                <action>
                  <menuitem uri="?panel" type="checkbox" class="menuitem-sidebar"
                    label="?title" exclude="?exclude" prereq="?prereq"/>
                </action>
              </rule>
            </template>
            <menuitem label="&sidebar.customize.label;" accesskey="&sidebar.customize.accesskey;"
                      oncommand="SidebarCustomize();" />
            <menuitem label="&sidebar.sbDirectory.label;"
                      oncommand="BrowseMorePanels();" />
            <menuseparator />
          </menupopup>
        </toolbarbutton>
        <toolbarbutton id="sidebar-close-button" oncommand="SidebarShowHide();"
                       tooltiptext="&sidebar.close.tooltip;"/>
      </sidebarheader>

      <vbox id="sidebar-panels"
        datasources="rdf:null"
        ref="urn:sidebar:current-panel-list"
        last-selected-panel="urn:sidebar:panel:bookmarks"
        persist="last-selected-panel height collapsed" flex="1"
        onclick="return contentAreaClick(event);">
        <template id="sidebar-template">
          <rule>
            <conditions>
              <content uri="?uri"/>
              <triple subject="?uri" object="?panel-list"
                predicate="http://home.netscape.com/NC-rdf#panel-list" />
              <member container="?panel-list" child="?panel"/>
              <triple subject="?panel" object="?title"
                predicate="http://home.netscape.com/NC-rdf#title" />
              <triple subject="?panel" object="?content"
                predicate="http://home.netscape.com/NC-rdf#content" />
            </conditions>
            <bindings>
              <binding subject="?panel" object="?exclude"
                predicate="http://home.netscape.com/NC-rdf#exclude" />
              <binding subject="?panel" object="?prereq"
                predicate="http://home.netscape.com/NC-rdf#prereq" />
            </bindings>
            <action>
              <hbox uri="?panel" class="box-texttab texttab-sidebar"
                oncommand="SidebarSelectPanel(this,false,false)"
                hidden="true" label="?title" exclude="?exclude"
                prereq="?prereq" context="sidebarPopup"/>
              <vbox uri="?panel" flex="1" hidden="true"
                loadstate="never loaded">
                <vbox flex="1" class="iframe-panel loadarea">
                  <hbox flex="1" align="center">
                    <image class="image-panel-loading"/>
                    <label class="text-panel-loading"
                      value="&sidebar.loading.label;"/>
                    <label class="text-panel-loading" hidden="true"
                      loading="false"
                      value="&sidebar.loadstopped.label;"/>
                    <button type="stop" label="&sidebar.loading.stop.label;"
                            oncommand="SidebarStopPanelLoad(this.parentNode.parentNode.parentNode.previousSibling);"/>
                    <button label="&sidebar.reload.label;" hidden="true"
                            oncommand="SidebarReload();"/>
                  </hbox>
                  <spacer flex="100%"/>
                </vbox>
                <notificationbox flex="1" collapsed="true" class="sidebar-notificationbox browser-notificationbox">
                  <browser flex="1" class="browser-sidebar" src="about:blank"
                           hidden="true" collapsed="true" content="?content"
                           disablehistory="true"/>
                  <browser flex="1" class="browser-sidebar" src="about:blank"
                           hidden="true" collapsed="true" content="?content"
                           type="content" context="contentAreaContextMenu"
                           disablehistory="true" tooltip="aHTMLTooltip"/>
                </notificationbox>
              </vbox>
            </action>
          </rule>
        </template>
        <vbox id="sidebar-iframe-no-panels" class="iframe-panel" flex="1"
          hidden="true">
          <description>&sidebar.no-panels.state;</description>
          <description>&sidebar.no-panels.add;</description>
          <description>&sidebar.no-panels.hide;</description>
        </vbox>
      </vbox>
      <vbox flex="0">
        <hbox id="nav-buttons-box" hidden="true">
          <toolbarbutton flex="1" pack="center"
            class="sidebar-nav-button tab-fwd" onclick="SidebarNavigate(-1);"/>
          <toolbarbutton flex="1" pack="center"
            class="sidebar-nav-button tab-back" onclick="SidebarNavigate(1);"/>
        </hbox>
      </vbox>
    </vbox>
  </vbox>

  <!-- Splitter on the right of sidebar -->
  <splitter id="sidebar-splitter" collapse="before" persist="state hidden"
    class="chromeclass-extrachrome sidebar-splitter" align="center"
    hidden="true" onmouseup="SidebarFinishClick();">
    <grippy class="sidebar-splitter-grippy"
      onclick="SidebarCleanUpExpandCollapse();"/>
  </splitter>

  <!-- View->Sidebar toggle -->
  <menupopup id="menu_View_Popup">
    <menu id="menu_Toolbars">
      <menupopup id="view_toolbars_popup">
        <menuseparator/>
        <menuitem id="sidebar-menu" type="checkbox"
          label="&sidebarCmd.label;"
          accesskey="&sidebarCmd.accesskey;"
          command="toggleSidebar"
          key="showHideSidebar"/>
      </menupopup>
    </menu>
  </menupopup>

  <!-- Scripts go last, because they peek at state to tweak menus -->
  <script src="chrome://communicator/content/sidebar/sidebarOverlay.js"/>

</overlay>