Removing unnecessary attributes, collapsing full screen js into browser.js.

This commit is contained in:
blakeross%telocity.com 2002-08-08 01:55:38 +00:00
Родитель 6eeafa0a3a
Коммит 8a91ee9819
2 изменённых файлов: 62 добавлений и 13 удалений

Просмотреть файл

@ -27,6 +27,7 @@
* Ben Goodger <ben@netscape.com>
* Pierre Chanial <pierrechanial@netscape.net>
* Jason Eager <jce2@po.cwru.edu>
* Joe Hewitt <hewitt@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -3459,3 +3460,58 @@ function BrowserCustomizeToolbar()
{
window.openDialog("chrome://browser/content/customizeToolbar.xul", "Customize Toolbar", "modal,chrome,resizable=yes");
}
var FullScreen =
{
toggle: function()
{
// show/hide all menubars, toolbars, and statusbars (except the full screen toolbar)
this.showXULChrome("menubar", window.fullScreen);
this.showXULChrome("toolbar", window.fullScreen);
this.showXULChrome("statusbar", window.fullScreen);
},
showXULChrome: function(aTag, aShow)
{
var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var els = document.getElementsByTagNameNS(XULNS, aTag);
var i;
for (i = 0; i < els.length; ++i) {
// XXX don't interfere with previously collapsed toolbars
if (els[i].getAttribute("fullscreentoolbar") == "true") {
this.setToolbarButtonMode(els[i], aShow ? "" : "small");
} else {
// use moz-collapsed so it doesn't persist hidden/collapsed,
// so that new windows don't have missing toolbars
if (aShow)
els[i].removeAttribute("moz-collapsed");
else
els[i].setAttribute("moz-collapsed", "true");
}
}
var controls = document.getElementsByAttribute("fullscreencontrol", "true");
for (i = 0; i < controls.length; ++i)
controls[i].hidden = aShow;
},
setToolbarButtonMode: function(aToolbar, aMode)
{
aToolbar.setAttribute("toolbarmode", aMode);
this.setToolbarButtonModeFor(aToolbar, "toolbarbutton", aMode);
this.setToolbarButtonModeFor(aToolbar, "button", aMode);
this.setToolbarButtonModeFor(aToolbar, "textbox", aMode);
},
setToolbarButtonModeFor: function(aToolbar, aTag, aMode)
{
var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var els = aToolbar.getElementsByTagNameNS(XULNS, aTag);
for (var i = 0; i < els.length; ++i) {
els[i].setAttribute("toolbarmode", aMode);
}
}
};

Просмотреть файл

@ -60,7 +60,6 @@ Contributor(s):
<script type="application/x-javascript" src="chrome://global/content/nsClipboard.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://global/content/fullScreen.js"/>
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsBrowserStatusHandler.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsBrowserContentListener.js"/>
@ -152,8 +151,7 @@ Contributor(s):
<command id="Browser:FindAgain" oncommand="BrowserFindAgain();" observes="isImage"/>
<command id="Browser:AddBookmarkAs" oncommand="addBookmarkAs(document.getElementById('content'));"/>
<command id="Browser:ManageBookmark"
oncommand="BrowserEditBookmarks();" />
<command id="Browser:ManageBookmark" oncommand="BrowserEditBookmarks();"/>
<command id="Browser:Home" oncommand="BrowserHome();"/>
<command id="Browser:Back" oncommand="BrowserBack();" observes="canGoBack"/>
@ -163,9 +161,6 @@ Contributor(s):
<broadcaster id="canGoBack" disabled="true"/>
<broadcaster id="canGoForward" disabled="true"/>
<broadcaster id="Communicator:WorkMode"
label="&offlineGoOfflineCmd.label;"
oncommand="toggleOfflineStatus();"/>
<broadcaster id="isImage"/>
<keyset>
@ -342,7 +337,7 @@ Contributor(s):
oncommand="OpenSearch('internet', false, gContextMenu.searchSelected(), true);"/>
<menuseparator id="frame-sep"/>
<menu id="frame" label="&thisFrameMenu.label;" accesskey="&thisFrameMenu.accesskey;">
<menupopup id="frame_popup">
<menupopup>
<menuitem label="&showOnlyThisFrameCmd.label;"
accesskey="&showOnlyThisFrameCmd.accesskey;"
oncommand="gContextMenu.showOnlyThisFrame();"/>
@ -353,8 +348,7 @@ Contributor(s):
accesskey="&openFrameCmdInTab.accesskey;"
oncommand="gContextMenu.openFrameInTab();"/>
<menuseparator/>
<menuitem id="context-reload-frame"
label="&reloadFrameCmd.label;"
<menuitem label="&reloadFrameCmd.label;"
accesskey="&reloadFrameCmd.accesskey;"
oncommand="gContextMenu.reloadFrame();"/>
<menuseparator/>
@ -413,7 +407,7 @@ Contributor(s):
<menuitem id="menu_closeWindow" hidden="true" command="cmd_closeWindow" key="key_closeWindow" label="&closeWindow.label;"/>
<menuseparator/>
<menuitem label="&savePageCmd.label;" accesskey="&savePageCmd.accesskey;" key="key_savePage" command="Browser:SavePage"/>
<menuitem id="savepage" label="&saveFrameCmd.label;" accesskey="&saveFrameCmd.accesskey;" oncommand="saveFrameDocument();" hidden="true"/>
<menuitem label="&saveFrameCmd.label;" accesskey="&saveFrameCmd.accesskey;" oncommand="saveFrameDocument();" hidden="true"/>
<menuseparator/>
<menuitem label="&printSetupCmd.label;" accesskey="&printSetupCmd.accesskey;" oncommand="BrowserPrintSetup();"/>
<menuitem label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;" oncommand="BrowserPrintPreview();"/>
@ -591,7 +585,7 @@ Contributor(s):
<menuitem accesskey="&pageInfoCmd.accesskey;" label="&pageInfoCmd.label;" key="key_viewInfo" command="View:PageInfo"/>
<menuseparator />
<menu label="&applyTheme.label;" accesskey="&applyTheme.accesskey;">
<menupopup id="theme" datasources="rdf:chrome" ref="urn:mozilla:skin:root" oncommand="applyTheme(event.target)" onpopupshowing="checkTheme()">
<menupopup datasources="rdf:chrome" ref="urn:mozilla:skin:root" oncommand="applyTheme(event.target)" onpopupshowing="checkTheme()">
<menuitem label="&themePreferencesCmd.label;" accesskey="&themePreferencesCmd.accesskey;"
oncommand="goPreferences('appearance','chrome://communicator/content/pref/pref-themes.xul', 'themes-panel')"/>
<menuitem label="&getNewThemesCmd.label;" accesskey="&getNewThemesCmd.accesskey;" oncommand="getNewThemes();"/>
@ -940,6 +934,5 @@ Contributor(s):
</statusbarpanel>
<statusbarpanel id="security-button" class="statusbarpanel-iconic"
onclick="displayPageInfo()"/>
</statusbar>
</statusbar>
</window>