use ifdef for page cycling.

This commit is contained in:
blakeross%telocity.com 2002-10-13 22:22:38 +00:00
parent 696b7bb669
commit 827efd7945
2 changed files with 28 additions and 50 deletions

View File

@ -66,7 +66,7 @@ var gURIFixup = null;
var gLocalStore = null;
var gCharsetMenu = null;
var gLastBrowserCharset = null;
var gPrevCharset = null;
var gReportButton = null;
var gURLBar = null;
var gProxyButton = null;
@ -87,23 +87,15 @@ var gToolbarMode = "icons";
var gIconSize = "";
var gMustLoadSidebar = false;
var gURIFixup = null;
var gProgressMeterPanel = null;
var gProgressCollapseTimer = null;
var gPrefService = null;
var appCore = null;
//cached elements
var gBrowser = null;
// Global variable that holds the nsContextMenu instance.
var gContextMenu = null;
// Global variable that caches the default search engine info
var gDefaultEngine = null;
var gPrintSettingsAreGlobal = true;
var gSavePrintSettings = true;
var gPrintSettings = null;
@ -234,6 +226,7 @@ function UpdatePageReport(event)
gReportButton.removeAttribute("blocked");
}
#ifdef MOZ_ENABLE_XREMOTE
function RegisterTabOpenObserver()
{
const observer = {
@ -250,7 +243,7 @@ function RegisterTabOpenObserver()
.getService(Components.interfaces.nsIObserverService);
service.addObserver(observer, "open-new-tab-request", false);
}
#endif
function Startup()
{
// init globals
@ -330,39 +323,34 @@ function Startup()
// hook up UI through progress listener
gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
// load appropriate initial page from commandline
var isPageCycling = false;
// page cycling for tinderbox tests
if (!appCore.cmdLineURLUsed)
isPageCycling = appCore.startPageCycler();
#ifdef ENABLE_PAGE_CYCLER
appCore.startPageCycler();
#else
// only load url passed in when we're not page cycling
if (!isPageCycling) {
var uriToLoad;
var uriToLoad;
// Check for window.arguments[0]. If present, use that for uriToLoad.
if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0])
uriToLoad = window.arguments[0];
if (uriToLoad && uriToLoad != "about:blank") {
if (gURLBar)
gURLBar.value = uriToLoad;
if ("arguments" in window && window.arguments.length >= 3) {
loadURI(uriToLoad, window.arguments[2]);
} else {
loadURI(uriToLoad);
}
// Check for window.arguments[0]. If present, use that for uriToLoad.
if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0])
uriToLoad = window.arguments[0];
if (uriToLoad && uriToLoad != "about:blank") {
if (gURLBar)
gURLBar.value = uriToLoad;
if ("arguments" in window && window.arguments.length >= 3) {
loadURI(uriToLoad, window.arguments[2]);
} else {
loadURI(uriToLoad);
}
#ifdef MOZ_ENABLE_XREMOTE
// hook up remote support
var remoteService;
remoteService = Components.classes[XREMOTESERVICE_CONTRACTID]
.getService(Components.interfaces.nsIXRemoteService);
remoteService.addBrowserInstance(window);
RegisterTabOpenObserver();
}
#ifdef MOZ_ENABLE_XREMOTE
// hook up remote support
var remoteService;
remoteService = Components.classes[XREMOTESERVICE_CONTRACTID]
.getService(Components.interfaces.nsIXRemoteService);
remoteService.addBrowserInstance(window);
RegisterTabOpenObserver();
#endif
#endif
if (window.opener) {
var openerSidebarBox = window.opener.document.getElementById("sidebar-box");
@ -4438,7 +4426,6 @@ function SetForcedCharset(charset)
BrowserSetForcedCharacterSet(charset);
}
var gPrevCharset = null;
function UpdateCurrentCharset()
{
var menuitem = null;

View File

@ -49,8 +49,6 @@
screenX="4" screenY="4"
persist="screenX screenY width height sizemode">
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<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/globalOverlay.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/findUtils.js"/>
@ -144,12 +142,9 @@
<command id="View:PageSource" oncommand="BrowserViewSourceOfDocument(_content.document);"/>
<command id="View:PageInfo" oncommand="BrowserPageInfo();"/>
<command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
<command id="Browser:Find" oncommand="BrowserFind();"/>
<command id="Browser:FindAgain" oncommand="BrowserFindAgain();"/>
<command id="Browser:AddBookmarkAs" oncommand="addBookmarkAs(document.getElementById('content'));"/>
<command id="Browser:Home" oncommand="BrowserHome();"/>
<command id="Browser:Back" oncommand="BrowserBack();" disabled="true"/>
<command id="Browser:Forward" oncommand="BrowserForward();" disabled="true"/>
@ -157,7 +152,6 @@
<command id="cmd_textZoomReduce" oncommand="ZoomManager.prototype.getInstance().reduce();"/>
<command id="cmd_textZoomEnlarge" oncommand="ZoomManager.prototype.getInstance().enlarge();"/>
<command id="Browser:OpenLocation" oncommand="openLocation();"/>
<command id="cmd_quit" oncommand="goQuitApplication()"/>
</commandset>
<broadcasterset id="mainBroadcasterSet">
@ -232,13 +226,10 @@
<key key="&reloadCmd.commandkey;" oncommand="BrowserReloadSkipCache();" modifiers="accel,shift"/>
<key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>
<key id="key_viewInfo" key="&pageInfoCmd.commandkey;" command="View:PageInfo" modifiers="accel"/>
<key id="key_find" key="&findOnCmd.commandkey;" command="Browser:Find" modifiers="accel"/>
<key id="key_findAgain" key="&findAgainCmd.commandkey;" command="Browser:FindAgain" modifiers="accel"/>
<key id="addBookmarkAsKb" key="&addCurPageAsCmd.commandkey;" command="Browser:AddBookmarkAs" modifiers="accel"/>
<key id="viewBookmarksSidebarKb" key="&manBookmarksCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
<key id="key_stop" keycode="VK_ESCAPE" command="Browser:Stop"/>
<key id="key_gotoHistory" key="&history.commandKey;" command="viewHistorySidebar" modifiers="accel"/>
<key id="key_textZoomReduce" key="&textZoomReduceCmd.commandkey;" command="cmd_textZoomReduce" modifiers="accel"/>
@ -494,7 +485,7 @@
<menuitem label="&printCmd.label;" accesskey="&printCmd.accesskey;" key="printKb" command="Browser:Print"/>
<menuseparator/>
<menuitem label="&quitApplicationCmd.label;" id="menu_FileQuitItem"
key="key_quit" accesskey="&quitApplicationCmd.accesskey;" command="cmd_quit"/>
accesskey="&quitApplicationCmd.accesskey;" oncommand="goQuitApplication();"/>
</menupopup>
</menu>