Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix accept-cookies-from-sites options + fix tooltips for options + re…

…move ... from labels
  • Loading branch information...
commit 4008e3bbc5f0a2a4c6ba86f6b320bd11ccac33a5 1 parent b57bd20
Jan Odvarko authored June 08, 2012
11  extension/content/firebug/cookies/cookiePanel.js
@@ -44,9 +44,6 @@ const removeConfirmation = "cookies.removeConfirmation";
44 44
 // Services
45 45
 var cookieManager = Xpcom.CCSV("@mozilla.org/cookiemanager;1", "nsICookieManager2");
46 46
 
47  
-const networkPrefDomain = "network.cookie";
48  
-const cookieBehaviorPref = "cookieBehavior";
49  
-
50 47
 // ********************************************************************************************* //
51 48
 // Panel Implementation
52 49
 
@@ -294,13 +291,13 @@ FireCookiePanel.prototype = Obj.extend(Firebug.ActivablePanel,
294 291
     {
295 292
         return [
296 293
             MenuUtils.optionAllowGlobally(context, "firecookie.AllowGlobally",
297  
-                networkPrefDomain, cookieBehaviorPref),
  294
+                "firecookie.tip.AllowGlobally", "network.cookie", "cookieBehavior"),
298 295
             /*MenuUtils.optionMenu(context, "cookies.clearWhenDeny",
299  
-                Firebug.prefDomain, clearWhenDeny),*/
  296
+                "cookies.tip.clearWhenDeny", Firebug.prefDomain, clearWhenDeny),*/
300 297
             MenuUtils.optionMenu(context, "firecookie.LogEvents",
301  
-                Firebug.prefDomain, logEventsPref),
  298
+                "firecookie.tip.LogEvents", Firebug.prefDomain, logEventsPref),
302 299
             MenuUtils.optionMenu(context, "firecookie.Confirm cookie removal",
303  
-                Firebug.prefDomain, removeConfirmation)
  300
+                "firecookie.tip.Confirm cookie removal", Firebug.prefDomain, removeConfirmation)
304 301
         ];
305 302
     },
306 303
 
38  extension/content/firebug/cookies/menuUtils.js
@@ -3,44 +3,52 @@
3 3
 define([
4 4
     "firebug/lib/object",
5 5
     "firebug/lib/options",
6  
-    "firebug/lib/locale",
7 6
 ],
8  
-function(Obj, Options, Locale) {
  7
+function(Obj, Options) {
9 8
 
10 9
 // ********************************************************************************************* //
11 10
 // Menu Utils
12 11
 
13 12
 var MenuUtils = 
14 13
 {
15  
-    optionMenu: function(context, label, domain, option)
  14
+    optionMenu: function(context, label, tooltiptext, domain, option)
16 15
     {
17  
-        var value = Options.get(option);
18  
-        return { label: Locale.$STR(label), nol10n: true, type: "checkbox", checked: value,
19  
-            command: Obj.bindFixed(MenuUtils.setPref, this, domain, option, !value) };
  16
+        var value = Options.getPref(domain, option);
  17
+        return {
  18
+            label: label,
  19
+            tooltiptext: tooltiptext,
  20
+            type: "checkbox",
  21
+            checked: value,
  22
+            command: Obj.bindFixed(this.setPref, this, domain, option, !value)
  23
+        };
20 24
     },
21 25
 
22  
-    optionAllowGlobally: function(context, label, domain, option)
  26
+    optionAllowGlobally: function(context, label, tooltiptext, domain, option)
23 27
     {
24  
-        var value = Options.get(option) == 0;
25  
-        return { label: Locale.$STR(label), nol10n: true, type: "checkbox",
  28
+        var value = Options.getPref(domain, option) == 0;
  29
+        return {
  30
+            label: label,
  31
+            tooltiptext: tooltiptext,
  32
+            type: "checkbox",
26 33
             checked: value,
27  
-            command: Obj.bindFixed(this.onAllowCookie, this, domain, option)}
  34
+            command: Obj.bindFixed(this.onAllowCookie, this, domain, option)
  35
+        }
28 36
     },
29 37
 
30 38
     // Command handlers
31 39
     onAllowCookie: function(domain, option)
32 40
     {
33  
-        var value = Options.get(option);
  41
+        var value = Options.getPref(domain, option);
34 42
         switch (value)
35 43
         {
36 44
             case 0: // accept all cookies by default
37  
-            Options.set(option, 2);
  45
+            Options.setPref(domain, option, 2);
38 46
             return;
39 47
 
40 48
             case 1: // only accept from the originating site (block third party cookies)
41 49
             case 2: // block all cookies by default;
42 50
             case 3: // use p3p settings
43  
-            Options.set(option, 0);
  51
+            Options.setPref(domain, option, 0);
44 52
             return;
45 53
         } 
46 54
     },
@@ -49,9 +57,9 @@ var MenuUtils =
49 57
     {
50 58
     },
51 59
 
52  
-    setPref: function(prefDomain, name, value)
  60
+    setPref: function(domain, name, value)
53 61
     {
54  
-        Options.set(name, value);
  62
+        Options.setPref(domain, name, value);
55 63
     }
56 64
 };
57 65
 
24  extension/locale/en-US/cookies.properties
@@ -8,13 +8,16 @@ firecookie.Panel=Cookies
8 8
 # LOCALIZATION NOTE (firecookie.Session): Label used to mark session cookies.
9 9
 firecookie.Session=Session
10 10
 
11  
-# LOCALIZATION NOTE (firecookie.AllowGlobally): Label used for cookies permission.
  11
+# LOCALIZATION NOTE (firecookie.AllowGlobally, firecookie.tip.AllowGlobally):
  12
+# Label used for cookies permission.
12 13
 firecookie.AllowGlobally=Accept cookies from sites
  14
+firecookie.tip.AllowGlobally=Accept all cookies by default or block all cookies by default
13 15
 
14  
-# LOCALIZATION NOTE (firecookie.LogEvents): Label used in Cookies panel options menu (the
15  
-# small arrow next to the Cookies panel label). If checked, various cookies events are
16  
-# displayed in Firebug's Console panel.
  16
+# LOCALIZATION NOTE (firecookie.LogEvents, firecookie.tip.LogEvents):
  17
+# Label used in Cookies panel options menu (the small arrow next to the Cookies panel label).
  18
+# If checked, various cookies events are displayed in Firebug's Console panel.
17 19
 firecookie.LogEvents=Show logs in console
  20
+firecookie.tip.LogEvents=Use to display various cookie events (changed, deleted) in the Console panel
18 21
 
19 22
 # LOCALIZATION NOTE (firecookie.clearWhenDeny): Label used in Cookies panel options menu (the
20 23
 # small arrow next to the Cookies panel label). If checked, cookies are automatically removed
@@ -82,6 +85,7 @@ firecookie.msg.Do_not_show_this_message_again=Do not show this message again
82 85
 # LOCALIZATION NOTE (firecookie.Confirm_cookie_removal): A label used for option (mini tab menu)
83 86
 # that says whether a confirmation dialog is displayed when removing cookies. 
84 87
 firecookie.Confirm_cookie_removal=Confirm cookie removal
  88
+firecookie.tip.Confirm_cookie_removal=If checked, there is a confirmation dialog displayed before deleting all cookies in the list.
85 89
 
86 90
 # LOCALIZATION NOTE (firecookie.removeall.tooltip): A tooltip for Cookies->Remove Cookies menu
87 91
 firecookie.removeall.tooltip=Remove all cookies in the list.
@@ -205,7 +209,7 @@ firecookie.header.size.tooltip=Size of the stored cookie
205 209
 firecookie.header.path.tooltip=Directory where the cookie is active
206 210
 firecookie.header.expires.tooltip=Expiration date for the cookie
207 211
 firecookie.header.security.tooltip=Shows whether it is a secure cookie or not
208  
-firecookie.header.status.tooltip=Status of the cookie (downgraded, flagged...)
  212
+firecookie.header.status.tooltip=Status of the cookie (downgraded, flagged, etc.)
209 213
 firecookie.header.httponly.tooltip=Shows if the cookie is an HTTP only cookie
210 214
 
211 215
 # LOCALIZATION NOTE (firecookie.netinfo.Received_Cookies, firecookie.netinfo.Sent_Cookies):
@@ -225,9 +229,9 @@ firecookie.menu.Cookies=Cookies
225 229
 # LOCALIZATION NOTE (firecookie.export.Export_All_Cookies, firecookie.export.Export_All_Cookies_Tooltip,
226 230
 # firecookie.export.Export_For_Site, firecookie.export.Export_For_Site_Tooltip): Labels and 
227 231
 # tooltips for exporting menus available under Cookies menus.
228  
-firecookie.export.Export_All_Cookies=Export All Cookies...
  232
+firecookie.export.Export_All_Cookies=Export All Cookies
229 233
 firecookie.export.Export_All_Cookies_Tooltip=Export all browser cookies into cookies.txt file
230  
-firecookie.export.Export_For_Site=Export Cookies For This Site...
  234
+firecookie.export.Export_For_Site=Export Cookies For This Site
231 235
 firecookie.export.Export_For_Site_Tooltip=Export cookies for %S into cookies.txt file
232 236
 
233 237
 # LOCALIZATION NOTE (firecookie.message.There_is_no_active_page): An error message displayed
@@ -272,20 +276,20 @@ firecookie.ToolsTooltip=Tools
272 276
 
273 277
 # LOCALIZATION NOTE (firecookie.ViewAll, firecookie.ViewAllTooltip) Label and tooltip for
274 278
 # view all cookies menu item (Tools menu). This action opens Firefox built-in cookie manager window.
275  
-firecookie.ViewAll=Show All Cookies...
  279
+firecookie.ViewAll=Show All Cookies
276 280
 firecookie.ViewAllTooltip=Open Cookie Manager
277 281
 
278 282
 # LOCALIZATION NOTE (firecookie.ViewExceptions, firecookie.ViewExceptionsTooltip) Label and
279 283
 # tooltip for Site Permissions menu item (Tools menu). This action opens Firefox built-in
280 284
 # dialog for setting web site cookie permissions.
281  
-firecookie.ViewExceptions=Web Sites Permissions...
  285
+firecookie.ViewExceptions=Web Sites Permissions
282 286
 firecookie.ViewExceptionsTooltip=View list of allowed or prohibited web sites
283 287
 
284 288
 # LOCALIZATION NOTE (firecookie.Help, firecookie.HelpTooltip, firecookie.About,
285 289
 # firecookie.AboutTooltip) Labels and tooltips for additional menu items in Tools menu.
286 290
 firecookie.Help=Help
287 291
 firecookie.HelpTooltip=Help for Firecookie
288  
-firecookie.About=About...
  292
+firecookie.About=About
289 293
 firecookie.AboutTooltip=About Firecookie
290 294
 
291 295
 # LOCALIZATION NOTE (firecookie.Filter, firecookie.FilterTooltip, firecookie.filter.byPath,

0 notes on commit 4008e3b

Please sign in to comment.
Something went wrong with that request. Please try again.