afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-12-14 04:39 pm

[dw-free] After marking everything read, inbox count in menu has empty parentheses

[commit: http://hg.dwscoalition.org/dw-free/rev/5f9962fc1e20]

http://bugs.dwscoalition.org/show_bug.cgi?id=2212

Handle parentheses correctly for the inbox count in the Read menu.

Patch by [personal profile] afuna.

Files modified:
  • bin/upgrading/en.dat
  • cgi-bin/DW/Logic/MenuNav.pm
  • htdocs/js/livejournal.js
--------------------------------------------------------------------------------
diff -r 946bc750542f -r 5f9962fc1e20 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Sun Dec 13 17:48:17 2009 +0000
+++ b/bin/upgrading/en.dat	Mon Dec 14 16:39:17 2009 +0000
@@ -2120,7 +2120,7 @@ menunav.read=Read
 
 menunav.read.inbox.nounread=Inbox
 
-menunav.read.inbox.unread=Inbox ([[num]])
+menunav.read.inbox.unread2=Inbox [[num]]
 
 menunav.read.network=Network Page
 
diff -r 946bc750542f -r 5f9962fc1e20 cgi-bin/DW/Logic/MenuNav.pm
--- a/cgi-bin/DW/Logic/MenuNav.pm	Sun Dec 13 17:48:17 2009 +0000
+++ b/cgi-bin/DW/Logic/MenuNav.pm	Mon Dec 14 16:39:17 2009 +0000
@@ -181,8 +181,8 @@ sub get_menu_navigation {
                 },
                 {
                     url => "$LJ::SITEROOT/inbox/",
-                    text => $inbox_count ? "menunav.read.inbox.unread" : "menunav.read.inbox.nounread",
-                    text_opts => { num => "<span id='Inbox_Unread_Count_Menu'>$inbox_count</span>" },
+                    text => $inbox_count ? "menunav.read.inbox.unread2" : "menunav.read.inbox.nounread",
+                    text_opts => { num => "<span id='Inbox_Unread_Count_Menu'> ($inbox_count)</span>" },
                     display => $loggedin,
                 },
             ],
diff -r 946bc750542f -r 5f9962fc1e20 htdocs/js/livejournal.js
--- a/htdocs/js/livejournal.js	Sun Dec 13 17:48:17 2009 +0000
+++ b/htdocs/js/livejournal.js	Mon Dec 14 16:39:17 2009 +0000
@@ -101,10 +101,11 @@ LiveJournal.gotInboxUpdate = function (r
     var unread_menu = $("Inbox_Unread_Count_Menu");
     if (! unread && ! unread_menu) return;
 
+    var unread_count = resp.unread_count? " (" + resp.unread_count + ")" : "";
     if ( unread )
-        unread.innerHTML = resp.unread_count ? "  (" + resp.unread_count + ")" : "";
+        unread.innerHTML = unread_count;
     if ( unread_menu )
-        unread_menu.innerHTML = resp.unread_count ? resp.unread_count : "";
+        unread_menu.innerHTML = unread_count;
 };
 
 // Search for placeholders and initialize them
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org