зеркало из https://github.com/mozilla/gecko-dev.git
Initial mozilla/browser checkin.
This commit is contained in:
Родитель
f4c63f82da
Коммит
c314b1bd07
|
@ -0,0 +1,198 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://browser/locale/browser.ent">
|
||||
|
||||
<window id="browserWindow"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&browserWindow.title;"
|
||||
width="600" height="400" statusbar="window-statusbar">
|
||||
|
||||
<menubar>
|
||||
<menu label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem label="&fileNewBrowser.label;" accesskey="&fileNewBrowser.accesskey;"/>
|
||||
<menuitem label="&fileNewTab.label;" accesskey="&fileNewTab.accesskey;"/>
|
||||
<menuitem label="&fileOpenLocation.label;" accesskey="&fileOpenLocation.accesskey;"/>
|
||||
<menuitem label="&fileOpenFile.label;" accesskey="&fileOpenFile.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&fileSavePage.label;" accesskey="&fileSavePage.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&filePageSetup.label;" accesskey="&filePageSetup.accesskey;"/>
|
||||
<menuitem label="&filePrintPreview.label;" accesskey="&filePrintPreview.accesskey;"/>
|
||||
<menuitem label="&filePrint.label;" accesskey="&filePrint.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&fileProperties.label;" accesskey="&fileProperties.accesskey;"/>
|
||||
<menuitem label="&fileClose.label;" accesskey="&fileClose.accesskey;"/>
|
||||
<menuitem label="&fileExit.label;" accesskey="&fileExit.accesskey;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu label="&editMenu.label;" accesskey="&editMenu.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem label="&editUndo.label;" accesskey="&editUndo.accesskey;"/>
|
||||
<menuitem label="&editRedo.label;" accesskey="&editRedo.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&editCut.label;" accesskey="&editCut.accesskey;"/>
|
||||
<menuitem label="&editCopy.label;" accesskey="&editCopy.accesskey;"/>
|
||||
<menuitem label="&editPaste.label;" accesskey="&editPaste.accesskey;"/>
|
||||
<menuitem label="&editDelete.label;" accesskey="&editDelete.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&editSelectAll.label;" accesskey="&editSelectAll.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&editFindPage.label;" accesskey="&editFindPage.accesskey;"/>
|
||||
<menuitem label="&editFindAgain.label;" accesskey="&editFindAgain.accesskey;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu label="&viewMenu.label;" accesskey="&viewMenu.accesskey;">
|
||||
<menupopup>
|
||||
<menu label="&viewToolbars.label;" accesskey="&viewToolbars.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem label="&viewToolbarsCommand.label;" accesskey="&viewToolbarsCommand.accesskey;"/>
|
||||
<menuitem label="&viewToolbarsLocation.label;" accesskey="&viewToolbarsLocation.accesskey;"/>
|
||||
<menuitem label="&viewToolbarsPersonal.label;" accesskey="&viewToolbarsPersonal.label;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&viewToolbarsStatus.label;" accesskey="&viewToolbarsStatus.label;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuitem label="&viewSidebar.label;" accesskey="&viewSidebar.accesskey;"/>
|
||||
<menuitem label="&viewFullScreen.label;" accesskey="&viewFullScreen.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menu label="&viewTextZoom.label;" accesskey="&viewTextZoom.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem label="&viewTextZoomSmaller.label;" accesskey="&viewTextZoomSmaller.accesskey;"/>
|
||||
<menuitem label="&viewTextZoomLarger.label;" accesskey="&viewTextZoomLarger.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&viewTextZoom50Pc.label;" accesskey="&viewTextZoom50Pc.accesskey;"/>
|
||||
<menuitem label="&viewTextZoom75Pc.label;" accesskey="&viewTextZoom75Pc.accesskey;"/>
|
||||
<menuitem label="&viewTextZoom90Pc.label;" accesskey="&viewTextZoom90Pc.accesskey;"/>
|
||||
<menuitem label="&viewTextZoom100Pc.label;" accesskey="&viewTextZoom100Pc.accesskey;"/>
|
||||
<menuitem label="&viewTextZoom125Pc.label;" accesskey="&viewTextZoom125Pc.accesskey;"/>
|
||||
<menuitem label="&viewTextZoom150Pc.label;" accesskey="&viewTextZoom150Pc.accesskey;"/>
|
||||
<menuitem label="&viewTextZoom200Pc.label;" accesskey="&viewTextZoom200Pc.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&viewTextZoomOther.label;" accesskey="&viewTextZoomOther.accesskey;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu label="&viewStylesheet.label;" accesskey="&viewStylesheet.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem label="&viewStylesheetDefault.label;" accesskey="&viewStylesheetDefault.accesskey;"/>
|
||||
<menuitem label="&viewStylesheetSummer.label;" accesskey="&viewStylesheetSummer.accesskey;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<menuitem label="&viewStop.label;" accesskey="&viewStop.accesskey;"/>
|
||||
<menuitem label="&viewReload.label;" accesskey="&viewReload.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&viewSource.label;" accesskey="&viewSource.accesskey;"/>
|
||||
<menuitem label="&viewTranslate.label;" accesskey="&viewTranslate.accesskey;"/>
|
||||
<menu label="&viewEncoding.label;" accesskey="&viewEncoding.accesskey;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu label="&bookmarksMenu.label;" accesskey="&bookmarksMenu.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem label="&bookmarksAdd.label;" accesskey="&bookmarksAdd.accesskey;"/>
|
||||
<menuitem label="&bookmarksManage.label;" accesskey="&bookmarksManage.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
<menuitem label="&bookmarksSampleBookmark.label;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu label="&toolsMenu.label;" accesskey="&toolsMenu.accesskey;">
|
||||
<menupopup>
|
||||
<menu label="&toolsMailNews.label;" accesskey="&toolsMailNews.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem label="&toolsMailNewsReadMail.label;" accesskey="&toolsMailNewsReadMail.accesskey;"/>
|
||||
<menuitem label="&toolsMailNewsNewMessage.label;" accesskey="&toolsMailNewsNewMessage.accesskey;"/>
|
||||
<menuitem label="&toolsMailNewsSendLink.label;" accesskey="&toolsMailNewsSendLink.accesskey;"/>
|
||||
<menuitem label="&toolsMailNewsSendPage.label;" accesskey="&toolsMailNewsSendPage.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&toolsMailNewsReadNews.label;" accesskey="&toolsMailNewsReadNews.accesskey;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuitem label="&toolsHistory.label;" accesskey="&toolsHistory.accesskey;"/>
|
||||
<menuitem label="&toolsDownloadManager.label;" accesskey="&toolsDownloadManager.accesskey;"/>
|
||||
<menuitem label="&toolsErrorConsole.label;" accesskey="&toolsErrorConsole.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&toolsOptions.label;" accesskey="&toolsOptions.accesskey;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem label="&helpContentsAndIndex.label;" accesskey="&helpContentsAndIndex.accesskey;"/>
|
||||
<menuitem label="&helpTipOfTheDay.label;" accesskey="&helpTipOfTheDay.accesskey;"/>
|
||||
<menuitem label="&helpForNetscapeUsers.label;" accesskey="&helpForNetscapeUsers.accesskey;"/>
|
||||
<menuitem label="&helpForIEUsers.label;" accesskey="&helpForIEUsers.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&helpSendFeedback.label;" accesskey="&helpSendFeedback.accesskey;"/>
|
||||
<menuitem label="&helpNeutronOnline.label;" accesskey="&helpNeutronOnline.accesskey;"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&helpAboutNeutron.label;" accesskey="&helpAboutNeutron.accesskey;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<toolbox>
|
||||
<toolbar>
|
||||
<toolbarbutton id="back-button" type="menu-button" class="toolbarbutton-1"
|
||||
label="&toolbarBack.label;" tooltiptext="&toolbarBack.tooltip;"/>
|
||||
<toolbarbutton id="forward-button" type="menu-button" class="toolbarbutton-1"
|
||||
label="&toolbarForward.label;" tooltiptext="&toolbarForward.tooltip;"/>
|
||||
<toolbarbutton id="reload-button" class="toolbarbutton-1"
|
||||
label="&toolbarReload.label;" tooltiptext="&toolbarReload.tooltip;"/>
|
||||
<toolbarbutton id="stop-button" class="toolbarbutton-1"
|
||||
label="&toolbarStop.label;" tooltiptext="&toolbarStop.tooltip;"/>
|
||||
<toolbarseparator/>
|
||||
<toolbarbutton id="bookmarks-button" class="toolbarbutton-1"
|
||||
label="&toolbarBookmarks.label;" tooltiptext="&toolbarBookmarks.tooltip;"/>
|
||||
<toolbarbutton id="search-button" class="toolbarbutton-1"
|
||||
label="&toolbarSearch.label;" tooltiptext="&toolbarSearch.tooltip;"/>
|
||||
<toolbarbutton id="history-button" class="toolbarbutton-1"
|
||||
label="&toolbarHistory.label;" tooltiptext="&toolbarHistory.tooltip;"/>
|
||||
<toolbarseparator/>
|
||||
<toolbarbutton id="mail-button" type="menu-button" class="toolbarbutton-1"
|
||||
label="&toolbarMail.label;" tooltiptext="&toolbarMail.tooltip;"/>
|
||||
<spring flex="1"/>
|
||||
<throbber/>
|
||||
</toolbar>
|
||||
<toolbar>
|
||||
<label>&toolbarLocation.label;</label>
|
||||
<location-bar flex="1"/>
|
||||
<toolbarbutton id="go-button" class="toolbarbutton-2"
|
||||
label="&toolbarGo.label;" tooltiptext="&toolbarGo.tooltip;"/>
|
||||
</toolbar>
|
||||
<bookmarks-toolbar/>
|
||||
</toolbox>
|
||||
|
||||
<browser src="http://www.silverstone.net.nz/" flex="1"/>
|
||||
|
||||
<statusbar id="window-statusbar">
|
||||
<statusbarpanel label="Document: Done" flex="1"/>
|
||||
</statusbar>
|
||||
|
||||
</window>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:browser"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- package information -->
|
||||
<RDF:Description about="urn:mozilla:package:browser"
|
||||
chrome:displayName="Mozilla Browser"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="browser"
|
||||
chrome:localeVersion="0.9.9">
|
||||
</RDF:Description>
|
||||
|
||||
</RDF:RDF>
|
|
@ -0,0 +1,389 @@
|
|||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Blake Ross <blakeross@telocity.com>
|
||||
* Peter Annema <disttsc@bart.nl>
|
||||
*
|
||||
* 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
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const NS_ERROR_MODULE_NETWORK = 2152398848;
|
||||
const NS_NET_STATUS_READ_FROM = NS_ERROR_MODULE_NETWORK + 8;
|
||||
const NS_NET_STATUS_WROTE_TO = NS_ERROR_MODULE_NETWORK + 9;
|
||||
|
||||
|
||||
function nsBrowserStatusHandler()
|
||||
{
|
||||
this.init();
|
||||
}
|
||||
|
||||
nsBrowserStatusHandler.prototype =
|
||||
{
|
||||
userTyped :
|
||||
{
|
||||
_value : false,
|
||||
browser : null,
|
||||
|
||||
get value() {
|
||||
if (this.browser != getBrowser().mCurrentBrowser)
|
||||
this._value = false;
|
||||
|
||||
return this._value;
|
||||
},
|
||||
|
||||
set value(aValue) {
|
||||
if (this._value != aValue) {
|
||||
this._value = aValue;
|
||||
this.browser = aValue ? getBrowser().mCurrentBrowser : null;
|
||||
}
|
||||
|
||||
return aValue;
|
||||
}
|
||||
},
|
||||
|
||||
useRealProgressFlag : false,
|
||||
totalRequests : 0,
|
||||
finishedRequests : 0,
|
||||
|
||||
// Stored Status, Link and Loading values
|
||||
status : "",
|
||||
defaultStatus : "",
|
||||
jsStatus : "",
|
||||
jsDefaultStatus : "",
|
||||
overLink : "",
|
||||
startTime : 0,
|
||||
|
||||
statusTimeoutInEffect : false,
|
||||
|
||||
hideAboutBlank : true,
|
||||
|
||||
QueryInterface : function(aIID)
|
||||
{
|
||||
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
|
||||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
|
||||
aIID.equals(Components.interfaces.nsIXULBrowserWindow) ||
|
||||
aIID.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
},
|
||||
|
||||
init : function()
|
||||
{
|
||||
// XXXjag is this still needed? It's currently just ""
|
||||
this.defaultStatus = gNavigatorBundle.getString("defaultStatus");
|
||||
|
||||
this.urlBar = document.getElementById("urlbar");
|
||||
this.throbberElement = document.getElementById("navigator-throbber");
|
||||
this.statusMeter = document.getElementById("statusbar-icon");
|
||||
this.stopButton = document.getElementById("stop-button");
|
||||
this.stopMenu = document.getElementById("menuitem-stop");
|
||||
this.stopContext = document.getElementById("context-stop");
|
||||
this.statusTextField = document.getElementById("statusbar-display");
|
||||
this.isImage = document.getElementById("isImage");
|
||||
|
||||
},
|
||||
|
||||
destroy : function()
|
||||
{
|
||||
// XXXjag to avoid leaks :-/, see bug 60729
|
||||
this.urlBar = null;
|
||||
this.throbberElement = null;
|
||||
this.statusMeter = null;
|
||||
this.stopButton = null;
|
||||
this.stopMenu = null;
|
||||
this.stopContext = null;
|
||||
this.statusTextField = null;
|
||||
this.isImage = null;
|
||||
this.userTyped = null;
|
||||
},
|
||||
|
||||
setJSStatus : function(status)
|
||||
{
|
||||
this.jsStatus = status;
|
||||
this.updateStatusField();
|
||||
},
|
||||
|
||||
setJSDefaultStatus : function(status)
|
||||
{
|
||||
this.jsDefaultStatus = status;
|
||||
this.updateStatusField();
|
||||
},
|
||||
|
||||
setDefaultStatus : function(status)
|
||||
{
|
||||
this.defaultStatus = status;
|
||||
this.updateStatusField();
|
||||
},
|
||||
|
||||
setOverLink : function(link, b)
|
||||
{
|
||||
this.overLink = link;
|
||||
this.updateStatusField();
|
||||
if (link)
|
||||
this.statusTextField.setAttribute('crop', 'center');
|
||||
else
|
||||
this.statusTextField.setAttribute('crop', 'end');
|
||||
},
|
||||
|
||||
updateStatusField : function()
|
||||
{
|
||||
var text = this.overLink || this.status || this.jsStatus || this.jsDefaultStatus || this.defaultStatus;
|
||||
|
||||
// check the current value so we don't trigger an attribute change
|
||||
// and cause needless (slow!) UI updates
|
||||
if (this.statusTextField.label != text) {
|
||||
this.statusTextField.label = text;
|
||||
}
|
||||
},
|
||||
|
||||
onLinkIconAvailable : function(aHref) {
|
||||
if (gProxyFavIcon && pref.getBoolPref("browser.chrome.site_icons"))
|
||||
{
|
||||
gProxyFavIcon.setAttribute("src", aHref);
|
||||
|
||||
// update any bookmarks with new icon reference
|
||||
if (!gBookmarksService)
|
||||
gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"]
|
||||
.getService(Components.interfaces.nsIBookmarksService);
|
||||
gBookmarksService.updateBookmarkIcon(this.urlBar.value, aHref);
|
||||
}
|
||||
},
|
||||
|
||||
onProgressChange : function (aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress)
|
||||
{
|
||||
if (!this.useRealProgressFlag && aRequest)
|
||||
return;
|
||||
|
||||
if (aMaxTotalProgress > 0) {
|
||||
// This is highly optimized. Don't touch this code unless
|
||||
// you are intimately familiar with the cost of setting
|
||||
// attrs on XUL elements. -- hyatt
|
||||
var percentage = (aCurTotalProgress * 100) / aMaxTotalProgress;
|
||||
this.statusMeter.value = percentage;
|
||||
}
|
||||
},
|
||||
|
||||
onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus)
|
||||
{
|
||||
//ignore local/resource:/chrome: files
|
||||
if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO)
|
||||
return;
|
||||
|
||||
const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
|
||||
const nsIChannel = Components.interfaces.nsIChannel;
|
||||
var ctype;
|
||||
if (aStateFlags & nsIWebProgressListener.STATE_START) {
|
||||
if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
|
||||
// Remember when loading commenced.
|
||||
this.startTime = (new Date()).getTime();
|
||||
|
||||
if (aRequest && aWebProgress.DOMWindow == content)
|
||||
this.startDocumentLoad(aRequest);
|
||||
|
||||
// Turn the throbber on.
|
||||
this.throbberElement.setAttribute("busy", true);
|
||||
|
||||
// XXX: These need to be based on window activity...
|
||||
this.stopButton.disabled = false;
|
||||
this.stopMenu.removeAttribute('disabled');
|
||||
this.stopContext.removeAttribute('disabled');
|
||||
this.isImage.removeAttribute('disabled');
|
||||
|
||||
// Initialize the progress stuff...
|
||||
this.useRealProgressFlag = false;
|
||||
this.totalRequests = 0;
|
||||
this.finishedRequests = 0;
|
||||
}
|
||||
|
||||
if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) {
|
||||
this.totalRequests += 1;
|
||||
}
|
||||
}
|
||||
else if (aStateFlags & nsIWebProgressListener.STATE_STOP) {
|
||||
if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) {
|
||||
this.finishedRequests += 1;
|
||||
if (!this.useRealProgressFlag)
|
||||
this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests);
|
||||
}
|
||||
if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
|
||||
if (aRequest) {
|
||||
if (aWebProgress.DOMWindow == content)
|
||||
this.endDocumentLoad(aRequest, aStatus);
|
||||
|
||||
var location = aRequest.QueryInterface(nsIChannel).URI.spec;
|
||||
var msg = "";
|
||||
if (location != "about:blank") {
|
||||
// Record page loading time.
|
||||
var elapsed = ((new Date()).getTime() - this.startTime) / 1000;
|
||||
msg = gNavigatorBundle.getString("nv_done");
|
||||
msg = msg.replace(/%elapsed%/, elapsed);
|
||||
}
|
||||
this.status = "";
|
||||
this.setDefaultStatus(msg);
|
||||
try {
|
||||
ctype = aRequest.QueryInterface(nsIChannel).contentType;
|
||||
if (ctype.match(/^image\//))
|
||||
this.isImage.setAttribute('disabled', 'true');
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
|
||||
// Turn the progress meter and throbber off.
|
||||
this.statusMeter.value = 0; // be sure to clear the progress bar
|
||||
this.throbberElement.removeAttribute("busy");
|
||||
|
||||
// XXX: These need to be based on window activity...
|
||||
// XXXjag: <command id="cmd_stop"/> ?
|
||||
this.stopButton.disabled = true;
|
||||
this.stopMenu.setAttribute('disabled', 'true');
|
||||
this.stopContext.setAttribute('disabled', 'true');
|
||||
|
||||
}
|
||||
}
|
||||
else if (aStateFlags & nsIWebProgressListener.STATE_TRANSFERRING) {
|
||||
if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) {
|
||||
ctype = aRequest.QueryInterface(nsIChannel).contentType;
|
||||
|
||||
if (ctype != "text/html")
|
||||
this.useRealProgressFlag = true;
|
||||
}
|
||||
|
||||
if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) {
|
||||
if (!this.useRealProgressFlag)
|
||||
this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onLocationChange : function(aWebProgress, aRequest, aLocation)
|
||||
{
|
||||
this.setOverLink("", null);
|
||||
|
||||
var location = aLocation.spec;
|
||||
|
||||
if (this.hideAboutBlank) {
|
||||
this.hideAboutBlank = false;
|
||||
if (location == "about:blank")
|
||||
location = "";
|
||||
}
|
||||
|
||||
// We should probably not do this if the value has changed since the user
|
||||
// searched
|
||||
// Update urlbar only if a new page was loaded on the primary content area
|
||||
// Do not update urlbar if there was a subframe navigation
|
||||
|
||||
if (aWebProgress.DOMWindow == content) {
|
||||
if (!this.userTyped.value) {
|
||||
// If the url has "wyciwyg://" as the protocol, strip it off.
|
||||
// Nobody wants to see it on the urlbar for dynamically generated
|
||||
// pages.
|
||||
if (/^\s*wyciwyg:\/\/\d+\//.test(location))
|
||||
location = RegExp.rightContext;
|
||||
this.urlBar.value = location;
|
||||
// the above causes userTyped.value to become true, reset it
|
||||
this.userTyped.value = false;
|
||||
}
|
||||
|
||||
SetPageProxyState("valid", aLocation);
|
||||
}
|
||||
UpdateBackForwardButtons();
|
||||
},
|
||||
|
||||
onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage)
|
||||
{
|
||||
//ignore local/resource:/chrome: files
|
||||
if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO)
|
||||
return;
|
||||
|
||||
this.status = aMessage;
|
||||
|
||||
if (!this.statusTimeoutInEffect) {
|
||||
this.statusTimeoutInEffect = true;
|
||||
this.updateStatusField();
|
||||
setTimeout(function(aClosure) { aClosure.updateStatusField();
|
||||
aClosure.statusTimeoutInEffect = false; },
|
||||
400, this);
|
||||
}
|
||||
},
|
||||
|
||||
onSecurityChange : function(aWebProgress, aRequest, aState)
|
||||
{
|
||||
},
|
||||
|
||||
startDocumentLoad : function(aRequest)
|
||||
{
|
||||
// Reset so we can see if the user typed after the document load
|
||||
// starting and the location changing.
|
||||
this.userTyped.value = false;
|
||||
|
||||
const nsIChannel = Components.interfaces.nsIChannel;
|
||||
var urlStr = aRequest.QueryInterface(nsIChannel).URI.spec;
|
||||
var observerService = Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
try {
|
||||
observerService.notifyObservers(_content, "StartDocumentLoad", urlStr);
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
|
||||
endDocumentLoad : function(aRequest, aStatus)
|
||||
{
|
||||
const nsIChannel = Components.interfaces.nsIChannel;
|
||||
var urlStr = aRequest.QueryInterface(nsIChannel).originalURI.spec;
|
||||
|
||||
if (Components.isSuccessCode(aStatus))
|
||||
dump("Document "+urlStr+" loaded successfully\n"); // per QA request
|
||||
else {
|
||||
// per QA request
|
||||
var e = new Components.Exception("", aStatus);
|
||||
var name = e.name;
|
||||
dump("Error loading URL "+urlStr+" : "+
|
||||
Number(aStatus).toString(16));
|
||||
if (name)
|
||||
dump(" ("+name+")");
|
||||
dump('\n');
|
||||
}
|
||||
|
||||
var observerService = Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
|
||||
var notification = Components.isSuccessCode(aStatus) ? "EndDocumentLoad" : "FailDocumentLoad";
|
||||
try {
|
||||
observerService.notifyObservers(_content, notification, urlStr);
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
browser.jar:
|
||||
content/browser/contents.rdf (content/contents.rdf)
|
||||
content/browser/browser.xul (content/browser.xul)
|
||||
locale/browser/contents.rdf (locale/contents.rdf)
|
||||
locale/browser/browser.ent (locale/browser.ent)
|
||||
|
|
@ -0,0 +1,235 @@
|
|||
<!-- ============================================================================================ -->
|
||||
<!-- Browser Window ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
<!-- ============================================================================================ -->
|
||||
|
||||
<!ENTITY browserWindow.title "Neutron">
|
||||
|
||||
|
||||
<!-- ============================================================================================ -->
|
||||
<!-- File Menu :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
<!-- ============================================================================================ -->
|
||||
<!ENTITY fileMenu.label "File">
|
||||
<!ENTITY fileMenu.accesskey "f">
|
||||
|
||||
<!ENTITY fileNewBrowser.label "New Window">
|
||||
<!ENTITY fileNewBrowser.accesskey "n">
|
||||
<!ENTITY fileNewTab.label "New Tab">
|
||||
<!ENTITY fileNewTab.accesskey "t">
|
||||
<!ENTITY fileOpenLocation.label "Open Location...">
|
||||
<!ENTITY fileOpenLocation.accesskey "l">
|
||||
<!ENTITY fileOpenFile.label "Open File...">
|
||||
<!ENTITY fileOpenFile.accesskey "f">
|
||||
|
||||
<!ENTITY fileSavePage.label "Save As...">
|
||||
<!ENTITY fileSavePage.accesskey "s">
|
||||
|
||||
<!ENTITY filePageSetup.label "Page Setup">
|
||||
<!ENTITY filePageSetup.accesskey "u">
|
||||
<!ENTITY filePrintPreview.label "Print Preview">
|
||||
<!ENTITY filePrintPreview.accesskey "v">
|
||||
<!ENTITY filePrint.label "Print...">
|
||||
<!ENTITY filePrint.accesskey "p">
|
||||
|
||||
<!ENTITY fileProperties.label "Properties">
|
||||
<!ENTITY fileProperties.accesskey "i">
|
||||
<!ENTITY fileClose.label "Close">
|
||||
<!ENTITY fileClose.accesskey "c">
|
||||
<!ENTITY fileExit.label "Exit">
|
||||
<!ENTITY fileExit.accesskey "x">
|
||||
|
||||
<!-- ============================================================================================ -->
|
||||
<!-- Edit Menu :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
<!-- ============================================================================================ -->
|
||||
<!ENTITY editMenu.label "Edit">
|
||||
<!ENTITY editMenu.accesskey "e">
|
||||
|
||||
<!ENTITY editUndo.label "Undo">
|
||||
<!ENTITY editUndo.accesskey "u">
|
||||
<!ENTITY editRedo.label "Redo">
|
||||
<!ENTITY editRedo.accesskey "r">
|
||||
|
||||
<!ENTITY editCut.label "Cut">
|
||||
<!ENTITY editCut.accesskey "t">
|
||||
<!ENTITY editCopy.label "Copy">
|
||||
<!ENTITY editCopy.accesskey "c">
|
||||
<!ENTITY editPaste.label "Paste">
|
||||
<!ENTITY editPaste.accesskey "p">
|
||||
<!ENTITY editDelete.label "Delete">
|
||||
<!ENTITY editDelete.accesskey "d">
|
||||
|
||||
<!ENTITY editSelectAll.label "Select All">
|
||||
<!ENTITY editSelectAll.accesskey "a">
|
||||
|
||||
<!ENTITY editFindPage.label "Find in Page...">
|
||||
<!ENTITY editFindPage.accesskey "f">
|
||||
<!ENTITY editFindAgain.label "Find Again">
|
||||
<!ENTITY editFindAgain.accesskey "g">
|
||||
|
||||
<!-- ============================================================================================ -->
|
||||
<!-- View Menu :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
<!-- ============================================================================================ -->
|
||||
<!ENTITY viewMenu.label "View">
|
||||
<!ENTITY viewMenu.accesskey "v">
|
||||
|
||||
<!ENTITY viewToolbars.label "Toolbars">
|
||||
<!ENTITY viewToolbars.accesskey "t">
|
||||
|
||||
<!ENTITY viewToolbarsCommand.label "Command">
|
||||
<!ENTITY viewToolbarsCommand.accesskey "c">
|
||||
<!ENTITY viewToolbarsLocation.label "Location">
|
||||
<!ENTITY viewToolbarsLocation.accesskey "l">
|
||||
<!ENTITY viewToolbarsPersonal.label "Bookmarks">
|
||||
<!ENTITY viewToolbarsPersonal.accesskey "b">
|
||||
|
||||
<!ENTITY viewToolbarsStatus.label "Status bar">
|
||||
<!ENTITY viewToolbarsStatus.accesskey "s">
|
||||
|
||||
<!ENTITY viewSidebar.label "Sidebar">
|
||||
<!ENTITY viewSidebar.accesskey "s">
|
||||
<!ENTITY viewFullScreen.label "Full Screen">
|
||||
<!ENTITY viewFullScreen.accesskey "f">
|
||||
|
||||
<!ENTITY viewTextZoom.label "Text Zoom (125)">
|
||||
<!ENTITY viewTextZoom.accesskey "z">
|
||||
|
||||
<!ENTITY viewTextZoomSmaller.label "Smaller">
|
||||
<!ENTITY viewTextZoomSmaller.accesskey "s">
|
||||
<!ENTITY viewTextZoomLarger.label "Larger">
|
||||
<!ENTITY viewTextZoomLarger.accesskey "l">
|
||||
|
||||
<!ENTITY viewTextZoom50Pc.label "50">
|
||||
<!ENTITY viewTextZoom50Pc.accesskey "5">
|
||||
<!ENTITY viewTextZoom75Pc.label "75">
|
||||
<!ENTITY viewTextZoom75Pc.accesskey "7">
|
||||
<!ENTITY viewTextZoom90Pc.label "90">
|
||||
<!ENTITY viewTextZoom90Pc.accesskey "9">
|
||||
<!ENTITY viewTextZoom100Pc.label "100 (Original Size)">
|
||||
<!ENTITY viewTextZoom100Pc.accesskey "z">
|
||||
<!ENTITY viewTextZoom125Pc.label "125">
|
||||
<!ENTITY viewTextZoom125Pc.accesskey "1">
|
||||
<!ENTITY viewTextZoom150Pc.label "150">
|
||||
<!ENTITY viewTextZoom150Pc.accesskey "0">
|
||||
<!ENTITY viewTextZoom200Pc.label "200">
|
||||
<!ENTITY viewTextZoom200Pc.accesskey "2">
|
||||
|
||||
<!ENTITY viewTextZoomOther.label "Other (300)...">
|
||||
<!ENTITY viewTextZoomOther.accesskey "o">
|
||||
|
||||
<!ENTITY viewStylesheet.label "Use Style Sheet">
|
||||
<!ENTITY viewStylesheet.accesskey "u">
|
||||
|
||||
<!ENTITY viewStylesheetDefault.label "Default">
|
||||
<!ENTITY viewStylesheetDefault.accesskey "d">
|
||||
<!ENTITY viewStylesheetSummer.label "Summer">
|
||||
<!ENTITY viewStylesheetSummer.accesskey "s">
|
||||
|
||||
<!ENTITY viewStop.label "Stop">
|
||||
<!ENTITY viewStop.accesskey "s">
|
||||
<!ENTITY viewReload.label "Reload">
|
||||
<!ENTITY viewReload.accesskey "r">
|
||||
|
||||
<!ENTITY viewSource.label "Source">
|
||||
<!ENTITY viewSource.accesskey "o">
|
||||
<!ENTITY viewTranslate.label "Translate...">
|
||||
<!ENTITY viewTranslate.accesskey "l">
|
||||
<!ENTITY viewEncoding.label "Encoding">
|
||||
<!ENTITY viewEncoding.accesskey "e">
|
||||
|
||||
<!-- ============================================================================================ -->
|
||||
<!-- Bookmarks Menu ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
<!-- ============================================================================================ -->
|
||||
<!ENTITY bookmarksMenu.label "Bookmarks">
|
||||
<!ENTITY bookmarksMenu.accesskey "b">
|
||||
|
||||
<!ENTITY bookmarksAdd.label "Add Bookmark...">
|
||||
<!ENTITY bookmarksAdd.accesskey "a">
|
||||
<!ENTITY bookmarksManage.label "Manage Bookmarks">
|
||||
<!ENTITY bookmarksManage.accesskey "m">
|
||||
|
||||
<!ENTITY bookmarksSampleBookmark.label "Sample Bookmark">
|
||||
|
||||
<!-- ============================================================================================ -->
|
||||
<!-- Tools Menu ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
<!-- ============================================================================================ -->
|
||||
<!ENTITY toolsMenu.label "Tools">
|
||||
<!ENTITY toolsMenu.accesskey "t">
|
||||
|
||||
<!ENTITY toolsMailNews.label "Mail & News">
|
||||
<!ENTITY toolsMailNews.accesskey "m">
|
||||
|
||||
<!ENTITY toolsMailNewsReadMail.label "Read Mail">
|
||||
<!ENTITY toolsMailNewsReadMail.accesskey "r">
|
||||
<!ENTITY toolsMailNewsNewMessage.label "New Message...">
|
||||
<!ENTITY toolsMailNewsNewMessage.accesskey "m">
|
||||
<!ENTITY toolsMailNewsSendLink.label "Send Link to Current Page...">
|
||||
<!ENTITY toolsMailNewsSendLink.accesskey "l">
|
||||
<!ENTITY toolsMailNewsSendPage.label "Send Current Page...">
|
||||
<!ENTITY toolsMailNewsSendPage.accesskey "p">
|
||||
|
||||
<!ENTITY toolsMailNewsReadNews.label "Read News">
|
||||
<!ENTITY toolsMailNewsReadNews.accesskey "n">
|
||||
|
||||
<!ENTITY toolsHistory.label "Browsing History">
|
||||
<!ENTITY toolsHistory.accesskey "h">
|
||||
<!ENTITY toolsDownloadManager.label "Downloaded Files">
|
||||
<!ENTITY toolsDownloadManager.accesskey "d">
|
||||
<!ENTITY toolsErrorConsole.label "Error Console">
|
||||
<!ENTITY toolsErrorConsole.accesskey "c">
|
||||
|
||||
<!ENTITY toolsOptions.label "Options">
|
||||
<!ENTITY toolsOptions.accesskey "o">
|
||||
|
||||
<!-- ============================================================================================ -->
|
||||
<!-- Help Menu :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
<!-- ============================================================================================ -->
|
||||
<!ENTITY helpMenu.label "Help">
|
||||
<!ENTITY helpMenu.accesskey "h">
|
||||
|
||||
<!ENTITY helpContentsAndIndex.label "Contents and Index">
|
||||
<!ENTITY helpContentsAndIndex.accesskey "c">
|
||||
<!ENTITY helpTipOfTheDay.label "Tip of the Day">
|
||||
<!ENTITY helpTipOfTheDay.accesskey "t">
|
||||
<!ENTITY helpForNetscapeUsers.label "For Netscape Users">
|
||||
<!ENTITY helpForNetscapeUsers.accesskey "n">
|
||||
<!ENTITY helpForIEUsers.label "For Internet Explorer Users">
|
||||
<!ENTITY helpForIEUsers.accesskey "i">
|
||||
|
||||
<!ENTITY helpSendFeedback.label "Send Feedback...">
|
||||
<!ENTITY helpSendFeedback.accesskey "f">
|
||||
<!ENTITY helpNeutronOnline.label "Neutron Online">
|
||||
<!ENTITY helpNeutronOnline.accesskey "o">
|
||||
|
||||
<!ENTITY helpAboutNeutron.label "About Neutron...">
|
||||
<!ENTITY helpAboutNeutron.accesskey "a">
|
||||
|
||||
<!-- ============================================================================================ -->
|
||||
<!-- Command Toolbar :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
<!-- ============================================================================================ -->
|
||||
<!ENTITY toolbarBack.label "Back">
|
||||
<!ENTITY toolbarBack.tooltip "Go back to PAGE_TITLE">
|
||||
<!ENTITY toolbarForward.label "Forward">
|
||||
<!ENTITY toolbarForward.tooltip "Go forward to PAGE_TITLE">
|
||||
<!ENTITY toolbarReload.label "Reload">
|
||||
<!ENTITY toolbarReload.tooltip "Reload the Current Page">
|
||||
<!ENTITY toolbarStop.label "Stop">
|
||||
<!ENTITY toolbarStop.tooltip "Stop Load the Current Page">
|
||||
<!ENTITY toolbarHome.label "Home">
|
||||
<!ENTITY toolbarHome.tooltip "Go to the Home Page">
|
||||
|
||||
<!ENTITY toolbarBookmarks.label "Bookmarks">
|
||||
<!ENTITY toolbarBookmarks.tooltip "Open Bookmarks Panel">
|
||||
<!ENTITY toolbarSearch.label "Search">
|
||||
<!ENTITY toolbarSearch.tooltip "Open Search Panel">
|
||||
<!ENTITY toolbarHistory.label "History">
|
||||
<!ENTITY toolbarHistory.tooltip "Open History Panel">
|
||||
|
||||
<!ENTITY toolbarMail.label "Mail">
|
||||
<!ENTITY toolbarMail.tooltip "Mail">
|
||||
|
||||
<!-- ============================================================================================ -->
|
||||
<!-- Command Toolbar :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
<!-- ============================================================================================ -->
|
||||
<!ENTITY toolbarLocation.label "Location:">
|
||||
<!ENTITY toolbarGo.label "Go">
|
||||
<!ENTITY toolbarGo.tooltip "Go to PAGE_URL">
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the locales being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:locale:root">
|
||||
<RDF:li resource="urn:mozilla:locale:en-US"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- locale information -->
|
||||
<RDF:Description about="urn:mozilla:locale:en-US"
|
||||
chrome:displayName="English (US)"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="en-US">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
|
||||
<RDF:li resource="urn:mozilla:locale:en-US:browser"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
<!-- Version Information. State that we work only with major version of this
|
||||
package. -->
|
||||
<RDF:Description about="urn:mozilla:locale:en-US:browser" chrome:localeVersion="0.9.9"/>
|
||||
</RDF:RDF>
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#!nmake
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..
|
||||
include <$(DEPTH)/config/config.mak>
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
Загрузка…
Ссылка в новой задаче