diff options
author | alecpl <alec@alec.pl> | 2011-11-18 14:44:48 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-11-18 14:44:48 +0000 |
commit | c994e0e7cd9f593eb21ff80c7c1ddbeaf2a1b12a (patch) | |
tree | 44bf85e3a9f96cd13fb82d263cbf068f317fb21c /plugins/managesieve/managesieve.js | |
parent | bdb649067d8cd5bdfa584a21d0a8664f8f89f2d3 (diff) |
- Applied fixes from trunk up to r5451
Diffstat (limited to 'plugins/managesieve/managesieve.js')
-rw-r--r-- | plugins/managesieve/managesieve.js | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js index 5f9c67004..a7b15f7b5 100644 --- a/plugins/managesieve/managesieve.js +++ b/plugins/managesieve/managesieve.js @@ -542,19 +542,28 @@ function rule_header_select(id) size = document.getElementById('rule_size' + id), op = document.getElementById('rule_op' + id), target = document.getElementById('rule_target' + id), - header = document.getElementById('custom_header' + id); + header = document.getElementById('custom_header' + id), + mod = document.getElementById('rule_mod' + id), + trans = document.getElementById('rule_trans' + id), + comp = document.getElementById('rule_comp' + id); if (obj.value == 'size') { size.style.display = 'inline'; op.style.display = 'none'; target.style.display = 'none'; header.style.display = 'none'; + mod.style.display = 'none'; + trans.style.display = 'none'; + comp.style.display = 'none'; } else { header.style.display = obj.value != '...' ? 'none' : 'inline'; size.style.display = 'none'; op.style.display = 'inline'; + comp.style.display = ''; rule_op_select(id); + mod.style.display = obj.value == 'body' ? 'none' : 'block'; + trans.style.display = obj.value == 'body' ? 'block' : 'none'; } obj.style.width = obj.value == '...' ? '40px' : ''; @@ -568,11 +577,41 @@ function rule_op_select(id) target.style.display = obj.value == 'exists' || obj.value == 'notexists' ? 'none' : 'inline'; }; +function rule_trans_select(id) +{ + var obj = document.getElementById('rule_trans_op' + id), + target = document.getElementById('rule_trans_type' + id); + + target.style.display = obj.value != 'content' ? 'none' : 'inline'; +}; + +function rule_mod_select(id) +{ + var obj = document.getElementById('rule_mod_op' + id), + target = document.getElementById('rule_mod_type' + id); + + target.style.display = obj.value != 'address' && obj.value != 'envelope' ? 'none' : 'inline'; +}; + function rule_join_radio(value) { $('#rules').css('display', value == 'any' ? 'none' : 'block'); }; +function rule_adv_switch(id, elem) +{ + var elem = $(elem), enabled = elem.hasClass('hide'), adv = $('#rule_advanced'+id); + + if (enabled) { + adv.hide(); + elem.removeClass('hide').addClass('show'); + } + else { + adv.show(); + elem.removeClass('show').addClass('hide'); + } +} + function action_type_select(id) { var obj = document.getElementById('action_type' + id), |