]> git.proxmox.com Git - pmg-gui.git/blob - js/FetchmailEdit.js
add onlineHelp properties to all edit windows
[pmg-gui.git] / js / FetchmailEdit.js
1 /*jslint confusion: true*/
2 /*value is string and number*/
3 Ext.define('PMG.FetchmailEdit', {
4 extend: 'Proxmox.window.Edit',
5 xtype: 'pmgFetchmailEdit',
6 onlineHelp: 'pmgconfig_fetchmail',
7
8 userid: undefined,
9
10 isAdd: true,
11
12 subject: 'Fetchmail',
13
14 fieldDefaults: { labelWidth: 120 },
15
16 controller: {
17
18 xclass: 'Ext.app.ViewController',
19
20 onProtocolChange: function() {
21 var protocol = this.lookupReference('protocol').getValue();
22 var ssl = this.lookupReference('ssl').getValue();
23
24 var port_field = this.lookupReference('port');
25 if (protocol === 'pop3') {
26 port_field.setValue(ssl ? 995 : 110);
27 } else if (protocol === 'imap') {
28 port_field.setValue(ssl ? 993 : 143);
29 }
30 }
31 },
32
33 items: {
34 xtype: 'inputpanel',
35 column1: [
36 {
37 xtype: 'textfield',
38 name: 'server',
39 fieldLabel: gettext('Server'),
40 allowBlank: false
41 },
42 {
43 xtype: 'proxmoxKVComboBox',
44 fieldLabel: gettext('Protocol'),
45 name: 'protocol',
46 reference: 'protocol',
47 value: 'pop3',
48 listeners: { change: 'onProtocolChange' },
49 comboItems: [['pop3', 'pop3'], ['imap', 'imap']]
50 },
51 {
52 xtype: 'proxmoxintegerfield',
53 name: 'port',
54 reference: 'port',
55 fieldLabel: gettext('Port'),
56 value: 110,
57 minValue: 1,
58 maxValue: 65535,
59 allowBlank: false
60 },
61 {
62 xtype: 'textfield',
63 name: 'user',
64 fieldLabel: gettext('Username'),
65 allowBlank: false
66 },
67 {
68 xtype: 'textfield',
69 name: 'pass',
70 inputType: 'password',
71 fieldLabel: gettext('Password'),
72 allowBlank: false
73 },
74 {
75 xtype: 'textfield',
76 name: 'target',
77 fieldLabel: gettext('Deliver to'),
78 allowBlank: false
79 }
80
81 ],
82 column2: [
83 {
84 xtype: 'proxmoxcheckbox',
85 fieldLabel: gettext('Enabled'),
86 name: 'enable',
87 uncheckedValue: 0,
88 checked: true
89 },
90 {
91 xtype: 'proxmoxintegerfield',
92 name: 'interval',
93 fieldLabel: gettext('Interval'),
94 value: 1,
95 minValue: 1,
96 maxValue: 24*12*7,
97 allowBlank: false
98 },
99 {
100 xtype: 'proxmoxcheckbox',
101 fieldLabel: gettext('Use SSL'),
102 listeners: { change: 'onProtocolChange' },
103 name: 'ssl',
104 reference: 'ssl',
105 uncheckedValue: 0,
106 checked: false
107 },
108 {
109 xtype: 'proxmoxcheckbox',
110 fieldLabel: gettext('Keep old mails'),
111 name: 'keep',
112 uncheckedValue: 0,
113 checked: false
114 }
115 ]
116 }
117 });