|
77 |
type: TextBox, |
77 |
type: TextBox, |
78 |
name: 'key', |
78 |
name: 'key', |
79 |
description: _( 'Name of UCR variable' ), |
79 |
description: _( 'Name of UCR variable' ), |
80 |
label: _( 'UCR variable' ) |
80 |
label: _( 'UCR variable' ), |
|
|
81 |
invalidMessage: _( 'A valid key must contain at least one character and can only contain letters, numerals, and "/", ".", "_", "-".' ), |
82 |
validator: function (value, constraints) { |
83 |
return !!value && !/[^a-zA-Z0-9/._-]/.test(value); |
84 |
} |
81 |
}, { |
85 |
}, { |
82 |
type: TextBox, |
86 |
type: TextBox, |
83 |
name: 'value', |
87 |
name: 'value', |
|
105 |
label: _( 'Save' ), |
109 |
label: _( 'Save' ), |
106 |
style: 'float: right', |
110 |
style: 'float: right', |
107 |
callback: lang.hitch(this, function() { |
111 |
callback: lang.hitch(this, function() { |
108 |
this._form.save(); |
112 |
if (this._form.getWidget('key').isValid()) { |
109 |
this.hide(); |
113 |
this._form.save(); |
|
|
114 |
this.hide(); |
115 |
} |
110 |
}) |
116 |
}) |
111 |
}, { |
117 |
}, { |
112 |
//FIXME: Should be much simpler. The key name should be enough |
118 |
//FIXME: Should be much simpler. The key name should be enough |