Index: xpfe/global/resources/content/commonDialog.xul
===================================================================
RCS file: /cvsroot/mozilla/xpfe/global/resources/content/commonDialog.xul,v
retrieving revision 1.41
diff -u -r1.41 commonDialog.xul
--- xpfe/global/resources/content/commonDialog.xul 1 Feb 2002 22:18:57 -0000 1.41
+++ xpfe/global/resources/content/commonDialog.xul 10 Nov 2002 18:30:34 -0000
@@ -10,9 +10,13 @@
ondialogaccept="return commonDialogOnAccept();"
ondialogextra1="return commonDialogOnExtra1();"
ondialogextra2="return commonDialogOnExtra2();"
+ onkeyup="SetCollapsedOnCommonDialog('false', event);"
+ onkeydown="SetCollapsedOnCommonDialog('true', event);"
buttonpack="center"
style="min-width: 29em; min-height: 8.5em; -moz-user-focus: ignore;">
+
Index: xpfe/global/resources/content/commonDialog.js
===================================================================
RCS file: /cvsroot/mozilla/xpfe/global/resources/content/commonDialog.js,v
retrieving revision 1.49
diff -u -r1.49 commonDialog.js
--- xpfe/global/resources/content/commonDialog.js 3 Oct 2002 00:46:24 -0000 1.49
+++ xpfe/global/resources/content/commonDialog.js 10 Nov 2002 18:30:36 -0000
@@ -41,7 +41,40 @@
// parameters to gCommonDialogParam.Get() are defined in nsPIPromptService.idl
var gCommonDialogParam =
window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock);
+
+var gJavaScriptApplication = null;
+var gLeftContext, gRightContext;
+function SetCollapsedOnCommonDialog(value, e) {
+ // check to see if ctl and tilde key pressed
+ if (e.ctrlKey && e.which == 192) {
+
+ // Determine if we are being called from content by checking the window title.
+ // That title is contained in a .properties file and contains a %S.
+ // For English, the title is "[JavaScript Application] %S"
+
+ // First get the string from the properties file if it is not already cached
+ if (!gJavaScriptApplication) {
+ // Get the title string from the properties file
+ var commonDialogBundle = document.getElementById("commonDialogBundle");
+ gJavaScriptApplication = commonDialogBundle.getString('ScriptDlgTitle');
+ // Find strings that precede and follow the %S
+ var re = /\%S/;
+ if (gJavaScriptApplication.match(re)) {
+ gLeftContext = RegExp.leftContext;
+ gRightContext = RegExp.rightContext;
+ }
+ }
+
+ // Now test if current window title matches the string from the properties file
+ if (window.title.slice(0,gLeftContext.length) == gLeftContext &&
+ window.title.slice(gRightContext.length,-0) == gRightContext) {
+ // it matches -- time to collapse or uncollapse the window
+ document.getElementById('commonDialog').setAttribute("collapsed", value);
+ }
+ }
+}
+
function showControls()
{
// This is called before onload fires, so we can't be certain that any elements
Index: xpfe/browser/resources/content/navigator.xul
===================================================================
RCS file: /cvsroot/mozilla/xpfe/browser/resources/content/navigator.xul,v
retrieving revision 1.394
diff -u -r1.394 navigator.xul
--- xpfe/browser/resources/content/navigator.xul 5 Oct 2002 08:11:25 -0000 1.394
+++ xpfe/browser/resources/content/navigator.xul 10 Nov 2002 18:30:39 -0000
@@ -54,6 +54,8 @@
windowtype="navigator:browser"
width="610" height="450"
screenX="4" screenY="4"
+ onkeyup="SetCollapsedOnBrowserWindow('false', event);"
+ onkeydown="SetCollapsedOnBrowserWindow('true', event);"
persist="screenX screenY width height sizemode">
Index: xpfe/browser/resources/content/navigator.js
===================================================================
RCS file: /cvsroot/mozilla/xpfe/browser/resources/content/navigator.js,v
retrieving revision 1.481
diff -u -r1.481 navigator.js
--- xpfe/browser/resources/content/navigator.js 22 Oct 2002 19:48:59 -0000 1.481
+++ xpfe/browser/resources/content/navigator.js 10 Nov 2002 18:30:46 -0000
@@ -1367,6 +1367,13 @@
BrowserViewSourceOfURL(webNav.currentURI.spec, docCharset, pageCookie);
}
+function SetCollapsedOnBrowserWindow(value, e) {
+ // check to see if ctl and tilde key pressed
+ if (e.ctrlKey && e.which == 192) {
+ document.getElementById('browser').setAttribute("collapsed", value);
+ }
+}
+
function BrowserViewSourceOfURL(url, charset, pageCookie)
{
// try to open a view-source window while inheriting the charset (if any)