-
Notifications
You must be signed in to change notification settings - Fork 35
/
filters.js
37 lines (27 loc) · 1.13 KB
/
filters.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
/**
* Filters
*
* Plugin that adds a new tab to the settings section to create client-side e-mail filtering.
*
* @version 2.1.4
* @author Roberto Zarrelli <[email protected]>
* @developer Artur Petrov <[email protected]>
*/
if (window.rcmail) {
rcmail.addEventListener('init', function(evt) {
var tab = $('<span>').attr('id', 'settingstabpluginfilters').addClass('tablink');
var button = $('<a>').attr('href', rcmail.env.comm_path+'&_action=plugin.filters').html(rcmail.gettext('filters', 'filters')).appendTo(tab);
// add button and register command
rcmail.add_element(tab, 'tabs');
rcmail.register_command('plugin.filters-delete', function(){ rcmail.goto_url('plugin.filters-delete') }, true);
rcmail.register_command('plugin.filters-save', function(){
var input_searchstring = rcube_find_object('_searchstring');
if (input_searchstring && input_searchstring.value=='') {
alert(rcmail.gettext('nosearchstring','filters'));
input_searchstring.focus();
}
else
rcmail.gui_objects.filtersform.submit();
}, true);
})
}