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

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

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