},
success: function(d) {
if (conf.win)
- conf.win.hide();
+ conf.win.close();
}
});
}
});
buttons.push(saveBtn);
+ var applyBtn = new Ext.Button({
+ text: _('Apply'),
+ iconCls: 'apply',
+ handler: function() {
+ var node = panel.getForm().getFieldValues();
+ node.uuid = conf.uuids ? conf.uuids : item.uuid;
+ tvheadend.Ajax({
+ url: 'api/idnode/save',
+ params: {
+ node: Ext.encode(node)
+ },
+ success: function(d) {
+ }
+ });
+ }
+ });
+ buttons.push(applyBtn);
+
if (conf.help) {
var helpBtn = new Ext.Button({
text: _('Help'),
});
}
});
+ var applyBtn = new Ext.Button({
+ tooltip: _('Apply settings'),
+ text: _('Apply'),
+ iconCls: 'apply',
+ hidden: true,
+ handler: function() {
+ var params = conf.create.params || {};
+ if (puuid)
+ params['uuid'] = puuid;
+ if (pclass)
+ params['class'] = pclass;
+ params['conf'] = Ext.encode(panel.getForm().getFieldValues());
+ tvheadend.Ajax({
+ url: conf.create.url || conf.url + '/create',
+ params: params,
+ success: function(d) {
+ }
+ });
+ }
+ });
var cancelBtn = new Ext.Button({
tooltip: _('Cancel operation'),
text: _('Cancel'),
defaultType: 'textfield',
buttonAlign: 'left',
items: [],
- buttons: [cancelBtn, saveBtn]
+ buttons: [cancelBtn, saveBtn, applyBtn]
});
/* Create window */
panel.remove(s);
tvheadend.idnode_editor_form(d, null, panel, { create: true, showpwd: true });
saveBtn.setVisible(true);
+ applyBtn.setVisible(true);
win.setOriginSize(true);
}
}
d = json_decode(d);
tvheadend.idnode_editor_form(d.props, d, panel, { create: true, showpwd: true });
saveBtn.setVisible(true);
+ applyBtn.setVisible(true);
win.setOriginSize(true);
}
});
success: function(d) {
d = json_decode(d);
tvheadend.idnode_editor_form(d.props, d, panel, { create: true, showpwd: true });
- saveBtn.setVisible(true);
if (onlyDefault) {
saveBtn.handler();
panel.destroy();
- } else
+ } else {
+ saveBtn.setVisible(true);
+ applyBtn.setVisible(true);
win.show();
+ }
}
});
}