pax_global_header00006660000000000000000000000064136123261560014517gustar00rootroot0000000000000052 comment=c87b0be41384134dac2ad1f32c0c92f74547f049 html5_notifier-0.6.4/000077500000000000000000000000001361232615600144565ustar00rootroot00000000000000html5_notifier-0.6.4/.gitignore000066400000000000000000000000271361232615600164450ustar00rootroot00000000000000/config/config.inc.php html5_notifier-0.6.4/LICENSE000066400000000000000000000014361361232615600154670ustar00rootroot00000000000000/* * Copyright (c) 2013 Tilman Stremlau * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ html5_notifier-0.6.4/README.md000066400000000000000000000006201361232615600157330ustar00rootroot00000000000000![ScreenShot](/screenshot.png) HTML5_Notifier is a Roundcube plugin. It displays Desktop Notifications like the ones you might know from Google Mail. Just keep Roundcube opened in a (minimized) tab and enjoy getting notifications every time a new mail arrives. It just works in modern browsers like Google Chrome, SRWare Iron or Firefox, because "Desktop Notification" is a new feature in HTML5. html5_notifier-0.6.4/changelog.txt000066400000000000000000000005211361232615600171440ustar00rootroot000000000000000.2 - added Listbox to select showing duration - added color to browser-conf-button 0.3 - updated to work with roundcube 0.8 and 0.9 - added display of mailbox 0.4 - updated to work with Firefox and the new Notification API - fixed UTF-8 issues 0.5 (thanks to nicolas-joubert!) - add ability to exclude some directories html5_notifier-0.6.4/composer.json000066400000000000000000000014311361232615600171770ustar00rootroot00000000000000{ "name": "kitist/html5_notifier", "type": "roundcube-plugin", "description": "Desktop Notifications for Roundcube", "keywords": ["notification","desktop","mail"], "homepage": "https://github.com/kitist/html5_notifier", "license": "GPL-3.0+", "authors": [ { "name": "Tilman Stremlau", "email": "tilman@stremlau.net", "homepage": "http://stremlau.net", "role": "Developer" } ], "repositories": [ { "type": "composer", "url": "http://plugins.roundcube.net" } ], "require": { "php": ">=5.3.0", "roundcube/plugin-installer": ">=0.1.3" }, "extra": { "roundcube": { "min-version": "0.8.0" } } } html5_notifier-0.6.4/config/000077500000000000000000000000001361232615600157235ustar00rootroot00000000000000html5_notifier-0.6.4/config/config.inc.php.dist000066400000000000000000000006211361232615600214120ustar00rootroot00000000000000 * @website stremlau.net/html5_notifier * @licence GNU GPL * **/ function rcmail_show_notification(message) { if (use_notifications) { if ("Notification" in window) { var notification = new Notification(rcmail.gettext('notification_title', 'html5_notifier').replace('[from]', message.from), { icon: './plugins/html5_notifier/images/new_mail.png', body: message.subject }); notification.onclick = function() { if(message.opentype == '1') { rcmail.open_window('?_task=mail&_action=show&_uid='+message.uid); } else { window.open('?_task=mail&_action=show&_extwin=1&_uid='+message.uid); } } if (parseInt(message.duration) > 0) { setTimeout(function(){ notification.close(); }, (parseInt(message.duration)*1000)); } } } } function rcmail_browser_notifications() { if ("Notification" in window && Notification.permission) { if (Notification.permission === "granted") { rcmail.display_message(rcmail.gettext('ok_notifications', 'html5_notifier'), 'notice'); } else { Notification.requestPermission(rcmail_check_notifications); } } else if (window.webkitNotifications) { if (window.webkitNotifications.checkPermission() == 0) { rcmail.display_message(rcmail.gettext('ok_notifications', 'html5_notifier'), 'notice'); } else { window.webkitNotifications.requestPermission(rcmail_check_notifications); } } else { rcmail.display_message(rcmail.gettext('no_notifications', 'html5_notifier'), 'error'); } } function rcmail_browser_notifications_test() { if (use_notifications) { rcmail.display_message(rcmail.gettext('check_ok', 'html5_notifier'), 'notice'); var message = new Object(); message.duration = 8; message.uid = 0; message.subject = 'It Works!'; message.from = 'TESTMAN'; message.opentype = $('select[name=_html5_notifier_popuptype]').val(); rcmail_show_notification(message); } else { if ("Notification" in window && Notification.permission) { if (Notification.permission == 'denied') { rcmail.display_message(rcmail.gettext('check_fail_blocked', 'html5_notifier'), 'error'); return false; } } else if (window.webkitNotifications) { if (window.webkitNotifications.checkPermission() == 2) { rcmail.display_message(rcmail.gettext('check_fail_blocked', 'html5_notifier'), 'error'); return false; } } rcmail.display_message(rcmail.gettext('check_fail', 'html5_notifier'), 'error'); } } function rcmail_browser_notifications_colorate() { if ("Notification" in window && Notification.permission) { var broco = $('#rcmfd_html5_notifier_browser_conf'); if (broco) { switch (Notification.permission) { case 'granted': broco.css('color', 'green'); break; case 'default': broco.css('color', 'orange'); break; case 'denied': broco.css('color', 'red'); break; } } } else if (window.webkitNotifications) { var broco = $('#rcmfd_html5_notifier_browser_conf'); if (broco) { switch (window.webkitNotifications.checkPermission()) { case 0: broco.css('color', 'green'); break; case 1: broco.css('color', 'orange'); break; case 2: broco.css('color', 'red'); break; } } } } var use_notifications = false; var rcmail_check_notifications = function(e) { if ("Notification" in window && Notification.permission) { if (Notification.permission === "granted") { use_notifications = true; } } else if (window.webkitNotifications) { if (window.webkitNotifications.checkPermission() == 0) { use_notifications = true; } } rcmail_browser_notifications_colorate(); } if (window.rcmail) { rcmail.addEventListener('plugin.showNotification', rcmail_show_notification); rcmail.addEventListener('init', rcmail_check_notifications); } html5_notifier-0.6.4/html5_notifier.php000066400000000000000000000157311361232615600201260ustar00rootroot00000000000000 * @website stremlau.net/html5_notifier * @licence GNU GPL * **/ class html5_notifier extends rcube_plugin { public $task = '?(?!login|logout).*'; function init() { $RCMAIL = rcmail::get_instance(); if(file_exists("./plugins/html5_notifier/config/config.inc.php")) { $this->load_config('config/config.inc.php'); } $this->add_hook('preferences_list', array($this, 'prefs_list')); $this->add_hook('preferences_save', array($this, 'prefs_save')); if ($RCMAIL->config->get('html5_notifier_duration').'' != '0') { $this->add_hook('new_messages', array($this, 'show_notification')); } $this->include_script("html5_notifier.js"); if ($RCMAIL->action != 'check-recent') { $this->add_texts('localization', array('notification_title', 'ok_notifications', 'no_notifications', 'check_ok', 'check_fail', 'check_fail_blocked')); //PR�ZESIEREN } } function show_notification($args) { $RCMAIL = rcmail::get_instance(); //$search = $RCMAIL->config->get('html5_notifier_only_new', false) ?'NEW' : 'RECENT'; $deleted = $RCMAIL->config->get('skip_deleted') ? 'UNDELETED ' : ''; $search = $deleted . 'UNSEEN UID ' . $args['diff']['new']; $RCMAIL->storage->set_folder($args['mailbox']); $RCMAIL->storage->search($args['mailbox'], $search, null); $msgs = (array) $RCMAIL->storage->list_messages($args['mailbox']); $excluded_directories = preg_split("/(,|;| )+/", $RCMAIL->config->get('html5_notifier_excluded_directories')); foreach ($msgs as $msg) { $from = $msg->get('from'); $mbox = ''; switch ($RCMAIL->config->get('html5_notifier_smbox')) { case 1: $mbox = array_pop(explode('.', str_replace('INBOX.', '', $args['mailbox']))); break; case 2: $mbox = str_replace('.', '/', str_replace('INBOX.', '', $args['mailbox'])); break; } $subject = ((!empty($mbox)) ? rcube_charset::convert($mbox, 'UTF7-IMAP') . ': ' : '') . $msg->get('subject'); if(strtolower($_SESSION['username']) == strtolower($RCMAIL->user->data['username']) && !in_array($args['mailbox'], $excluded_directories)) { $RCMAIL->output->command("plugin.showNotification", array( 'duration' => $RCMAIL->config->get('html5_notifier_duration'), 'opentype' => $RCMAIL->config->get('html5_notifier_popuptype'), 'subject' => $subject, 'from' => $from, 'uid' => $msg->uid.'&_mbox='.$args['mailbox'], )); } } $RCMAIL->storage->search($args['mailbox'], "ALL", null); } function prefs_list($args) { if($args['section'] == 'mailbox') { $RCMAIL = rcmail::get_instance(); $field_id = 'rcmfd_html5_notifier'; $select_duration = new html_select(array('name' => '_html5_notifier_duration', 'id' => $field_id)); $select_duration->add($this->gettext('off'), '0'); $times = array('3', '5', '8', '10', '12', '15', '20', '25', '30'); foreach ($times as $time) $select_duration->add($time.' '.$this->gettext('seconds'), $time); $select_duration->add($this->gettext('durable'), '-1'); $select_smbox = new html_select(array('name' => '_html5_notifier_smbox', 'id' => $field_id)); $select_smbox->add($this->gettext('no_mailbox'), '0'); $select_smbox->add($this->gettext('short_mailbox'), '1'); $select_smbox->add($this->gettext('full_mailbox'), '2'); $content = $select_duration->show($RCMAIL->config->get('html5_notifier_duration').''); $content .= $select_smbox->show($RCMAIL->config->get('html5_notifier_smbox').''); $content .= html::a(array('href' => '#', 'id' => 'rcmfd_html5_notifier_browser_conf', 'onclick' => 'rcmail_browser_notifications(); return false;'), $this->gettext('conf_browser')).' '; $content .= html::a(array('href' => '#', 'onclick' => 'rcmail_browser_notifications_test(); return false;'), $this->gettext('test_browser')); $args['blocks']['new_message']['options']['html5_notifier'] = array( 'title' => html::label($field_id, rcube::Q($this->gettext('shownotifies'))), 'content' => $content, ); $check_only_new = new html_checkbox(array('name' => '_html5_notifier_only_new', 'id' => $field_id . '_only_new', 'value' => 1)); $content = $check_only_new->show($RCMAIL->config->get('html5_notifier_only_new', false)); $args['blocks']['new_message']['options']['html5_notifier_only_new'] = array( 'title' => html::label($field_id, rcube::Q($this->gettext('onlynew'))), 'content' => $content, ); $input_excluded = new html_inputfield(array('name' => '_html5_notifier_excluded_directories', 'id' => $field_id . '_excluded')); $args['blocks']['new_message']['options']['html5_notifier_excluded_directories'] = array( 'title' => html::label($field_id, rcube::Q($this->gettext('excluded_directories'))), 'content' => $input_excluded->show($RCMAIL->config->get('html5_notifier_excluded_directories').''), ); $select_type = new html_select(array('name' => '_html5_notifier_popuptype', 'id' => $field_id . '_popuptype')); $select_type->add($this->gettext('new_tab'), '0'); $select_type->add($this->gettext('new_window'), '1'); $args['blocks']['new_message']['options']['html5_notifier_popuptype'] = array( 'title' => html::label($field_id, rcube::Q($this->gettext('notifier_popuptype'))), 'content' => $select_type->show($RCMAIL->config->get('html5_notifier_popuptype').'') ); $RCMAIL->output->add_script("$(document).ready(function(){ rcmail_browser_notifications_colorate(); });"); } return $args; } function prefs_save($args) { if($args['section'] == 'mailbox') { $args['prefs']['html5_notifier_only_new'] = !empty($_POST['_html5_notifier_only_new']); $args['prefs']['html5_notifier_duration'] = rcube_utils::get_input_value('_html5_notifier_duration', rcube_utils::INPUT_POST); $args['prefs']['html5_notifier_smbox'] = rcube_utils::get_input_value('_html5_notifier_smbox', rcube_utils::INPUT_POST); $args['prefs']['html5_notifier_excluded_directories'] = rcube_utils::get_input_value('_html5_notifier_excluded_directories', rcube_utils::INPUT_POST); $args['prefs']['html5_notifier_popuptype'] = rcube_utils::get_input_value('_html5_notifier_popuptype', rcube_utils::INPUT_POST); return $args; } } } ?> html5_notifier-0.6.4/images/000077500000000000000000000000001361232615600157235ustar00rootroot00000000000000html5_notifier-0.6.4/images/new_mail.png000066400000000000000000000030661361232615600202310ustar00rootroot00000000000000PNG  IHDR ꂣAsRGBbKGD pHYs  tIME$,RiTXtCommentCreated with GIMPd.eIDATHMl\Ws;w<=v6vR7JQZ\GMTTvPu+`H "*UHIIҀik1r8xx~9a1cg,~6&stysq>@וs/hWޛ>Ăs}{g==f_>$1W^eWߋ &jg ŝw8J{h?@鮲7^) .^Ai$iIclcӨ;4FLw,i%Wp xA+Npαv׬+? Iw2V}%qsJxAjL4> nrg G>KcWݗ3q"6 &Avb:qEoߤ495}bpbR|4w^'bo33tqtbfgvsUJ<?܇RY~ȁ  ## "6A+7Em3Y^[2g='!&](=L$un^ &Y48G H:q }RUNp :,_1c'>ElfkÃM7a)P{, Z{݇bRĚ'd #kslx S:v}c4ז؜H5I)BXDLR!4*`ۮMm$#iՉ6W/cKܞ-SH#'+U\v8Ark]":KOZHuMqbĵ2iAၣ html5_notifier-0.6.4/localization/de_DE.inc000066400000000000000000000025551361232615600206100ustar00rootroot00000000000000 html5_notifier-0.6.4/localization/en_US.inc000066400000000000000000000023301361232615600206500ustar00rootroot00000000000000 html5_notifier-0.6.4/localization/es_ES.inc000066400000000000000000000022541361232615600206420ustar00rootroot00000000000000 html5_notifier-0.6.4/localization/fr_FR.inc000066400000000000000000000023541361232615600206430ustar00rootroot00000000000000 html5_notifier-0.6.4/localization/it_IT.inc000066400000000000000000000020611361232615600206500ustar00rootroot00000000000000 html5_notifier-0.6.4/localization/ja_JP.inc000066400000000000000000000024671361232615600206350ustar00rootroot00000000000000 html5_notifier-0.6.4/localization/nl_NL.inc000066400000000000000000000020611361232615600206420ustar00rootroot00000000000000 html5_notifier-0.6.4/localization/pl_PL.inc000066400000000000000000000025371361232615600206560ustar00rootroot00000000000000 html5_notifier-0.6.4/localization/ru_RU.inc000066400000000000000000000035421361232615600207010ustar00rootroot00000000000000 html5_notifier-0.6.4/localization/sk_SK.inc000066400000000000000000000022121361232615600206500ustar00rootroot00000000000000 html5_notifier-0.6.4/localization/zh_CN.inc000066400000000000000000000021131361232615600206370ustar00rootroot00000000000000 html5_notifier-0.6.4/screenshot.png000066400000000000000000000217031361232615600173440ustar00rootroot00000000000000PNG  IHDRRt{WsRGB pHYs  tIMEJ@bhiTXtCommentCreated with GIMPd.e IDATx{|ǟ33{\aw !xڍP6"/ZZ}[_xmI/֨ڷ&WU%*^JQAB"v1&$+A'33y93 w19,A9@#A= ({APA#Ge A= ({APA#G= ({APA#Ge A= ({APA#Ge ({APA#Ge A= ({AP H1vݻw744,q:555G#h0aW_mX!~%^wD5o~ߘ:ujjj*V[n5k7MˆjСCM&))))))_:ujvvvTQY#HO?3UfzYeYR]KRRĉ%I BGݽ{;L7AX.nA'''766 -ǏBq+| ͮ]jkkEQliiaiZN ٳgϾ}ԯOW˥q.pؗ33c|62dj9v5MRR!㸁zSLimm=z^۝=qs^K5L] ;;)<1AjjjBдigz=89afms nkYX<\Z-@k:}iwm^wOs[#%ga=^Fh#,,o9wـ  z>//MMMz8A/6־,+.纵f.+.89]`m~q|gpAܫolXVlpm.).*t`h/h`vq k]g,+.sӓ2/EW-88qI z3OBnꪫn{<ٳGQ Y}{ddfδe@FFfk9 4dWزs{<ρ9]<}meq46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