]> git.proxmox.com Git - proxmox-widget-toolkit.git/blame - window/PasswordEdit.js
window/PasswordEdit.js: cleanup
[proxmox-widget-toolkit.git] / window / PasswordEdit.js
CommitLineData
ec62162d
DM
1Ext.define('Proxmox.window.PasswordEdit', {
2 extend: 'Proxmox.window.Edit',
c9441d5f
DM
3 alias: 'proxmoxWindowPasswordEdit',
4
4c21393e 5 subject: gettext('Password'),
c9441d5f 6
4c21393e 7 url: '/api2/extjs/access/password',
c9441d5f 8
4c21393e
DM
9 fieldDefaults: {
10 labelWidth: 120
11 },
c9441d5f 12
4c21393e
DM
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 }
c9441d5f 27 }
4c21393e
DM
28 },
29 {
30 xtype: 'textfield',
c9441d5f 31 inputType: 'password',
4c21393e 32 fieldLabel: gettext('Confirm password'),
c9441d5f 33 name: 'verifypassword',
4c21393e
DM
34 vtype: 'password',
35 initialPassField: 'password',
36 submitValue: false
37 },
38 {
39 xtype: 'hiddenfield',
40 name: 'userid'
41 }
42 ],
c9441d5f 43
4c21393e
DM
44 initComponent : function() {
45 var me = this;
c9441d5f 46
4c21393e
DM
47 if (!me.userid) {
48 throw "no userid specified";
49 }
c9441d5f
DM
50
51 me.callParent();
4c21393e 52 me.down('[name=userid]').setValue(me.userid);
c9441d5f
DM
53 }
54});