forked from a-sassermann/Roundcube-CardDAV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
carddav_addressbook.js
43 lines (39 loc) · 1.03 KB
/
carddav_addressbook.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Roundcube CardDAV addressbook extension
*
* @author Christian Putzke <[email protected]>
* @copyright Christian Putzke @ Graviox Studios
* @since 22.09.2011
* @link http://www.graviox.de/
* @link https://twitter.com/graviox/
* @version 0.5.1
* @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*
*/
if (window.rcmail)
{
rcmail.addEventListener('init', function(evt)
{
rcmail.enable_command('plugin.carddav-addressbook-sync', true);
rcmail.addEventListener('plugin.carddav_addressbook_message', carddav_addressbook_message);
rcmail.register_command('plugin.carddav-addressbook-sync', function()
{
rcmail.http_post(
'plugin.carddav-addressbook-sync',
'',
rcmail.display_message(rcmail.gettext('addressbook_sync_loading', 'carddav'), 'loading')
);
}, true);
});
function carddav_addressbook_message(response)
{
if (response.check)
{
rcmail.display_message(response.message, 'confirmation');
}
else
{
rcmail.display_message(response.message, 'error');
}
}
}