Use browser window for view source

add extrachrome class to sidebar and task bar


git-svn-id: svn://10.0.0.236/trunk@48167 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
davidm%netscape.com
1999-09-18 03:32:53 +00:00
parent 758ff42c69
commit 6835792fe4
6 changed files with 50 additions and 18 deletions

View File

@@ -204,7 +204,7 @@ function UpdateHistory(event)
// notified here. This allows us to update the global history and
// set the document's title information.
//dump("UpdateHistory: content's location is '" + window.content.location.href + "',\n");
// dump("UpdateHistory: content's location is '" + window.content.location.href + "',\n");
//dump(" title is '" + window.content.document.title + "'\n");
if (window.content.location.href && window.content.location.href != "")
@@ -293,19 +293,19 @@ function UpdateBookmarksLastVisitedDate(event)
// Initialize browser instance..
appCore.setWebShellWindow(window);
tryToSetContentWindow();
// Add a capturing event listener to the content window so we'll
// be notified when onloads complete.
window.addEventListener("load", UpdateHistory, true);
window.addEventListener("load", UpdateBookmarksLastVisitedDate, true);
// Check for window.arguments[0]. If present, go to that url.
// Check for window.arguments[0]. If present, go to that url.
if ( window.arguments && window.arguments[0] ) {
// Load it using yet another psuedo-onload handler.
onLoadViaOpenDialog();
}
sidebarOverlayInit();
}
@@ -354,6 +354,17 @@ function UpdateBookmarksLastVisitedDate(event)
appCore.stop();
}
dump( "Loading page specified via openDialog\n" );
dump("Check if a view source window \n");
if( window.arguments[1]=="view-source" )
{
dump(" A view source window \n");
var element = document.getElementById("main-window");
var preface = element.getAttribute("viewsourcetitlepreface");
element.setAttribute( "titlepreface", preface );
appCore.isViewSource = true;
element.setAttribute("windowtype","Browser:view-source");
}
appCore.loadUrl( window.arguments[0] );
}
@@ -1042,7 +1053,11 @@ function OpenSearch(tabName, searchStr)
function BrowserViewSource()
{
window.openDialog( "chrome://navigator/content/viewSource.xul", "_blank", "chrome,all,dialog=no", window.content.location );
dump("BrowserViewSource(); \n ");
// window.openDialog( "chrome://navigator/content/viewSource.xul", "_blank", "chrome,all,dialog=no", window.content.location );
// Use a browser window to view source
window.openDialog( "chrome://navigator/content/", "_blank", "chrome,menubar,status,dialog=no", window.content.location,"view-source" );
}

View File

@@ -39,6 +39,7 @@ Contributor(s): ______________________________________. -->
title="&mainWindow.title;"
titlemodifier="&mainWindow.titlemodifier;"
titlemenuseparator="&mainWindow.titlemodifiermenuseparator;"
viewsourcetitlepreface="&viewsourcetitle.preface;"
windowtype="navigator:browser"
align="vertical"
width="640" height="480"
@@ -623,7 +624,7 @@ var contextTarget = null; // Content element to which context menu applies.
<!-- sidebar/toolbar/content/status -->
<box id="sidebarparent" align="horizontal" flex="100%">
<!-- toolbar/content/status -->
<box id="sidebarbox" />
<box id="sidebarbox" chromeclass="extrachrome" />
<splitter id="sidebarsplitter" collapse="before" persist="state hidden"
onclick="sidebarSaveState(this)"/>
<box id="appcontent" align="vertical" flex="100%">
@@ -764,6 +765,6 @@ var contextTarget = null; // Content element to which context menu applies.
</box><!-- status -->
</box><!-- toolbar/content/status -->
</box><!-- sidebar and tools/content/status -->
<toolbox id="taskbox"/>
<toolbox id="taskbox" chromeclass="extrachrome"/>
</window>

View File

@@ -4,7 +4,7 @@
<!ENTITY mainWindow.title "Mozilla">
<!ENTITY mainWindow.titlemodifier "Mozilla">
<!ENTITY mainWindow.titlemodifiermenuseparator " - ">
<!ENTITY viewsourcetitle.preface "Source for: ">
<!-- LOCALIZATION NOTE throbber.url: Do NOT localize all the URL -->
<!ENTITY throbber.url "http://www.mozilla.org">
<!ENTITY myNetscape.url "http://my.netscape.com">

View File

@@ -204,7 +204,7 @@ function UpdateHistory(event)
// notified here. This allows us to update the global history and
// set the document's title information.
//dump("UpdateHistory: content's location is '" + window.content.location.href + "',\n");
// dump("UpdateHistory: content's location is '" + window.content.location.href + "',\n");
//dump(" title is '" + window.content.document.title + "'\n");
if (window.content.location.href && window.content.location.href != "")
@@ -293,19 +293,19 @@ function UpdateBookmarksLastVisitedDate(event)
// Initialize browser instance..
appCore.setWebShellWindow(window);
tryToSetContentWindow();
// Add a capturing event listener to the content window so we'll
// be notified when onloads complete.
window.addEventListener("load", UpdateHistory, true);
window.addEventListener("load", UpdateBookmarksLastVisitedDate, true);
// Check for window.arguments[0]. If present, go to that url.
// Check for window.arguments[0]. If present, go to that url.
if ( window.arguments && window.arguments[0] ) {
// Load it using yet another psuedo-onload handler.
onLoadViaOpenDialog();
}
sidebarOverlayInit();
}
@@ -354,6 +354,17 @@ function UpdateBookmarksLastVisitedDate(event)
appCore.stop();
}
dump( "Loading page specified via openDialog\n" );
dump("Check if a view source window \n");
if( window.arguments[1]=="view-source" )
{
dump(" A view source window \n");
var element = document.getElementById("main-window");
var preface = element.getAttribute("viewsourcetitlepreface");
element.setAttribute( "titlepreface", preface );
appCore.isViewSource = true;
element.setAttribute("windowtype","Browser:view-source");
}
appCore.loadUrl( window.arguments[0] );
}
@@ -1042,7 +1053,11 @@ function OpenSearch(tabName, searchStr)
function BrowserViewSource()
{
window.openDialog( "chrome://navigator/content/viewSource.xul", "_blank", "chrome,all,dialog=no", window.content.location );
dump("BrowserViewSource(); \n ");
// window.openDialog( "chrome://navigator/content/viewSource.xul", "_blank", "chrome,all,dialog=no", window.content.location );
// Use a browser window to view source
window.openDialog( "chrome://navigator/content/", "_blank", "chrome,menubar,status,dialog=no", window.content.location,"view-source" );
}

View File

@@ -39,6 +39,7 @@ Contributor(s): ______________________________________. -->
title="&mainWindow.title;"
titlemodifier="&mainWindow.titlemodifier;"
titlemenuseparator="&mainWindow.titlemodifiermenuseparator;"
viewsourcetitlepreface="&viewsourcetitle.preface;"
windowtype="navigator:browser"
align="vertical"
width="640" height="480"
@@ -623,7 +624,7 @@ var contextTarget = null; // Content element to which context menu applies.
<!-- sidebar/toolbar/content/status -->
<box id="sidebarparent" align="horizontal" flex="100%">
<!-- toolbar/content/status -->
<box id="sidebarbox" />
<box id="sidebarbox" chromeclass="extrachrome" />
<splitter id="sidebarsplitter" collapse="before" persist="state hidden"
onclick="sidebarSaveState(this)"/>
<box id="appcontent" align="vertical" flex="100%">
@@ -764,6 +765,6 @@ var contextTarget = null; // Content element to which context menu applies.
</box><!-- status -->
</box><!-- toolbar/content/status -->
</box><!-- sidebar and tools/content/status -->
<toolbox id="taskbox"/>
<toolbox id="taskbox" chromeclass="extrachrome"/>
</window>

View File

@@ -4,7 +4,7 @@
<!ENTITY mainWindow.title "Mozilla">
<!ENTITY mainWindow.titlemodifier "Mozilla">
<!ENTITY mainWindow.titlemodifiermenuseparator " - ">
<!ENTITY viewsourcetitle.preface "Source for: ">
<!-- LOCALIZATION NOTE throbber.url: Do NOT localize all the URL -->
<!ENTITY throbber.url "http://www.mozilla.org">
<!ENTITY myNetscape.url "http://my.netscape.com">