/** * New Mail Notifier plugin script * * @author Aleksander Machniak * * @licstart The following is the entire license notice for the * JavaScript code in this file. * * Copyright (c) 2013-2016, The Roundcube Dev Team * * The JavaScript code in this page is free software: you can redistribute it * and/or modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * @licend The above is the entire license notice * for the JavaScript code in this file. */ window.rcmail&&"mail"==rcmail.env.task&&rcmail.addEventListener("plugin.newmail_notifier",newmail_notifier_run).addEventListener("actionbefore",newmail_notifier_stop).addEventListener("init",function(){rcmail.message_list&&rcmail.message_list.addEventListener("select",newmail_notifier_stop)});function newmail_notifier_run(a){a.basic&&newmail_notifier_basic();a.sound&&newmail_notifier_sound();a.desktop&&newmail_notifier_desktop(rcmail.get_label("body","newmail_notifier"))} function newmail_notifier_stop(a){!rcmail.env.favicon_href||!rcmail.env.favicon_changed||a&&"check-recent"==a.action||($('').replaceAll('link[rel="shortcut icon"]'),rcmail.env.favicon_changed=0);try{window.external.msIsSiteMode()&&window.external.msSiteModeClearIconOverlay()}catch(b){}} function newmail_notifier_basic(){var a=rcmail.is_framed()?window.parent:window,b=rcmail.assets_path("plugins/newmail_notifier");a.focus();var c=$('').attr("href",b+"/favicon.ico"),a=$('link[rel="shortcut icon"]',a.document);rcmail.env.favicon_href||(rcmail.env.favicon_href=a.attr("href"));rcmail.env.favicon_changed=1;c.replaceAll(a);try{window.external.msIsSiteMode()&&window.external.msSiteModeSetIconOverlay(b+"/overlay.ico",rcmail.get_label("title","newmail_notifier"))}catch(d){}} function newmail_notifier_sound(){var a,b=rcmail.assets_path("plugins/newmail_notifier/sound"),c=navigator.mimeTypes?navigator.mimeTypes["audio/mp3"]:{},b=b+(bw.ie||c&&c.enabledPlugin?".mp3":".wav");try{a=$("