gecko-dev/suite/browser/navigator.xul

357 строки
14 KiB
XML

<?xml version="1.0"?> <!-- -*- Mode: HTML -*- -->
<!-- The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s): ______________________________________. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://bookmarks/skin/" type="text/css"?>
<?xul-overlay href="chrome://navigator/content/navigatorOverlay.xul"?>
<?xul-overlay href="chrome://global/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://sidebar/content/sidebarOverlay.xul"?>
<?xml-stylesheet href="chrome://sidebar/skin/sidebarOverlay.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://navigator/locale/navigator.dtd" >
<window id="main-window" xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="Startup()"
onunload="Shutdown()"
title="&mainWindow.title;"
titlemodifier="&mainWindow.titlemodifier;"
titlemenuseparator="&mainWindow.titlemodifiermenuseparator;"
viewsourcetitlepreface="&viewsourcetitle.preface;"
windowtype="navigator:browser"
align="vertical"
width="640" height="480"
x="10" y="10"
persist="width height x y">
<html:script language="javascript" src="chrome://global/content/strres.js" />
<html:script language="javascript" src="navigator.js" />
<html:script language="javascript" src="tooltip.js" />
<!-- broadcasters are appended from the overlay -->
<broadcasterset id="broadcasterset">
<broadcaster id="canReload" value="&reloadCmd.label;" oncommand="BrowserReallyReload(0);"/>
<broadcaster id="canStop"/>
<broadcaster id="canPrint"/>
<broadcaster id="Browser:LoadingProgress"/>
<broadcaster id="Browser:Status"/>
<broadcaster id="Browser:ProtocolIcon" uri=""/>
<broadcaster id="Browser:Throbber" busy="false"/>
<broadcaster id="args" value=""/>
</broadcasterset>
<!-- Interim hack to transition from nsIXULWindowCallbacks/ShowWindowWithArgs -->
<broadcaster id="dialog.start" ready="false"/>
<observes element="dialog.start" attribute="ready" onbroadcast="onLoadWithArgs()"/>
<!-- keys are appended from the overlay -->
<keyset id="keyset"/>
<!-- This needs to go into a xul fragment, but since those don't work now, this stays here !-->
<popupset>
<popup id="aTooltip"
oncreate="return FillInTooltip(document.tooltipElement);">
style="border: thin solid black;">
<titledbutton id="replaceMe" align="left" crop="right" class="borderless"
value="" />
</popup>
</popupset>
<!-- Context menu -->
<popupset>
<!-- This is the skeleton context menu. It is populated and emptied
dynamically, from the template (see below) via the oncreate/ondestroy
handlers.
-->
<popup id="context"
oncreate="BrowserCreateContextMenu(this,event)"
ondestroy="BrowserDestroyContextMenu(this)">
</popup>
<!-- This is the context menu template used to populate the actual
content menu on demand. It holds everything and is whittled down
based on the specific content element that is "context menu-ed."
-->
<popup id="context-template">
<!-- Open ==================================== -->
<menuitem id="template-openlink"
value="&openLinkCmd.label;"
accesskey=""
oncommand="BrowserOpenLink();"/>
<menuitem id="template-editlink"
value="&editLinkCmd.label;"
accesskey=""
oncommand="BrowserEditLink();"/>
<menuitem id="template-openframe"
value="&openFrameCmd.label;"
accesskey=""
oncommand="BrowserOpenFrame();"/>
<menuseparator id="context-sep-open"/>
<!-- Navigation ============================== -->
<menuitem id="template-back"
value="&goBackCmd.label;"
accesskey="&goBackCmd.accesskey;"
oncommand="BrowserBack()"/>
<menuitem id="template-forward"
value="&goForwardCmd.label;"
accesskey="&goForwardCmd.accesskey;"
oncommand="BrowserForward()"/>
<menuitem id="template-reload"
value="&reloadCmd.label;"
accesskey=""
oncommand="BrowserReallyReload(0);"/>
<menuitem id="template-stop"
value="&stopCmd.label;"
accesskey=""
oncommand="BrowserStop();"/>
<menuseparator/>
<!-- View ==================================== -->
<menuitem id="template-viewsource"
value="&viewPageSourceCmd.label;"
accesskey=""
oncommand="BrowserViewSource();"/>
<menuitem id="template-viewframesource"
value="&viewFrameSourceCmd.label;"
accesskey=""
oncommand="BrowserViewFrameSource();"/>
<menuitem id="template-viewinfo"
value="&viewPageInfoCmd.label;"
accesskey=""
oncommand="BrowserViewInfo();"/>
<menuitem id="template-viewframeinfo"
value="&viewFrameInfoCmd.label;"
accesskey=""
oncommand="BrowserViewFrameInfo();"/>
<menuitem id="template-viewimage"
value="&viewImageCmd.label;"
accesskey=""
oncommand="BrowserViewImage();"/>
<menuseparator/>
<!-- Misc ==================================== -->
<menuitem id="template-bookmarkpage"
value="&bookmarkPageCmd.label;"
accesskey="&bookmarkPageCmd.accesskey;"
oncommand="BrowserAddBookmark( window.content.location.href,
window.content.document.title )"/>
<menuitem id="template-sendpage"
value="&sendPageCmd.label;"
accesskey="&sendPageCmd.accesskey;"
oncommand="BrowserSendPage();"/>
<menuseparator/>
<!-- Save ==================================== -->
<menuitem id="template-savepage"
value="&savePageCmd.label;"
accesskey="&savePageCmd.accesskey;"
oncommand="BrowserSavePage();"/>
<menuitem id="template-saveframe"
value="&saveFrameCmd.label;"
accesskey="&saveFrameCmd.accesskey;"
oncommand="BrowserSaveFrame();"/>
<menuitem id="template-savelink"
value="&saveLinkCmd.label;"
accesskey="&saveLinkCmd.accesskey;"
oncommand="BrowserSaveLink();"/>
<menuitem id="template-saveimage"
value="&saveImageCmd.label;"
accesskey="&saveImageCmd.accesskey;"
oncommand="BrowserSaveImage();"/>
<menuitem id="template-savebgimage"
value="&saveBGImageCmd.label;"
accesskey="&saveBGImageCmd.accesskey;"
oncommand="BrowserSaveBGImage();"/>
<menuseparator/>
<!-- Clipboard =============================== -->
<menuitem id="template-selectall"
value="&selectAllCmd.label;"
accesskey="&selectAllCmd.accesskey;"
oncommand="BrowserSelectAll();"/>
<menuitem id="template-copy"
value="&copyCmd.label;"
accesskey="&copyCmd.accesskey;"
oncommand="BrowserCopy();"/>
<menuitem id="template-copylink"
value="&copyLinkCmd.label;"
accesskey="&copyLinkCmd.accesskey;"
oncommand="BrowserCopyLink();"/>
<menuitem id="template-copyimage"
value="&copyImageCmd.label;"
accesskey="&copyImageCmd.accesskey;"
oncommand="BrowserCopyImage();"/>
</popup>
</popupset>
<html:script language="javascript">
var gBookmarkPopup = null;
</html:script>
<toolbox id="main-toolbox">
<!-- Menu -->
<menubar id="main-menubar"/>
<toolbar id="nav-bar" class="main-bar" chromeclass="toolbar" persist="collapsed">
<titledbutton id="back-button" crop="right" flex="1" align="top" value="&backButton.label;" observes="canGoBack" />
<titledbutton id="forward-button" crop="right" flex="1" align="top" value="&forwardButton.label;" observes="canGoForward" />
<!-- Right now only regular reload is supported. When the
functionality is available, look for 'Shift' key pressed state
and pass on appropriate reload type. (The shift functionality
is available. There's a shiftDown field in the event object.)
-->
<titledbutton id="reload-button" crop="right" flex="1" align="top"
value="&reloadButton.label;" observes="canReload"/>
<titledbutton id="stop-button" crop="right" flex="1" align="top"
value="&stopButton.label;" onclick="BrowserStop()">
<observes element="canStop" attribute="disabled"
onbroadcast="BrowserCanStop()"/>
</titledbutton>
<box align="vertical" flex="9999999">
<spring flex="1"/>
<html:input id="urlbar" type="text" chromeclass="location"
onkeyup="if (event.which == 13) { BrowserLoadURL(); }"/>
<spring flex="1"/>
</box>
<titledbutton id="search-button" crop="right" flex="1" align="top"
value="&searchButton.label;" onclick="OpenSearch('internet', document.getElementById('urlbar').value);" />
<titledbutton id="print-button" crop="right" flex="1" align="top"
value="&printButton.label;" onclick="BrowserPrint()">
<observes element="canPrint" attribute="disabled"/>
</titledbutton>
<titledbutton id="Throbber"
onclick="window.content.location.href='&throbber.url;'">
<observes element="Browser:Throbber" attribute="busy"/>
</titledbutton>
</toolbar>
<toolbar class="main-bar" chromeclass="toolbar" persist="collapsed"
datasources="rdf:bookmarks" id="PersonalToolbar"
ref="NC:PersonalToolbarFolder"
ondraggesture="return BeginDragPersonalToolbar(event);"
ondragdrop="return DropPersonalToolbar(event);"
ondragover="return DragOverPersonalToolbar(event);"
onclick="OpenBookmarkURL(event.target, 'PersonalToolbar')">
<!-- This template builds content from the bookmarks datasource -->
<template>
<!-- Rules for content hanging _directly_ off the toolbar -->
<rule parent="toolbar" iscontainer="true">
<menu uri="...">
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Name"
align="left" />
<menupopup />
</menu>
</rule>
<rule parent="toolbar">
<titledbutton uri="..." align="left"
value="rdf:http://home.netscape.com/NC-rdf#Name"/>
</rule>
<!-- Recursive rules for nested folders -->
<rule iscontainer="true">
<menupopup>
<menu uri="..." crop="right" flex="1" align="left"
value="rdf:http://home.netscape.com/NC-rdf#Name" >
<menupopup />
</menu>
</menupopup>
</rule>
<rule>
<menupopup>
<menuitem align="left" uri="..."
value="rdf:http://home.netscape.com/NC-rdf#Name" />
</menupopup>
</rule>
</template>
<titledbutton id="home-button" align="left" flex="1"
value="&homeButton.label;"
defaultURL="&defaultHomepage.url;"
onclick="BrowserHome(); event.preventBubble();"/>
<titledbutton id="netscape-button" crop="right" flex="1" align="left"
value="&netscapeButton.label;"
onclick="window.content.location.href='&myNetscape.url;'; event.preventBubble();"/>
<spring flex="9999999"/>
</toolbar>
</toolbox>
<!-- sidebar/toolbar/content/status -->
<box id="sidebar-parent" align="horizontal" flex="100%">
<!-- toolbar/content/status -->
<box id="sidebar-box" chromeclass="extrachrome"/>
<splitter id="sidebar-splitter" chromeclass="extrachrome" />
<box id="appcontent" align="vertical" flex="100%">
<!-- type attribute is used by frame construction to locate iframes
intended to hold (html) content -->
<!-- id's use is a mystery -->
<box context="context" flex="100%">
<html:iframe type="content-primary" id="content" src="about:blank" flex="100%"/>
</box>
<box align="horizontal" id="status-bar" chromeclass="status">
<titledbutton value="&notifCom.label;" onclick="doTests()"/>
<box id="state-box" align="horizontal" flex="100%">
<box align="vertical" style="width:100px">
<spring flex="100%"/>
<progressmeter id="statusbar-icon" mode="normal"
align="horizontal" value="0" onclick="dumpProgress()">
<observes element="Browser:LoadingProgress" attribute="mode"/>
<observes element="Browser:Throbber" attribute="busy"
onbroadcast="onProgress()"/>
</progressmeter>
<spring flex="100%"/>
</box>
<titledbutton id="statusText" align="left" flex="100%"
value="&statusText.label;"
style="font-family:sans-serif;font-size:2.5mm">
<observes element="Browser:Status" attribute="value"
onbroadcast="onStatus()"/>
</titledbutton>
<titledbutton align="left" value="&buildId.label;"
style="font-family:sans-serif;font-size:2.5mm;"/>
<titledbutton id="protocol-icon" class="borderless" uri="..."
src="" align="left" onclick="onProtocolClick()">
<observes element="Browser:ProtocolIcon" attribute="uri"
onbroadcast="onProtocolChange()"/>
</titledbutton>
</box>
</box><!-- status -->
</box><!-- toolbar/content/status -->
</box><!-- sidebar and tools/content/status -->
<toolbox id="taskbox" chromeclass="extrachrome" />
</window>