|
|
@ -608,6 +608,7 @@ function rule_header_select(id)
|
|
|
|
comp = document.getElementById('rule_comp' + id),
|
|
|
|
comp = document.getElementById('rule_comp' + id),
|
|
|
|
datepart = document.getElementById('rule_date_part' + id),
|
|
|
|
datepart = document.getElementById('rule_date_part' + id),
|
|
|
|
dateheader = document.getElementById('rule_date_header_div' + id),
|
|
|
|
dateheader = document.getElementById('rule_date_header_div' + id),
|
|
|
|
|
|
|
|
rule = $('#rule_op' + id),
|
|
|
|
h = obj.value;
|
|
|
|
h = obj.value;
|
|
|
|
|
|
|
|
|
|
|
|
if (h == 'size') {
|
|
|
|
if (h == 'size') {
|
|
|
@ -634,11 +635,14 @@ function rule_header_select(id)
|
|
|
|
if (dateheader)
|
|
|
|
if (dateheader)
|
|
|
|
dateheader.style.display = h == 'date' ? '' : 'none';
|
|
|
|
dateheader.style.display = h == 'date' ? '' : 'none';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('[value="exists"],[value="notexists"]', rule).prop('disabled', h == 'string');
|
|
|
|
|
|
|
|
if (!rule.val() || rule.val().match(/^(exists|notexists)$/))
|
|
|
|
|
|
|
|
rule.val('contains');
|
|
|
|
|
|
|
|
|
|
|
|
rule_op_select(op, id, h);
|
|
|
|
rule_op_select(op, id, h);
|
|
|
|
rule_mod_select(id, h);
|
|
|
|
rule_mod_select(id, h);
|
|
|
|
|
|
|
|
|
|
|
|
if (h == '...') obj.style.width = '40px';
|
|
|
|
obj.style.width = h == '...' ? '40px' : '';
|
|
|
|
else if (h == 'string') obj.style.width = '90px';
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function rule_op_select(obj, id, header)
|
|
|
|
function rule_op_select(obj, id, header)
|
|
|
@ -904,24 +908,27 @@ function sieve_formattime(hour, minutes)
|
|
|
|
|
|
|
|
|
|
|
|
function sieve_form_init()
|
|
|
|
function sieve_form_init()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// small resize for header element
|
|
|
|
var form = rcmail.gui_objects.sieveform;
|
|
|
|
$('select[name="_header[]"]', rcmail.gui_objects.sieveform).each(function() {
|
|
|
|
|
|
|
|
if (this.value == '...') this.style.width = '40px';
|
|
|
|
|
|
|
|
if (this.value == 'string') this.style.width = '90px';
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// resize dialog window
|
|
|
|
// resize dialog window
|
|
|
|
if (rcmail.env.action == 'plugin.managesieve' && rcmail.env.task == 'mail') {
|
|
|
|
if (rcmail.env.action == 'plugin.managesieve' && rcmail.env.task == 'mail') {
|
|
|
|
parent.rcmail.managesieve_dialog_resize(rcmail.gui_objects.sieveform);
|
|
|
|
parent.rcmail.managesieve_dialog_resize(form);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$('input[type="text"]:first', rcmail.gui_objects.sieveform).focus();
|
|
|
|
$('input[type="text"]:first', form).focus();
|
|
|
|
|
|
|
|
|
|
|
|
// initialize smart list inputs
|
|
|
|
// initialize smart list inputs
|
|
|
|
$('textarea[data-type="list"]', rcmail.gui_objects.sieveform).each(function() {
|
|
|
|
$('textarea[data-type="list"]', form).each(function() {
|
|
|
|
smart_field_init(this);
|
|
|
|
smart_field_init(this);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// initialize rules form(s)
|
|
|
|
|
|
|
|
$('[name="_header[]"]', form).each(function() {
|
|
|
|
|
|
|
|
if (/([0-9]+)$/.test(this.id)) {
|
|
|
|
|
|
|
|
rule_header_select(RegExp.$1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// enable date pickers on date fields
|
|
|
|
// enable date pickers on date fields
|
|
|
|
if ($.datepicker && rcmail.env.date_format) {
|
|
|
|
if ($.datepicker && rcmail.env.date_format) {
|
|
|
|
$.datepicker.setDefaults({
|
|
|
|
$.datepicker.setDefaults({
|
|
|
|