Fix view source to work with the new browser appcore replacement

This commit is contained in:
sfraser%netscape.com 1999-09-07 18:53:02 +00:00
Родитель 0956b48325
Коммит 1ab34362fc
2 изменённых файлов: 20 добавлений и 23 удалений

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

@ -22,20 +22,21 @@
*/
function StartupViewSource() {
// Generate unique name (var appCoreName declared in navigator.js).
EdAppCoreName = "ViewSource." + ( new Date() ).getTime().toString();
// Create and initialize the browser app core.
EdAppCore = new BrowserAppCore();
EdAppCore.Init( EdAppCoreName );
EdAppCore.setContentWindow(window.frames[0]);
EdAppCore.setWebShellWindow(window);
EdAppCore.setToolbarWindow(window);
function StartupViewSource()
{
// Create and initialize the browser instance.
createBrowserInstance();
// Get url whose source to view.
var url = document.getElementById("args").getAttribute("value");
if ( appCore ) {
appCore.isViewSource = true;
appCore.setContentWindow(window.frames[0]);
appCore.setWebShellWindow(window);
appCore.setToolbarWindow(window);
}
// Load the source (the app core will magically know what to do).
EdAppCore.loadUrl(url);
}
// Get url whose source to view.
var url = window.arguments[0];
// Load the source (the app core will magically know what to do).
appCore.loadUrl( url );
}

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

@ -29,11 +29,12 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/viewSource.dtd" >
<window id="main-window" xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onunload="EditorShutdown()"
onload="StartupViewSource()"
title="&mainWindow.title;" align="vertical" width="640" height="480">
<html:script src="chrome://editor/content/EditorCommands.js"></html:script>
<html:script src="chrome://navigator/content/navigator.js"></html:script>
<html:script src="chrome://editor/content/viewsource.js"></html:script>
<html:script src="chrome://editor/content/EditorCommands.js"></html:script>
<broadcaster id="args" value="http://www.mozilla.org/"/>
<broadcaster id="canPrint"/>
@ -44,12 +45,7 @@
<broadcaster id="Editor:OnStopBinding"/>
<broadcaster id="Editor:Throbber" busy="false"/>
<!-- Interim hack to transition from nsIXULWindowCallbacks/ShowWindowWithArgs -->
<broadcaster id="dialog.start" ready="false"/>
<observes element="dialog.start" attribute="ready" onchange="StartupViewSource()"/>
<menubar>
<menubar>
<menu value="&fileMenu.label;">
<menupopup>
<menuitem value="&browserCmd.label;" oncommand="BrowserNewWindow();"/>