summaryrefslogtreecommitdiff
path: root/plugins/managesieve/skins/default/templates/managesieveedit.html
blob: 2302073b69646c88f358c977a25c0f8a13222488 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><roundcube:object name="pagetitle" /></title>
<roundcube:include file="/includes/links.html" />
<link rel="stylesheet" type="text/css" href="/this/managesieve.css" />
</head>
<body class="iframe">

<script type="text/javascript">

function header_select(id)
{
    var obj = document.getElementById('header'+id);

    if (obj.value == 'size')
    {
	document.getElementById('rule_size' + id).style.display = 'inline';
	document.getElementById('rule_op' + id).style.display = 'none';
	document.getElementById('rule_target' + id).style.display = 'none';
	document.getElementById('custom_header' + id).style.display = 'none';
    }
    else
    {
	if (obj.value != '...')
	    document.getElementById('custom_header' + id).style.display = 'none';
	else
	    document.getElementById('custom_header' + id).style.display = 'inline';
    
	document.getElementById('rule_size' + id).style.display = 'none';
	document.getElementById('rule_op' + id).style.display = 'inline';
	rule_op_select(id);
    }
}

function rule_op_select(id)
{
    var obj = document.getElementById('rule_op'+id);

    if (obj.value == 'exists' || obj.value == 'notexists')
    {
	document.getElementById('rule_target' + id).style.display = 'none';
    }
    else
    {
	document.getElementById('rule_target' + id).style.display = 'inline';
    }
}

function action_type_select(id)
{
    var obj = document.getElementById('action_type'+id);

    if (obj.value == 'fileinto')
    {
	document.getElementById('action_mailbox' + id).style.display = 'inline';
	document.getElementById('action_target' + id).style.display = 'none';
	document.getElementById('action_target_area' + id).style.display = 'none';
	document.getElementById('action_vacation' + id).style.display = 'none';
    }
    else if (obj.value == 'redirect')
    {
	document.getElementById('action_target' + id).style.display = 'inline';
	document.getElementById('action_mailbox' + id).style.display = 'none';
	document.getElementById('action_target_area' + id).style.display = 'none';
	document.getElementById('action_vacation' + id).style.display = 'none';
    }
    else if (obj.value.match(/^reject|ereject$/))
    {
	document.getElementById('action_target_area' + id).style.display = 'inline';
	document.getElementById('action_vacation' + id).style.display = 'none';
	document.getElementById('action_target' + id).style.display = 'none';
	document.getElementById('action_mailbox' + id).style.display = 'none';
    }
    else if (obj.value == 'vacation')
    {
	document.getElementById('action_vacation' + id).style.display = 'inline';
        document.getElementById('action_target_area' + id).style.display = 'none';
	document.getElementById('action_target' + id).style.display = 'none';
	document.getElementById('action_mailbox' + id).style.display = 'none';
    }
    else // discard, keep, stop
    {
	document.getElementById('action_target_area' + id).style.display = 'none';
	document.getElementById('action_vacation' + id).style.display = 'none';
	document.getElementById('action_target' + id).style.display = 'none';
	document.getElementById('action_mailbox' + id).style.display = 'none';
    }
}

function rule_join_radio(value)
{
    document.getElementById('rules').style.display = (value=='any' ? 'none' : 'block');
}
</script>

<div id="filter-form">
<roundcube:object name="filterform" />

<p>
<roundcube:button command="plugin.managesieve-save" type="input" class="button mainaction" label="save" />
</p>

</form>
</div>


</body>
</html>