Bug 57510: `Del' key does not delete on Mac; r=db48x, sr=jag

git-svn-id: svn://10.0.0.236/trunk@225931 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mnyromyr%tprac.de
2007-05-05 04:37:36 +00:00
parent 52bb65c7df
commit dd6ee1b2e7
5 changed files with 60 additions and 31 deletions

View File

@@ -42,6 +42,14 @@
// tree widget, etc.
function Startup()
{
// correct keybinding command attributes which don't do our business yet
var key = document.getElementById("key_delete");
if (key.getAttribute("command"))
key.setAttribute("command", "cmd_bm_delete");
key = document.getElementById("key_delete2");
if (key.getAttribute("command"))
key.setAttribute("command", "cmd_bm_delete");
var bookmarksView = document.getElementById("bookmarks-view");
bookmarksView.tree.view.selection.select(0);
}

View File

@@ -83,7 +83,12 @@
oncommandupdate="document.getElementById('bookmarks-view').onCommandUpdate();">
</commandset>
<commandset id="bookmarksItems"/>
<command id="cmd_undo"/>
<command id="cmd_redo"/>
</commands>
<keyset id="tasksKeys"/>
<keyset id="bookmarks-tasksKeys"/>
<hbox id="panel-bar" class="toolbar">
<toolbarbutton id="btnAddBookmark" label="&command.addBookmark.label;"

View File

@@ -75,6 +75,14 @@ function Startup()
document.title = titleString;
// correct keybinding command attributes which don't do our business yet
var key = document.getElementById("key_delete");
if (key.getAttribute("command"))
key.setAttribute("command", "cmd_bm_delete");
key = document.getElementById("key_delete2");
if (key.getAttribute("command"))
key.setAttribute("command", "cmd_bm_delete");
document.getElementById("CommandUpdate_Bookmarks").setAttribute("commandupdater","true");
bookmarksView.tree.focus();
}

View File

@@ -102,42 +102,15 @@
<command id="cmd_undo"/>
<command id="cmd_redo"/>
</commands>
<stringbundleset id="stringbundleset"/>
<keyset id="tasksKeys">
<!-- File Menu -->
<key id="key_close"/>
<key id="key_quit"/>
<!-- Edit Menu -->
<key id="key_undo"/>
<key id="key_redo"/>
<!-- These keybindings do not have a command specified in the overlay,
which is good, but we need to specify it ourselves here -->
<key id="key_cut" command="cmd_bm_cut"/>
<key id="key_copy" command="cmd_bm_copy"/>
<key id="key_paste" command="cmd_bm_paste"/>
<key id="key_selectAll" command="cmd_bm_selectAll"/>
<!-- We need to provide our own delete key binding because the key_delete
handler in platformGlobalOverlay.xul maps command to "cmd_delete" which
is NOT what we want! -->
<key id="key_bm_delete" keycode="VK_DELETE" command="cmd_bm_delete"/>
<key keycode="VK_BACK" command="cmd_bm_delete"/>
<key id="bm_key_find"
key="&edit.find.keybinding;"
command="cmd_bm_find" modifiers="accel"/>
<key id="bm_key_sortFolder"
key="&edit.sortFolder.keybinding;"
command="cmd_bm_sortfolder" modifiers="accel"/>
<key id="bm_key_properties"
key="&edit.properties.keybinding;"
command="cmd_bm_properties" modifiers="accel"/>
</keyset>
<keyset id="bookmarks-tasksKeys"/>
<toolbox id="bookmarks-toolbox">
<menubar id="main-menubar" grippytooltiptext="&menuBar.tooltip;">
@@ -178,7 +151,7 @@
key="key_paste" command="cmd_bm_paste"/>
<menuitem id="menu_bm_delete"
label="&deleteCmd.label;" accesskey="&deleteCmd.accesskey;"
key="key_bm_delete" command="cmd_bm_delete"/>
key="key_delete" command="cmd_bm_delete"/>
<menuseparator/>
<menuitem id="menu_bm_selectAll"
label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;"

View File

@@ -40,7 +40,12 @@
***** END LICENSE BLOCK ***** -->
<!DOCTYPE overlay SYSTEM "chrome://communicator/locale/bookmarks/bookmarksOverlay.dtd">
<!DOCTYPE overlay [
<!ENTITY % utilDTD SYSTEM "chrome://communicator/locale/bookmarks/bookmarksOverlay.dtd" >
%utilDTD;
<!ENTITY % bmDTD SYSTEM "chrome://communicator/locale/bookmarks/bookmarks.dtd">
%bmDTD;
]>
<overlay id="bookmarksOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -82,4 +87,34 @@
<commandset id="globalEditMenuItems"/>
</commands>
<keyset id="bookmarks-tasksKeys">
<!-- Edit Menu -->
<key id="key_undo"/>
<key id="key_redo"/>
<!-- These keybindings do not have a command specified in the overlay,
which is good, but we need to specify it ourselves here -->
<key id="key_cut" command="cmd_bm_cut"/>
<key id="key_copy" command="cmd_bm_copy"/>
<key id="key_paste" command="cmd_bm_paste"/>
<key id="key_selectAll" command="cmd_bm_selectAll"/>
<!-- These keybindings do have a command specified in the overlay,
which we need to correct in our Startup() function -->
<key id="key_delete"/>
<key id="key_delete2"/>
<key id="bm_key_find"
key="&edit.find.keybinding;"
command="cmd_bm_find" modifiers="accel"/>
<key id="bm_key_sortFolder"
key="&edit.sortFolder.keybinding;"
command="cmd_bm_sortfolder" modifiers="accel"/>
<key id="bm_key_properties"
key="&edit.properties.keybinding;"
command="cmd_bm_properties" modifiers="accel"/>
</keyset>
</overlay>