Bug 1383207 - Using the keyboard shortcut to select-all in the Cookies dialog should select all the visible cookies. r?evanxd
MozReview-Commit-ID: KmIapWrr0Zm
--- a/browser/components/preferences/cookies.js
+++ b/browser/components/preferences/cookies.js
@@ -729,16 +729,24 @@ var gCookiesWindow = {
},
onCookieKeyPress(aEvent) {
if (aEvent.keyCode == KeyEvent.DOM_VK_DELETE ||
(AppConstants.platform == "macosx" &&
aEvent.keyCode == KeyEvent.DOM_VK_BACK_SPACE)) {
this.deleteCookie();
aEvent.preventDefault();
+ } else if (aEvent.getModifierState("Accel") &&
+ document.getElementById("key_selectAll")
+ .getAttribute("key")
+ .toLocaleLowerCase()
+ .charCodeAt(0) == aEvent.charCode) {
+ let view = gCookiesWindow._view;
+ view.selection.selectAll();
+ aEvent.preventDefault();
}
},
_lastSortProperty: "",
_lastSortAscending: false,
sort(aProperty) {
var ascending = (aProperty == this._lastSortProperty) ? !this._lastSortAscending : true;
// Sort the Non-Filtered Host Collections
--- a/browser/components/preferences/cookies.xul
+++ b/browser/components/preferences/cookies.xul
@@ -3,17 +3,22 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?>
-<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/cookies.dtd" >
+<!DOCTYPE dialog [
+<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
+%browserDTD;
+<!ENTITY % cookiesDTD SYSTEM "chrome://browser/locale/preferences/cookies.dtd">
+%cookiesDTD;
+]>
<window id="CookiesDialog" windowtype="Browser:Cookies"
class="windowDialog" title="&window.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: &window.width;;"
onload="gCookiesWindow.init();"
onunload="gCookiesWindow.uninit();"
persist="screenX screenY width height"
@@ -22,16 +27,17 @@
<script src="chrome://browser/content/preferences/cookies.js"/>
<stringbundle id="bundlePreferences"
src="chrome://browser/locale/preferences/preferences.properties"/>
<keyset>
<key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/>
<key key="&focusSearch1.key;" modifiers="accel" oncommand="gCookiesWindow.focusFilterBox();"/>
+ <key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>
</keyset>
<vbox flex="1" class="contentPane largeDialogContainer">
<hbox align="center">
<textbox type="search" id="filter" flex="1"
aria-controls="cookiesList"
oncommand="gCookiesWindow.filter();"
placeholder="&searchFilter.label;"