Brought the viewSource.xul back to life. It now uses the docShell viewMode to specify that the iframe is in viewSource mode.

This commit is contained in:
tbogard%aol.net 2000-03-14 04:43:50 +00:00
Родитель d9a01b05bd
Коммит e7efb61d23
2 изменённых файлов: 17 добавлений и 40 удалений

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

@ -1,38 +1,24 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
<?xul-overlay href="chrome://navigator/content/navigatorOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://navigator/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"
onload="onLoadViewSource()"
onunload="Shutdown()"
title="&mainWindow.title;" titlemodifier="&mainWindow.titlemodifier;"
title="&mainWindow.title;"
titlemodifier="&mainWindow.titlemodifier;"
titlepreface="&mainWindow.preface;"
titlemenuseparator ="&mainWindow.titlemodifierseperator;" windowtype="navigator:viewsource"
align="vertical" width="640" height="480">
titlemenuseparator ="&mainWindow.titlemodifierseperator;"
windowtype="Browser:view-source"
align="vertical" width="640" height="480">
<html:script src="chrome://navigator/content/navigator.js"></html:script>
<html:script src="chrome://navigator/content/viewsource.js"></html:script>
<broadcaster id="args" value="http://www.mozilla.org/"/>
<broadcaster id="canPrint"/>
<broadcaster id="canGoBack" disabled="true"/>
<broadcaster id="Browser:LoadingProgress"/>
<broadcaster id="Browser:Status"/>
<broadcaster id="Browser:OnStartBinding"/>
<broadcaster id="Browser:OnStopBinding"/>
<broadcaster id="Browser:Throbber" busy="false"/>
<!-- Interim hack to transition from nsIXULWindowCallbacks/ShowWindowWithArgs -->
<broadcaster id="dialog.start" ready="false"/>
<observes element="dialog.start" attribute="ready" onbroadcast="StartupViewSource()"/>
<!-- Menu -->
<menubar id="main-menubar"/>
<html:iframe id="content-frame" type="content" html:name="content" html:src="about:blank" flex="100%"/>
<iframe id="content-frame" type="content-primary" name="content" src="about:blank" flex="100%"/>
<!--
<box align="horizontal" id="status-bar">
<box id="security-box" class="insecure" align="horizontal" flex="100%">
@ -54,5 +40,6 @@
<titledbutton align="right" value="Build ID: 2000020608" style="font-family:sans-serif;font-size:2.5mm;"/>
</box>
</box>
-->
</window>

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

@ -1,20 +1,10 @@
function onLoadViewSource() {
// Create and initialize the browser instance.
createBrowserInstance();
function onLoadViewSource()
{
var docShellElement = document.getElementById("content-frame");
var docShell = docShellElement.docShell;
if ( appCore ) {
appCore.isViewSource = true;
appCore.setContentWindow(window.frames[0]);
appCore.setWebShellWindow(window);
// 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 );
} else {
// Give up.
alert( "Error creating browser instance\n" );
}
}
docShell.viewMode = Components.interfaces.nsIDocShell.viewSource;
var webNav = docShell.QueryInterface(Components.interfaces.nsIWebNavigation);
webNav.loadURI(window.arguments[0]);
}