diff --git a/mozilla/browser/base/content/browser-menubar.inc b/mozilla/browser/base/content/browser-menubar.inc
index c48259120d4..066b49a6f6b 100644
--- a/mozilla/browser/base/content/browser-menubar.inc
+++ b/mozilla/browser/base/content/browser-menubar.inc
@@ -19,8 +19,8 @@
#endif
-
-
+
+
#ifndef XP_MACOSX
diff --git a/mozilla/browser/base/content/browser-scripts.inc b/mozilla/browser/base/content/browser-scripts.inc
index fd7d05fa676..c53c8232c58 100644
--- a/mozilla/browser/base/content/browser-scripts.inc
+++ b/mozilla/browser/base/content/browser-scripts.inc
@@ -1,6 +1,7 @@
+
diff --git a/mozilla/browser/base/content/browser-sets.inc b/mozilla/browser/base/content/browser-sets.inc
index 4c5ce4a515a..95f704074b2 100644
--- a/mozilla/browser/base/content/browser-sets.inc
+++ b/mozilla/browser/base/content/browser-sets.inc
@@ -18,8 +18,7 @@
oncommandupdate="goUpdatePasteMenuItems()"/>
-
+
@@ -29,14 +28,9 @@
-
-
-
-
-
#ifdef XP_WIN
@@ -47,7 +41,7 @@
-
+
diff --git a/mozilla/browser/base/content/browser.js b/mozilla/browser/base/content/browser.js
index ebc8ad040f8..1214ab8a01c 100644
--- a/mozilla/browser/base/content/browser.js
+++ b/mozilla/browser/base/content/browser.js
@@ -90,13 +90,7 @@ var gBrowser = null;
// Global variable that holds the nsContextMenu instance.
var gContextMenu = null;
-var gPrintSettingsAreGlobal = true;
-var gSavePrintSettings = true;
-var gPrintSettings = null;
var gChromeState = null; // chrome state before we went into print preview
-var gOldCloseHandler = null; // close handler before we went into print preview
-var gInPrintPreviewMode = false;
-var gWebProgress = null;
var gFormHistory = null;
var gFormFillEnabled = true;
@@ -390,7 +384,6 @@ function delayedStartup()
// loads the services
initServices();
initBMService();
-
gBrowser.addEventListener("load", function(evt) { setTimeout(loadEventHandlers, 0, evt); }, true);
window.addEventListener("keypress", ctrlNumberTabSelection, false);
@@ -415,7 +408,7 @@ function delayedStartup()
BMSVC.readBookmarks();
var bt = document.getElementById("bookmarks-ptf");
if (bt) {
- var btf = BMSVC.getBookmarksToolbarFolder().Value
+ var btf = BMSVC.getBookmarksToolbarFolder().Value;
bt.ref = btf;
document.getElementById("bookmarks-chevron").ref = btf;
bt.database.AddObserver(BookmarksToolbarRDFObserver);
@@ -885,11 +878,9 @@ function openLocation()
function BrowserOpenTab()
{
- if (!gInPrintPreviewMode) {
- gBrowser.selectedTab = gBrowser.addTab('about:blank');
- if (gURLBar)
- setTimeout("gURLBar.focus();", 0);
- }
+ gBrowser.selectedTab = gBrowser.addTab('about:blank');
+ if (gURLBar)
+ setTimeout("gURLBar.focus();", 0);
}
/* Called from the openLocation dialog. This allows that dialog to instruct
@@ -1409,7 +1400,6 @@ function BrowserFullScreen()
function onFullScreen()
{
FullScreen.toggle();
-
}
function getWebNavigation()
@@ -1449,261 +1439,31 @@ function toggleAffectedChrome(aHide)
// (*) menubar
// (*) navigation bar
// (*) bookmarks toolbar
- // (*) tab browser ``strip''
// (*) sidebar
- if (!gChromeState)
- gChromeState = new Object;
var navToolbox = document.getElementById("navigator-toolbox");
navToolbox.hidden = aHide;
if (aHide)
{
- // going into print preview mode
- //deal with tab browser
- gChromeState.hadTabStrip = gBrowser.getStripVisibility();
- gBrowser.setStripVisibilityTo(false);
-
+ gChromeState = {};
var sidebar = document.getElementById("sidebar-box");
gChromeState.sidebarOpen = !sidebar.hidden;
- if (gChromeState.sidebarOpen) {
- toggleSidebar();
- }
- }
- else
- {
- // restoring normal mode (i.e., leaving print preview mode)
- //restore tab browser
- gBrowser.setStripVisibilityTo(gChromeState.hadTabStrip);
- if (gChromeState.sidebarOpen) {
- toggleSidebar();
- }
}
+
+ if (gChromeState.sidebarOpen)
+ toggleSidebar(); //pch doesn't work.
}
-function showPrintPreviewToolbar()
+function onEnterPrintPreview()
{
toggleAffectedChrome(true);
-
- var printPreviewTB = document.createElementNS(kXULNS, "toolbar");
- printPreviewTB.setAttribute("printpreview", true);
- printPreviewTB.setAttribute("id", "print-preview-toolbar");
-
- var navToolbox = document.getElementById("navigator-toolbox");
- navToolbox.parentNode.insertBefore(printPreviewTB, navToolbox);
}
-function BrowserExitPrintPreview()
+
+function onExitPrintPreview()
{
- gInPrintPreviewMode = false;
-
- gBrowser.setAttribute("handleCtrlPageUpDown", "true");
-
- // exit print preview galley mode in content area
- var ifreq = _content.QueryInterface(
- Components.interfaces.nsIInterfaceRequestor);
- var webBrowserPrint = ifreq.getInterface(
- Components.interfaces.nsIWebBrowserPrint);
- webBrowserPrint.exitPrintPreview();
- _content.focus();
-
- // remove the print preview toolbar
- var navToolbox = document.getElementById("navigator-toolbox");
- var printPreviewTB = document.getElementById("print-preview-toolbar");
- navToolbox.parentNode.removeChild(printPreviewTB);
-
// restore chrome to original state
toggleAffectedChrome(false);
-
- // restore old onclose handler if we found one before previewing
- var mainWin = document.getElementById("main-window");
- mainWin.setAttribute("onclose", gOldCloseHandler);
-}
-
-function setPrinterDefaultsForSelectedPrinter(aPrintService)
-{
- if (gPrintSettings.printerName == "") {
- gPrintSettings.printerName = aPrintService.defaultPrinterName;
- }
-
- // First get any defaults from the printer
- aPrintService.initPrintSettingsFromPrinter(gPrintSettings.printerName, gPrintSettings);
-
- // now augment them with any values from last time
- aPrintService.initPrintSettingsFromPrefs(gPrintSettings, true, gPrintSettings.kInitSaveAll);
-}
-
-function GetPrintSettings()
-{
- var prevPS = gPrintSettings;
- try {
- if (gPrintSettings == null) {
- var pref = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
- if (pref) {
- gPrintSettingsAreGlobal = pref.getBoolPref("print.use_global_printsettings", false);
- gSavePrintSettings = pref.getBoolPref("print.save_print_settings", false);
- }
-
- var printService = Components.classes["@mozilla.org/gfx/printsettings-service;1"]
- .getService(Components.interfaces.nsIPrintSettingsService);
- if (gPrintSettingsAreGlobal) {
- gPrintSettings = printService.globalPrintSettings;
- setPrinterDefaultsForSelectedPrinter(printService);
- } else {
- gPrintSettings = printService.newPrintSettings;
- }
- }
- } catch (e) {
- dump("GetPrintSettings() "+e+"\n");
- }
-
- return gPrintSettings;
-}
-
-// This observer is called once the progress dialog has been "opened"
-var gPrintPreviewObs = {
- observe: function(aSubject, aTopic, aData)
- {
- setTimeout(FinishPrintPreview, 0);
- },
-
- QueryInterface : function(iid)
- {
- if (iid.equals(Components.interfaces.nsIObserver) || iid.equals(Components.interfaces.nsISupportsWeakReference))
- return this;
-
- throw Components.results.NS_NOINTERFACE;
- }
-};
-
-function BrowserPrintPreview()
-{
- var ifreq;
- var webBrowserPrint;
- try {
- ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
- webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
- gPrintSettings = GetPrintSettings();
-
- } catch (e) {
- // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
- // causing an exception to be thrown which we catch here.
- // Unfortunately this will also consume helpful failures, so add a
- // dump(e); // if you need to debug
- }
-
- // Here we get the PrintingPromptService tso we can display the PP Progress from script
- // For the browser implemented via XUL with the PP toolbar we cannot let it be
- // automatically opened from the print engine because the XUL scrollbars in the PP window
- // will layout before the content window and a crash will occur.
- //
- // Doing it all from script, means it lays out before hand and we can let printing do it's own thing
- gWebProgress = new Object();
-
- var printPreviewParams = new Object();
- var notifyOnOpen = new Object();
- var printingPromptService = Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"]
- .getService(Components.interfaces.nsIPrintingPromptService);
- if (printingPromptService) {
- // just in case we are already printing,
- // an error code could be returned if the Prgress Dialog is already displayed
- try {
- printingPromptService.showProgress(this, webBrowserPrint, gPrintSettings, gPrintPreviewObs, false, gWebProgress,
- printPreviewParams, notifyOnOpen);
- if (printPreviewParams.value) {
- var webNav = getWebNavigation();
- printPreviewParams.value.docTitle = webNav.document.title;
- printPreviewParams.value.docURL = webNav.currentURI.spec;
- }
-
- // this tells us whether we should continue on with PP or
- // wait for the callback via the observer
- if (!notifyOnOpen.value.valueOf() || gWebProgress.value == null) {
- FinishPrintPreview();
- }
- } catch (e) {
- FinishPrintPreview();
- }
- }
-}
-
-function FinishPrintPreview()
-{
- try {
- var ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
- var webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
- if (webBrowserPrint) {
- gPrintSettings = GetPrintSettings();
- webBrowserPrint.printPreview(gPrintSettings, null, gWebProgress.value);
- }
-
- gBrowser.setAttribute("handleCtrlPageUpDown", "false");
-
- var mainWin = document.getElementById("main-window");
-
- // save previous close handler to restoreon exiting print preview mode
- if (mainWin.hasAttribute("onclose"))
- gOldCloseHandler = mainWin.getAttribute("onclose");
- else
- gOldCloseHandler = null;
- mainWin.setAttribute("onclose", "BrowserExitPrintPreview(); return false;");
-
- // show the toolbar after we go into print preview mode so
- // that we can initialize the toolbar with total num pages
- showPrintPreviewToolbar();
-
- _content.focus();
- } catch (e) {
- // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
- // causing an exception to be thrown which we catch here.
- // Unfortunately this will also consume helpful failures, so add a
- // dump(e); // if you need to debug
- }
- gInPrintPreviewMode = true;
-}
-
-function BrowserPrintSetup()
-{
- var didOK = false;
- try {
- var ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
- var webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
- if (webBrowserPrint) {
- gPrintSettings = GetPrintSettings();
- }
-
- didOK = goPageSetup(window, gPrintSettings); // from utilityOverlay.js
- if (didOK) { // from utilityOverlay.js
-
- if (webBrowserPrint) {
- if (gPrintSettingsAreGlobal && gSavePrintSettings) {
- var psService = Components.classes["@mozilla.org/gfx/printsettings-service;1"]
- .getService(Components.interfaces.nsIPrintSettingsService);
- psService.savePrintSettingsToPrefs(gPrintSettings, false, gPrintSettings.kInitSaveNativeData);
- }
- }
- }
- } catch (e) {
- dump("BrowserPrintSetup "+e);
- }
- return didOK;
-}
-
-function BrowserPrint()
-{
- try {
- var ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
- var webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
- if (webBrowserPrint) {
- gPrintSettings = GetPrintSettings();
- webBrowserPrint.print(gPrintSettings, null);
- }
- } catch (e) {
- // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
- // causing an exception to be thrown which we catch here.
- // Unfortunately this will also consume helpful failures, so add a
- // dump(e); // if you need to debug
- }
}
function BrowserFind()
@@ -2736,8 +2496,7 @@ nsBrowserContentListener.prototype =
// |forceOpen| is a bool that indicates that the sidebar should be forced open. In other words
// the toggle won't be allowed to close the sidebar.
function toggleSidebar(aCommandID, forceOpen) {
- if (gInPrintPreviewMode)
- return;
+
var sidebarBox = document.getElementById("sidebar-box");
if (!aCommandID)
aCommandID = sidebarBox.getAttribute("sidebarcommand");
diff --git a/mozilla/browser/base/content/utilityOverlay.js b/mozilla/browser/base/content/utilityOverlay.js
index b5b64d9e50a..55d8f295795 100644
--- a/mozilla/browser/base/content/utilityOverlay.js
+++ b/mozilla/browser/base/content/utilityOverlay.js
@@ -48,26 +48,6 @@ function getBrowserURL()
return "chrome://browser/content/browser.xul";
}
-function goPageSetup(domwin, printSettings)
-{
- try {
- if (printSettings == null) {
- alert("PrintSettings arg is null!");
- }
-
- // This code calls the printoptions service to bring up the printoptions
- // dialog. This will be an xp dialog if the platform did not override
- // the ShowPrintSetupDialog method.
- var printingPromptService = Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"]
- .getService(Components.interfaces.nsIPrintingPromptService);
- printingPromptService.showPageSetup(domwin, printSettings, null);
- return true;
- } catch(e) {
- return false;
- }
- return true;
-}
-
function goToggleToolbar( id, elementID )
{
var toolbar = document.getElementById(id);
diff --git a/mozilla/browser/components/bookmarks/content/bookmarks.js b/mozilla/browser/components/bookmarks/content/bookmarks.js
index e5aab23ead8..a4715e5d401 100644
--- a/mozilla/browser/components/bookmarks/content/bookmarks.js
+++ b/mozilla/browser/components/bookmarks/content/bookmarks.js
@@ -1665,6 +1665,18 @@ var BookmarkEditMenuTxnListener =
}
#ifdef DEBUG
+
+var _dumpTIME;
+function dumpTIME(aString)
+{
+ var now=Date.now();
+ dump(aString);
+ if (_dumpTIME)
+ dump(now-_dumpTIME+'ms\n');
+ else
+ _dumpTIME = now;
+}
+
function dumpOBJ (aObj)
{
if (!aObj)
diff --git a/mozilla/toolkit/components/printing/content/printPreviewBindings.xml b/mozilla/toolkit/components/printing/content/printPreviewBindings.xml
index 4cf8ecf600b..152f0ff6641 100644
--- a/mozilla/toolkit/components/printing/content/printPreviewBindings.xml
+++ b/mozilla/toolkit/components/printing/content/printPreviewBindings.xml
@@ -38,6 +38,7 @@
# ***** END LICENSE BLOCK ***** -->
# this file depends on printUtils.js
+# caller must define the routine |exitPrintPreview| to restore the normal state
@@ -118,14 +119,11 @@
+ oncommand="PrintUtils.exitPrintPreview();"/>
-
- false
-
document.getAnonymousNodes(this)[0]
@@ -160,12 +158,10 @@
-
-
= 10) {
aValue /= 100.0;
} else {
@@ -478,8 +466,6 @@
-
+
-
+
-
-
-
-
-
-
-
diff --git a/mozilla/toolkit/components/printing/content/printPreviewProgress.js b/mozilla/toolkit/components/printing/content/printPreviewProgress.js
index ba00157498a..7b01f7fce69 100644
--- a/mozilla/toolkit/components/printing/content/printPreviewProgress.js
+++ b/mozilla/toolkit/components/printing/content/printPreviewProgress.js
@@ -21,6 +21,7 @@
#
# Contributors:
# Rod Spears
+# Pierre Chanial
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -66,13 +67,14 @@ function elipseString(aStr, doFront)
// all progress notifications are done through the nsIWebProgressListener implementation...
var progressListener = {
- onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus)
+
+ onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus)
{
if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP)
window.close();
},
- onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
+ onProgressChange: function (aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
{
if (!progressParams)
return;
@@ -89,27 +91,19 @@ var progressListener = {
}
},
- onLocationChange: function(aWebProgress, aRequest, aLocation)
- {
- // we can ignore this notification
- },
+ onLocationChange: function (aWebProgress, aRequest, aLocation) {},
+ onSecurityChange: function (aWebProgress, aRequest, state) {},
- onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage)
+ onStatusChange: function (aWebProgress, aRequest, aStatus, aMessage)
{
- if (aMessage != "")
+ if (aMessage)
dialog.title.setAttribute("value", aMessage);
},
- onSecurityChange: function(aWebProgress, aRequest, state)
- {
- // we can ignore this notification
- },
-
- QueryInterface : function(iid)
+ QueryInterface: function (iid)
{
if (iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsISupportsWeakReference))
- return this;
-
+ return this;
throw Components.results.NS_NOINTERFACE;
}
}
diff --git a/mozilla/toolkit/components/printing/content/printUtils.js b/mozilla/toolkit/components/printing/content/printUtils.js
index 480ab537a3e..05de039f087 100644
--- a/mozilla/toolkit/components/printing/content/printUtils.js
+++ b/mozilla/toolkit/components/printing/content/printUtils.js
@@ -79,13 +79,10 @@ var PrintUtils = {
print: function ()
{
+ var webBrowserPrint = this.getWebBrowserPrint();
+ var printSettings = this.getPrintSettings();
try {
- var ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
- var webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
- if (webBrowserPrint) {
- var printSettings = this.getPrintSettings();
- webBrowserPrint.print(printSettings, null);
- }
+ webBrowserPrint.print(printSettings, null);
} catch (e) {
// Pressing cancel is expressed as an NS_ERROR_ABORT return value,
// causing an exception to be thrown which we catch here.
@@ -94,11 +91,52 @@ var PrintUtils = {
}
},
+ printPreview: function (aEnterPPCallback, aExitPPCallback)
+ {
+ this._onEnterPP = aEnterPPCallback;
+ this._onExitPP = aExitPPCallback;
+ var webBrowserPrint = this.getWebBrowserPrint();
+ var printSettings = this.getPrintSettings();
+ this._webProgressPP = {};
+ var ppParams = {};
+ var notifyOnOpen = {};
+ // Here we get the PrintingPromptService so we can display the PP Progress from script
+ // For the browser implemented via XUL with the PP toolbar we cannot let it be
+ // automatically opened from the print engine because the XUL scrollbars in the PP window
+ // will layout before the content window and a crash will occur.
+ // Doing it all from script, means it lays out before hand and we can let printing do it's own thing
+ var PPROMPTSVC = Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"]
+ .getService(Components.interfaces.nsIPrintingPromptService);
+ // just in case we are already printing,
+ // an error code could be returned if the Prgress Dialog is already displayed
+ try {
+ PPROMPTSVC.showProgress(this, webBrowserPrint, printSettings, this._obsPP, false,
+ this._webProgressPP, ppParams, notifyOnOpen);
+ if (ppParams.value) {
+ var webNav = getBrowser().webNavigation;
+ ppParams.value.docTitle = webNav.document.title;
+ ppParams.value.docURL = webNav.currentURI.spec;
+ }
+
+ // this tells us whether we should continue on with PP or
+ // wait for the callback via the observer
+ if (!notifyOnOpen.value.valueOf() || this._webProgressPP.value == null)
+ this.enterPrintPreview();
+ } catch (e) {
+ this.enterPrintPreview();
+ }
+ },
////////////////////////////////////////
// "private" methods. Don't use them. //
////////////////////////////////////////
+ getWebBrowserPrint: function ()
+ {
+ return _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
+ .getInterface(Components.interfaces.nsIWebBrowserPrint);
+ },
+
setPrinterDefaultsForSelectedPrinter: function (aPRINTSVC, aPrintSettings)
{
if (!aPrintSettings.printerName)
@@ -129,5 +167,101 @@ var PrintUtils = {
dump("getPrintSettings: "+e+"\n");
}
return printSettings;
+ },
+
+ _chromeState: {},
+ _commandsPP: {},
+ _webProgressPP: null,
+ _onEnterPP: null,
+ _onExitPP: null,
+
+ // This observer is called once the progress dialog has been "opened"
+ _obsPP:
+ {
+ observe: function(aSubject, aTopic, aData)
+ {
+ // delay the print preview to show the content of the progress dialog
+ setTimeout("PrintUtils.enterPrintPreview();", 0);
+ },
+
+ QueryInterface : function(iid)
+ {
+ if (iid.equals(Components.interfaces.nsIObserver) || iid.equals(Components.interfaces.nsISupportsWeakReference))
+ return this;
+ throw Components.results.NS_NOINTERFACE;
+ }
+ },
+
+ enterPrintPreview: function ()
+ {
+ var webBrowserPrint = this.getWebBrowserPrint();
+ var printSettings = this.getPrintSettings();
+ try {
+ webBrowserPrint.printPreview(printSettings, null, this._webProgressPP.value);
+ } catch (e) {
+ // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
+ // causing an exception to be thrown which we catch here.
+ // Unfortunately this will also consume helpful failures, so add a
+ // dump(e); // if you need to debug
+ }
+
+ // show the toolbar after we go into print preview mode so
+ // that we can initialize the toolbar with total num pages
+ var printPreviewTB = document.createElementNS(XUL_NS, "toolbar");
+ printPreviewTB.setAttribute("printpreview", true);
+ printPreviewTB.setAttribute("id", "print-preview-toolbar");
+ getBrowser().parentNode.insertBefore(printPreviewTB, getBrowser());
+
+ // Tab browser...
+ this._chromeState.hadTabStrip = getBrowser().getStripVisibility();
+ getBrowser().setStripVisibilityTo(false);
+
+ // disable chrome shortcuts...
+ window.addEventListener("keypress", this.onKeyPressPP, true);
+
+ _content.focus();
+
+ // on Enter PP Call back
+ if (this._onEnterPP)
+ this._onEnterPP();
+ },
+
+ exitPrintPreview: function ()
+ {
+ window.removeEventListener("keypress", this.onKeyPressPP, true);
+
+ getBrowser().setStripVisibilityTo(this._chromeState.hadTabStrip);
+ var webBrowserPrint = this.getWebBrowserPrint();
+ webBrowserPrint.exitPrintPreview();
+
+ // remove the print preview toolbar
+ var printPreviewTB = document.getElementById("print-preview-toolbar");
+ getBrowser().parentNode.removeChild(printPreviewTB);
+
+ _content.focus();
+
+ // on Exit PP Call back
+ if (this._onExitPP)
+ this._onExitPP();
+ },
+
+ onKeyPressPP: function (aEvent)
+ {
+ var closeKey;
+ try {
+ closeKey = document.getElementById("key_close")
+ .getAttribute("key");
+ closeKey = aEvent["DOM_VK_"+closeKey];
+ } catch (e) {}
+ var isModif = aEvent.ctrlKey || aEvent.metaKey;
+ // ESC and Ctrl-W exits the PP
+ if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE || isModif &&
+ (aEvent.charCode == closeKey || aEvent.charCode == closeKey + 32))
+ PrintUtils.exitPrintPreview();
+ // cancel shortkeys
+ if (isModif) {
+ aEvent.preventDefault();
+ aEvent.stopPropagation();
+ }
}
}