Thomas Bruederli
2016-01-16 699af1e5206ed9114322adaa3c25c1c969640a53
plugins/managesieve/managesieve.js
@@ -181,7 +181,7 @@
  var id = this.filtersets_list.get_single_selection(),
    script = this.env.filtersets[id];
  location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_act=setget&_set='+urlencode(script);
  this.goto_url('plugin.managesieve-action', {_act: 'setget', _set: script}, false, true);
};
// Set activate/deactivate request
@@ -226,7 +226,6 @@
  this.set_busy(true);
  switch (action) {
    // Delete filter row
    case 'del':
      var id = o.id, list = this.filters_list;
@@ -250,8 +249,10 @@
        $(this).unbind();
        // update row id
        if (rowid > id)
          $(this).attr('id', 'rcmrow' + (rowid-1));
        if (rowid > id) {
          this.uid = rowid - 1;
          $(this).attr('id', 'rcmrow' + this.uid);
        }
      });
      list.init();
@@ -580,6 +581,20 @@
  }
};
// update vacation addresses field with user identities
rcube_webmail.prototype.managesieve_vacation_addresses = function(id)
{
  var lock = this.set_busy(true, 'loading');
  this.http_post('plugin.managesieve-action', {_act: 'addresses', _aid: id}, lock);
};
// update vacation addresses field with user identities
rcube_webmail.prototype.managesieve_vacation_addresses_update = function(id, addresses)
{
  var field = $('#vacation_addresses,#action_addresses' + (id || ''));
  smart_field_reset(field.get(0), addresses);
};
function rule_header_select(id)
{
  var obj = document.getElementById('header' + id),
@@ -801,6 +816,21 @@
  return elem;
}
// Reset and fill the smart list input with new data
function smart_field_reset(field, data)
{
  var id = field.id + '_list',
    list = data.length ? data : [''];
    area = $('#' + id);
  area.empty();
  // add input rows
  $.each(list, function(i, v) {
    area.append(smart_field_row(v, field.name, i, $(field).data('size')));
  });
}
// Register onmouse(leave/enter) events for tips on specified form element
rcube_webmail.prototype.managesieve_tip_register = function(tips)
{