#116005, "'Save page as' in view-source doesn't work",

#116838, "File=>Save Frame As doesn't work at all"

r=bzbarsky, sr=jst
This commit is contained in:
hwaara%chello.se 2006-09-14 06:02:06 +00:00
parent 5210a35c7d
commit 626f95d266
3 changed files with 14 additions and 4 deletions

View File

@ -188,7 +188,7 @@
<menuitem id="menu_closeWindow" hidden="true" command="cmd_closeWindow" key="key_closeWindow" label="&closeWindow.label;"/>
<menuseparator id="menu_closeSeparator" hidden="true"/>
<menuitem label="&savePageCmd.label;" accesskey="&savePageCmd.accesskey;" key="key_savePage" command="Browser:SavePage"/>
<menuitem id="savepage" label="&saveFrameCmd.label;" accesskey="&saveFrameCmd.accesskey;" oncommand="savePage(gFocusedURL, gFocusedDocument);" hidden="true"/>
<menuitem id="savepage" label="&saveFrameCmd.label;" accesskey="&saveFrameCmd.accesskey;" oncommand="saveDocument(gFocusedDocument);" hidden="true"/>
<menuseparator/>
<menuitem label="&editPageCmd.label;" accesskey="&editPageCmd.accesskey;" key="key_editPage" command="Browser:EditPage" />
<menuseparator/>

View File

@ -66,6 +66,7 @@
<commandset id="viewSourceMenuItems">
<command id="cmdWrapLongLines" oncommand="wrapLongLines()"/>
<command id="cmd_close" oncommand="ViewSourceClose()"/>
<command id="cmd_savePage" oncommand="ViewSourceSavePage();"/>
</commandset>
</commandset>
@ -78,7 +79,7 @@
<!-- File Menu -->
<key id="key_newNavigator"/>
<key id="key_newBlankPage"/>
<key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
<key id="key_savePage" key="&savePageCmd.commandkey;" command="cmd_savePage" modifiers="accel"/>
<key id="key_editPage" key="&editPageCmd.commandkey;" command="Browser:EditPage" modifiers="accel"/>
<key id="printKb" key="&printCmd.commandkey;" command="Browser:Print" modifiers="accel"/>
<key id="key_close"/>
@ -123,8 +124,8 @@
<menuseparator/>
<menuitem id="menu_close"/>
<menuitem label="&savePageCmd.label;" accesskey="&savePageCmd.accesskey;" key="key_savePage" command="Browser:SavePage"/>
<menuitem id="savepage" label="&saveFrameCmd.label;" accesskey="&saveFrameCmd.accesskey;" oncommand="savePage(gFocusedURL);" hidden="true"/>
<menuitem label="&savePageCmd.label;" accesskey="&savePageCmd.accesskey;" key="key_savePage" command="cmd_savePage"/>
<menuitem id="savepage" label="&saveFrameCmd.label;" accesskey="&saveFrameCmd.accesskey;" oncommand="ViewSourceSavePage();" hidden="true"/>
<menuseparator/>
<menuitem label="&editPageCmd.label;" accesskey="&editPageCmd.accesskey;" key="key_editPage" oncommand="ViewSourceEditPage();"/>

View File

@ -105,6 +105,15 @@ function ViewSourceEditPage()
editPage(url,window, false);
}
// Strips the |view-source:| for saveURL()
function ViewSourceSavePage()
{
var url = window._content.document.location.href;
url = url.substring(12,url.length);
saveURL(url, null, "SaveLinkTitle");
}
//function to toggle long-line wrapping and set the view_source.wrap_long_lines
//pref to persist the last state
function wrapLongLines()