1
0
mirror of https://github.com/Saiyan/rc-unread_favicon.git synced 2026-02-14 00:28:38 +01:00
This commit is contained in:
2016-05-24 10:55:44 +02:00
parent 7833afec1f
commit 31a0666fdb
4 changed files with 65 additions and 0 deletions

14
composer.json Normal file
View File

@@ -0,0 +1,14 @@
{
"name": "saiyan/unread_favicon",
"type": "roundcube-plugin",
"license": "MIT",
"repositories": [
{
"type": "composer",
"url": "https://plugins.roundcube.net"
}
],
"require": {
"roundcube/plugin-installer": ">=0.1.3"
}
}

7
favico-0.3.10.min.js vendored Normal file

File diff suppressed because one or more lines are too long

22
unread_favicon.js Normal file
View File

@@ -0,0 +1,22 @@
function updateFavicon(){
var count = 0;
$('.unreadcount').each(function(){
var c = parseInt($(this).text());
if(c && !isNaN(c)){
count += c;
}
});
if(count !== last)
favicon.badge(count);
}
/*****************************/
var last = -1;
var favicon=new Favico({
animation:'pop'
});
window.setInterval(updateFavicon, 10000);

22
unread_favicon.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
/**
* Unread Favivon
*
* Shows the number of unread Emails inside the favicon
*
* @version 1.0
* @author Christian Sucker
* @url http://roundcube.net/plugins/unread_favicon
*/
class unread_favicon extends rcube_plugin
{
public $task = 'mail';
private $map;
function init()
{
$this->include_script('favico-0.3.10.min.js');
$this->include_script('unread_favicon.js');
}
}