luci-base: form.js: implement Textfield widget
Port the CBI Textfield (textarea) widget type to client side form.js Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
afd361e368
commit
2aab85814d
1 changed files with 24 additions and 0 deletions
|
@ -1600,6 +1600,29 @@ var CBIMultiValue = CBIDynamicList.extend({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var CBITextValue = CBIValue.extend({
|
||||||
|
__name__: 'CBI.TextValue',
|
||||||
|
|
||||||
|
value: null,
|
||||||
|
|
||||||
|
renderWidget: function(section_id, option_index, cfgvalue) {
|
||||||
|
var value = (cfgvalue != null) ? cfgvalue : this.default;
|
||||||
|
|
||||||
|
var widget = new ui.Textarea(value, {
|
||||||
|
id: this.cbid(section_id),
|
||||||
|
optional: this.optional || this.rmempty,
|
||||||
|
placeholder: this.placeholder,
|
||||||
|
monospace: this.monospace,
|
||||||
|
cols: this.cols,
|
||||||
|
rows: this.rows,
|
||||||
|
wrap: this.wrap,
|
||||||
|
validate: L.bind(this.validate, this, section_id)
|
||||||
|
});
|
||||||
|
|
||||||
|
return widget.render();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var CBIDummyValue = CBIValue.extend({
|
var CBIDummyValue = CBIValue.extend({
|
||||||
__name__: 'CBI.DummyValue',
|
__name__: 'CBI.DummyValue',
|
||||||
|
|
||||||
|
@ -1713,6 +1736,7 @@ return L.Class.extend({
|
||||||
ListValue: CBIListValue,
|
ListValue: CBIListValue,
|
||||||
Flag: CBIFlagValue,
|
Flag: CBIFlagValue,
|
||||||
MultiValue: CBIMultiValue,
|
MultiValue: CBIMultiValue,
|
||||||
|
TextValue: CBITextValue,
|
||||||
DummyValue: CBIDummyValue,
|
DummyValue: CBIDummyValue,
|
||||||
Button: CBIButtonValue,
|
Button: CBIButtonValue,
|
||||||
HiddenValue: CBIHiddenValue,
|
HiddenValue: CBIHiddenValue,
|
||||||
|
|
Loading…
Reference in a new issue