this.wronly = conf.wronly;
this.wronce = conf.wronce;
this.hidden = conf.hidden || conf.advanced;
- this.password = conf.password;
+ this.password = conf.showpwd ? false : conf.password;
this.duration = conf.duration;
this.intsplit = conf.intsplit;
this.group = conf.group;
/*
* Field editor
*/
-tvheadend.idnode_editor_field = function(f, create)
+tvheadend.idnode_editor_field = function(f, conf)
{
var d = f.rdonly || false;
- if (f.wronly && !create)
+ if (f.wronly && !conf.create)
d = false;
var value = f.value;
if (value == null)
name: f.id,
value: value,
disabled: d,
+ inputType: f.password && !conf.showpwd ? 'password' : 'text',
width: 300
});
/*
* ID node editor form fields
*/
-tvheadend.idnode_editor_form = function(d, meta, panel, create)
+tvheadend.idnode_editor_form = function(d, meta, panel, conf)
{
var af = [];
var rf = [];
/* Fields */
for (var i = 0; i < d.length; i++) {
var p = d[i];
- var f = tvheadend.idnode_editor_field(p, create);
+ var f = tvheadend.idnode_editor_field(p, conf);
if (!f)
continue;
if (p.group && meta.groups) {
buttons: buttons,
});
- tvheadend.idnode_editor_form(item.props || item.params, item.meta, panel, false);
+ tvheadend.idnode_editor_form(item.props || item.params, item.meta, panel,
+ { showpwd: conf.showpwd });
return panel;
};
pclass = r.get(conf.select.valueField);
win.setTitle('Add ' + s.lastSelectionText);
panel.remove(s);
- tvheadend.idnode_editor_form(d, null, panel, true);
+ tvheadend.idnode_editor_form(d, null, panel, { create: true });
saveBtn.setVisible(true);
}
}
success: function(d) {
panel.remove(s);
d = json_decode(d);
- tvheadend.idnode_editor_form(d.props, d, panel, true);
+ tvheadend.idnode_editor_form(d.props, d, panel, { create: true });
saveBtn.setVisible(true);
}
});
params: conf.params,
success: function(d) {
d = json_decode(d);
- tvheadend.idnode_editor_form(d.props, d, panel, true);
+ tvheadend.idnode_editor_form(d.props, d, panel, { create: true });
saveBtn.setVisible(true);
if (onlyDefault) {
saveBtn.handler();
});
buttons.push(abuttons.down);
}
- if (conf.add || conf.del || conf.move)
+ if (conf.hidepwd) {
buttons.push('-');
+ abuttons.add = new Ext.Toolbar.Button({
+ tooltip: 'Show or hide passwords',
+ iconCls: 'eye',
+ text: 'Show passwords',
+ disabled: false,
+ handler: function() {
+ conf.showpwd = !conf.showpwd ? true : false;
+ this.setText(conf.showpwd ? 'Hide passwords' : 'Show passwords');
+ roweditor_destroy();
+ roweditor(select.getSelected());
+ }
+ });
+ buttons.push(abuttons.add);
+ }
/* Extra buttons */
if (conf.tbar) {
current = null;
}
- function roweditor(r) {
+ function roweditor(r, force) {
if (!r || !r.id)
return;
- if (current && current.uuid == r.id)
+ if (!force && current && current.uuid == r.id)
return;
var params = conf.edit ? (conf.edit.params || {}) : {};
params.uuid = r.id;
inTabPanel: true,
noButtons: true,
width: 730,
- noautoWidth: true
+ noautoWidth: true,
+ showpwd: conf.showpwd
});
current = {
uuid: d[0].id,