mirror of
https://github.com/Saiyan/rc-unread_favicon.git
synced 2026-02-14 00:28:38 +01:00
init
This commit is contained in:
14
composer.json
Normal file
14
composer.json
Normal 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
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
22
unread_favicon.js
Normal 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
22
unread_favicon.php
Normal 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');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user