I'm working on a MobileMe userscript that allows Fluid to recognize
how many new messages there are.  The only problem is that when
somebody clicks the New Message button, a popup opens to compose that
message and the notification bubble goes away until the user refreshes
the main mail page.  I hope that the fluidapp group has some
javascript junkies.  Here's the code:

// ==UserScript==
// @name        MobileMe Badge
// @namespace   http://fluidapp.com
// @description What does this do?
// @include       https://www.me.com/mail/
// @exclude               https://www.me.com/contacts/
// @exclude               https://www.me.com/calendar/
// @exclude               https://www.me.com/gallery/
// @exclude               https://www.me.com/idisk/
// @exclude               https://www.me.com/find/
// @exclude           https://auth.me.com/*
// @exclude           https://secure.me.com/*
// @exclude     https://www.me.com/mail/message/en/#compose
// @author      Paul
// ==/UserScript==

(function () {
    if (window.fluid) {
                //startedit
                function dockBadgeGet(){
                        var t = document.title;
                        var upos = t.indexOf("unread");
                        if(upos != -1){
                                upos = upos - 1;
                                t2 = t.slice(0, upos);
                                cpos = t2.indexOf("messages, ") + 10;
                                f = t2.substr(cpos);
                                window.fluid.dockBadge = f;
                        }
                }
                window.onload=function(){
                        dockBadgeGet();
                        setInterval("dockBadgeGet()", 5000);
                }
                //endedit
    }
})();


BTW I extract the number of new messages from the title, which is
usually like this: "MobileMe Mail - Inbox (1000 messages, 10 unread)"

-- 
You received this message because you are subscribed to the Google Groups 
"fluidapp" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fluidapp?hl=en.

Reply via email to