Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge f-t to m-c, a=merge
  • Loading branch information
philor committed Dec 28, 2014
2 parents 005d43d + ad9d53e commit 7ebdc17
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
11 changes: 6 additions & 5 deletions browser/components/preferences/cookies.js
Expand Up @@ -5,6 +5,8 @@

const nsICookie = Components.interfaces.nsICookie;

Components.utils.import("resource://gre/modules/PluralForm.jsm");

var gCookiesWindow = {
_cm : Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager),
Expand Down Expand Up @@ -551,12 +553,11 @@ var gCookiesWindow = {
if (item && seln.count == 1 && item.container && item.open)
selectedCookieCount += 2;

var removeCookie = document.getElementById("removeCookie");
var removeCookies = document.getElementById("removeCookies");
removeCookie.parentNode.selectedPanel =
selectedCookieCount == 1 ? removeCookie : removeCookies;
let buttonLabel = this._bundle.getString("removeSelectedCookies");
let removeSelectedCookies = document.getElementById("removeSelectedCookies");
removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel);

removeCookie.disabled = removeCookies.disabled = !(seln.count > 0);
removeSelectedCookies.disabled = !(seln.count > 0);
},

performDeletion: function gCookiesWindow_performDeletion(deleteItems) {
Expand Down
13 changes: 4 additions & 9 deletions browser/components/preferences/cookies.xul
Expand Up @@ -92,16 +92,11 @@
</vbox>
<hbox align="end">
<hbox class="actionButtons" flex="1">
<deck oncommand="gCookiesWindow.deleteCookie();">
<button id="removeCookie" disabled="true" icon="remove"
label="&button.removecookie.label;"
accesskey="&button.removecookie.accesskey;"/>
<button id="removeCookies" disabled="true" icon="remove"
label="&button.removecookies.label;"
accesskey="&button.removecookie.accesskey;"/>
</deck>
<button id="removeSelectedCookies" disabled="true" icon="clear"
accesskey="&button.removeSelectedCookies.accesskey;"
oncommand="gCookiesWindow.deleteCookie();"/>
<button id="removeAllCookies" disabled="true" icon="clear"
label="&button.removeallcookies.label;" accesskey="&button.removeallcookies.accesskey;"
label="&button.removeAllCookies.label;" accesskey="&button.removeAllCookies.accesskey;"
oncommand="gCookiesWindow.deleteAllCookies();"/>
<spacer flex="1"/>
#ifndef XP_MACOSX
Expand Down
3 changes: 1 addition & 2 deletions browser/components/preferences/tests/browser_bug705422.js
Expand Up @@ -81,7 +81,7 @@ function runTest(win, searchTerm, cookies, matches) {

// select first cookie and delete
var tree = win.document.getElementById("cookiesList");
var deleteButton = win.document.getElementById("removeCookie");
var deleteButton = win.document.getElementById("removeSelectedCookies");
var rect = tree.treeBoxObject.getCoordsForCellItem(0, tree.columns[0], "cell");
EventUtils.synthesizeMouse(tree.body, rect.x + rect.width / 2, rect.y + rect.height / 2, {}, win);
EventUtils.synthesizeMouseAtCenter(deleteButton, {}, win);
Expand All @@ -91,7 +91,6 @@ function runTest(win, searchTerm, cookies, matches) {

// select two adjacent cells and delete
EventUtils.synthesizeMouse(tree.body, rect.x + rect.width / 2, rect.y + rect.height / 2, {}, win);
deleteButton = win.document.getElementById("removeCookies");
var eventObj = {};
if (navigator.platform.indexOf("Mac") >= 0)
eventObj.metaKey = true;
Expand Down
8 changes: 3 additions & 5 deletions browser/locales/en-US/chrome/browser/preferences/cookies.dtd
Expand Up @@ -7,11 +7,9 @@
<!ENTITY cookiesonsystem.label "The following cookies are stored on your computer:">
<!ENTITY cookiename.label "Cookie Name">
<!ENTITY cookiedomain.label "Site">
<!ENTITY button.removecookies.label "Remove Cookies">
<!ENTITY button.removecookie.label "Remove Cookie">
<!ENTITY button.removecookie.accesskey "R">
<!ENTITY button.removeallcookies.label "Remove All Cookies">
<!ENTITY button.removeallcookies.accesskey "A">
<!ENTITY button.removeSelectedCookies.accesskey "R">
<!ENTITY button.removeAllCookies.label "Remove All">
<!ENTITY button.removeAllCookies.accesskey "A">

<!ENTITY props.name.label "Name:">
<!ENTITY props.value.label "Content:">
Expand Down
Expand Up @@ -92,6 +92,10 @@ cannot=Block
noCookieSelected=<no cookie selected>
cookiesAll=The following cookies are stored on your computer:
cookiesFiltered=The following cookies match your search:
# LOCALIZATION NOTE (removeSelectedCookies):
# Semicolon-separated list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
removeSelectedCookies=Remove Selected;Remove Selected

#### Offline apps
offlineAppsList.height=7em
Expand Down

0 comments on commit 7ebdc17

Please sign in to comment.