| | |
| | | |
| | | // Delete filter row |
| | | case 'del': |
| | | var i, list = this.filters_list, rows = list.rows; |
| | | var i = 0, list = this.filters_list; |
| | | |
| | | list.remove_row(this.managesieve_rowid(o.id)); |
| | | list.clear_selection(); |
| | | this.show_contentframe(false); |
| | | this.enable_command('plugin.managesieve-del', 'plugin.managesieve-act', false); |
| | | |
| | | // re-numbering filters |
| | | for (i=0; i<rows.length; i++) { |
| | | if (rows[i] != null && rows[i].uid > o.id) |
| | | rows[i].uid = rows[i].uid-1; |
| | | } |
| | | // filter identifiers changed, fix the list |
| | | $('tr', this.filters_list.list).each(function() { |
| | | // remove hidden (deleted) rows |
| | | if (this.style.display == 'none') { |
| | | $(this).detach(); |
| | | return; |
| | | } |
| | | |
| | | // modify ID and remove all attached events |
| | | $(this).attr('id', 'rcmrow'+(i++)).unbind(); |
| | | }); |
| | | list.init(); |
| | | |
| | | break; |
| | | |
| | | // Update filter row |
| | | case 'update': |
| | | var i, row = $('#rcmrow'+o.id); |
| | | var i, row = $('#rcmrow'+this.managesieve_rowid(o.id)); |
| | | |
| | | if (o.name) |
| | | $('td', row).html(o.name); |
| | | $('td', row).text(o.name); |
| | | if (o.disabled) |
| | | row.addClass('disabled'); |
| | | else |
| | |
| | | var list = this.filters_list, |
| | | row = $('<tr><td class="name"></td></tr>'); |
| | | |
| | | $('td', row).html(o.name); |
| | | $('td', row).text(o.name); |
| | | row.attr('id', 'rcmrow'+o.id); |
| | | if (o.disabled) |
| | | row.addClass('disabled'); |
| | |
| | | tr = document.createElement('TR'); |
| | | td = document.createElement('TD'); |
| | | |
| | | td.innerHTML = el.name; |
| | | $(td).text(el.name); |
| | | td.className = 'name'; |
| | | tr.id = 'rcmrow' + el.id; |
| | | if (el['class']) |
| | |
| | | list = this.filtersets_list, |
| | | row = $('<tr class="disabled"><td class="name"></td></tr>'); |
| | | |
| | | $('td', row).html(o.name); |
| | | $('td', row).text(o.name); |
| | | row.attr('id', 'rcmrow'+id); |
| | | |
| | | this.env.filtersets[id] = o.name; |
| | |
| | | target = window.frames[this.env.contentframe]; |
| | | var msgid = this.set_busy(true, 'loading'); |
| | | target.location.href = this.env.comm_path+'&_action=plugin.managesieve&_framed=1' |
| | | +(id ? '&_fid='+id : '')+'&_unlock='+msgid; |
| | | +(has_id ? '&_fid='+id : '')+'&_unlock='+msgid; |
| | | } |
| | | }; |
| | | |
| | |
| | | enabled = {}, |
| | | elems = { |
| | | mailbox: document.getElementById('action_mailbox' + id), |
| | | target: document.getElementById('action_target' + id), |
| | | target: document.getElementById('redirect_target' + id), |
| | | target_area: document.getElementById('action_target_area' + id), |
| | | flags: document.getElementById('action_flags' + id), |
| | | vacation: document.getElementById('action_vacation' + id), |
| | |
| | | |
| | | // load form in the iframe |
| | | var frame = $('<iframe>').attr({src: url, frameborder: 0}) |
| | | dialog.empty().append(frame).dialog('dialog').resize(); |
| | | dialog.empty().append(frame).dialog('widget').resize(); |
| | | |
| | | // Change [Next Step] button with [Save] button |
| | | buttons = {}; |