]> git.proxmox.com Git - proxmox-widget-toolkit.git/blob - window/PasswordEdit.js
246c78610c878101593a64fb4d6e3de15ebd193e
[proxmox-widget-toolkit.git] / window / PasswordEdit.js
1 Ext.define('Proxmox.window.PasswordEdit', {
2 extend: 'Proxmox.window.Edit',
3 alias: 'proxmoxWindowPasswordEdit',
4
5 subject: gettext('Password'),
6
7 url: '/api2/extjs/access/password',
8
9 fieldDefaults: {
10 labelWidth: 120
11 },
12
13 items: [
14 {
15 xtype: 'textfield',
16 inputType: 'password',
17 fieldLabel: gettext('Password'),
18 minLength: 5,
19 name: 'password',
20 listeners: {
21 change: function(field){
22 field.next().validate();
23 },
24 blur: function(field){
25 field.next().validate();
26 }
27 }
28 },
29 {
30 xtype: 'textfield',
31 inputType: 'password',
32 fieldLabel: gettext('Confirm password'),
33 name: 'verifypassword',
34 vtype: 'password',
35 initialPassField: 'password',
36 submitValue: false
37 },
38 {
39 xtype: 'hiddenfield',
40 name: 'userid'
41 }
42 ],
43
44 initComponent : function() {
45 var me = this;
46
47 if (!me.userid) {
48 throw "no userid specified";
49 }
50
51 me.callParent();
52 me.down('[name=userid]').setValue(me.userid);
53 }
54 });