summaryrefslogtreecommitdiffstats
path: root/install/static/widget.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-01-13 10:00:38 +0700
committerEndi Sukma Dewata <edewata@redhat.com>2011-01-13 02:14:51 -0500
commitd92f5bf8bb476bd2c90262db9b44ac659b61ecf5 (patch)
tree63f5a461bd197aeef54a6b4a35c66fa003e6fd27 /install/static/widget.js
parentb79bf4ab1757eb08f7209f158f1f3a386ace8c96 (diff)
downloadfreeipa.git-d92f5bf8bb476bd2c90262db9b44ac659b61ecf5.tar.gz
freeipa.git-d92f5bf8bb476bd2c90262db9b44ac659b61ecf5.tar.xz
freeipa.git-d92f5bf8bb476bd2c90262db9b44ac659b61ecf5.zip
Host details adjustments.
The labels for the following fields in Host details page have been changed: - fqdn: Fully Qualified Host Name - serverhostname: Host Name The ipa_details_field_create_input() and _ipa_create_text_input() has been converted into methods in ipa_details_field class. The code has been modified to display read-only fields as labels instead of disabled text fields. The attributelevelrights in host test data files have been updated.
Diffstat (limited to 'install/static/widget.js')
-rwxr-xr-xinstall/static/widget.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/install/static/widget.js b/install/static/widget.js
index 795cc42a..d9661c3e 100755
--- a/install/static/widget.js
+++ b/install/static/widget.js
@@ -44,6 +44,7 @@ function ipa_widget(spec) {
that.save = spec.save || save;
that.update = spec.update || update;
that.validate_input = spec.validate_input || validate_input;
+ that.param_info = spec.param_info;
that.__defineGetter__("entity_name", function(){
return that._entity_name;
@@ -53,28 +54,26 @@ function ipa_widget(spec) {
that._entity_name = entity_name;
});
- var param_info;
-
/*returns true and clears the error message if the field value passes
the validation pattern. If the field value does not pass validation,
displays the error message and returns false. */
- function validate_input(text){
- if(!(param_info && param_info.pattern)){
+ function validate_input(text) {
+ if (!(that.param_info && that.param_info.pattern)) {
return true;
}
var error_link = that.get_error_link();
- if (!error_link){
+ if (!error_link) {
return true;
}
- var regex = new RegExp( param_info.pattern );
+ var regex = new RegExp( that.param_info.pattern );
//If the field is empty, don't validate
- if (!text || text.match(regex) ) {
+ if ( !text || text.match(regex) ) {
error_link.css('display', 'none');
return true;
}else{
error_link.css('display', 'block');
- if ( param_info.pattern_errmsg){
- error_link.html(param_info.pattern_errmsg);
+ if (that.param_info.pattern_errmsg) {
+ error_link.html(that.param_info.pattern_errmsg);
}
return false;
}
@@ -82,9 +81,9 @@ function ipa_widget(spec) {
function init() {
if (that.entity_name && !that.label){
- param_info = ipa_get_param_info(that.entity_name, spec.name);
- if ((param_info) && (that.label === undefined)){
- that.label = param_info.label;
+ that.param_info = ipa_get_param_info(that.entity_name, that.name);
+ if ((that.param_info) && (that.label === undefined)){
+ that.label = that.param_info.label;
}
}
}