Fix bug 42817 -- overlay a Page Setup menu item for Mac, which displays the page setup dialog. r=jag/hwaara, sr=sspitzer/blake

This commit is contained in:
sfraser%netscape.com 2006-09-14 06:00:00 +00:00
parent 16f0b200b5
commit 770af77a7a
2 changed files with 9 additions and 3 deletions

View File

@ -852,13 +852,18 @@ function BrowserPrintPreview()
// implement me
}
function BrowserPrintSetup()
{
goPageSetup(); // from utilityOverlay.js
}
function BrowserPrint()
{
// using _content.print() until printing becomes scriptable on docShell
try {
_content.print();
} catch (e) {
// Pressing cancel is expressed as an NS_ERROR_FAILURE return value,
// 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
@ -1065,7 +1070,7 @@ function hiddenWindowStartup()
window.focus();
// Disable menus which are not appropriate
var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage', /*'Browser:PrintSetup', 'Browser:PrintPreview',*/
var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage', 'Browser:PrintSetup', /*'Browser:PrintPreview',*/
'Browser:Print', 'canGoBack', 'canGoForward', 'Browser:Home', 'Browser:AddBookmark', 'cmd_undo',
'cmd_redo', 'cmd_cut', 'cmd_copy','cmd_paste', 'cmd_delete', 'cmd_selectAll'];
for (id in disabledItems) {

View File

@ -106,12 +106,12 @@
<!-- NOT IMPLEMENTED
<command id="cmd_newEditorTemplate"/>
<command id="cmd_newEditorDraft"/>
<command id="Browser:PrintSetup" disabled ="true" oncommand=""/>
<command id="Browser:PrintPreview" disabled="true" oncommand=""/> -->
<command id="Browser:OpenFile" oncommand="BrowserOpenFileWindow();"/>
<command id="Browser:SavePage" oncommand="savePage();"/>
<command id="Browser:EditPage" oncommand="editPage(window._content.location.href,window, false);"/>
<command id="Browser:Open" oncommand="BrowserOpenWindow();"/>
<command id="cmd_printSetup" oncommand="goPageSetup();"/>
<command id="Browser:Print" oncommand="BrowserPrint();"/>
<command id="cmd_quit"/>
<command id="cmd_close" oncommand="BrowserClose()"/>
@ -187,6 +187,7 @@
<menuseparator/>
<menuitem label="&editPageCmd.label;" accesskey="&editPageCmd.accesskey;" key="key_editPage" command="Browser:EditPage" />
<menuseparator/>
<!-- Page setup gets inserted here on some platforms -->
<menuitem id="printMenuItem" label="&printCmd.label;" accesskey="&printCmd.accesskey;" key="printKb" command="Browser:Print"/>
<menuseparator />
<menuitem id="offlineGoOfflineCmd"/>