jaredpavan / OWA-Unread-Message-Count

One of the most annoying things about the Outlook Web App is the fact that you have to navigate to the page's tab to check how many unread messages you have in your inbox. This extension appends the unread message count to the Outlook Web App's tab text.
0 stars 1 forks source link

Add OWA tab favicon including the counter instead of a text counter in the tab title #4

Closed bgillis closed 10 years ago

bgillis commented 10 years ago

My OWA tab is always a pinned tab. So only the tab favicon is visible. Adding the counter in the tab favicon would be then very useful.

Maybe be you could reuse parts of this script: http://userscripts.org/scripts/show/39432. You will have to switch gmail icon with owa icon.

jaredpavan commented 10 years ago

Definitely a good idea as I would like to pin the tab as well. I believe there's a library of favicons for OWA that have the numbers in the corner.

bgillis commented 10 years ago

You can do it without the need of a new favicon for any possible counter value.

This javascript library will do it for you: https://github.com/tommoor/tinycon. In particular: Tinycon.setBubble(6); <- will set the counter to the value '6'.

To avoid charging the favicon to much, I will recommend to use the following value:

        if (count > 98) {
            index = "99+"
        } else if (count > 49) {
            index = "50+"
        } else if (count > 19) {
            index = "20+"
        } else {
            index = count;
        }

By default this library will use '1k' when count > 999.

You can also tune the look and feel with

       Tinycon.setOptions({
          width: 7,
          height: 9,
          font: '10px arial',
          colour: '#ffffff',
          background: '#549A2F',
          fallback: true
      });
jaredpavan commented 10 years ago

Oh wow. That is so damn NEAT! I quickly responded without looking at the first link you sent me, so I apologize for the useless response. I'll work on implementing this! Thanks!

bgillis commented 10 years ago

You are welcome... it is always a pleasure to help when I can ;-) Thanks to you for providing us this little Firefox add-on !

jaredpavan commented 10 years ago

After many struggles I finally got it to work! I had to copy the tinycon.min.js script to my JS in order to get it to work (browser.xul wouldn't read it in for some reason). Anyway, I had it working fine when using a pointer file from my extensions folder, but when packaged and installed via an XPI, it doesn't work. One I get home and can push to GitHub I'll upload all of the files. So close!

bgillis commented 10 years ago

I do not have any experience in Firefox add-on development so I can't really help you in any way. However I would be pleased to be a beta tester as soon as you will have pushed on Github an updated version.

Happy new year and I wish you all the best for 2014 !

jaredpavan commented 10 years ago

Welp, it was due to the combination of my crappy work computer and my idiocy. I packaged the files incorrectly where it wouldn't store the files' paths, so essentially it was storing it like one single folder rather than the folder structure that I set.

Anyway. I'll upload this to Firefox Addons so you should get prompted to update when they approve. I'll also upload all files to the GitHub repo...if I remember this time.

jaredpavan commented 10 years ago

Since it takes 10 damn days for Mozilla to release my updates officially, here's a link to download: https://drive.google.com/file/d/0B77793FqTjKMRE9lYzBMV2tXUGc/edit?usp=sharing

bgillis commented 10 years ago

Awesome ! I've just updated the add-on directly from Mozilla (version 1.2.3). I will test it intensively in the coming days ;-)

Thanks a lot for implementing this feature so fast !