Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getter: function(val){
val = $.trim(val);
// 在获取的时候动态判断是否required,来追加或者删除 rule: required
if (this.get('required')) {
if (!val || !hasRequired(val)) {
val = $.trim('required ' + val);
}
} else {
if (hasRequired(val)) {
val = $.trim((' ' + val + ' ').replace(' required ', ' '));
}
}
return val;
}
},
getter: function(val){
val = $.trim(val);
// 在获取的时候动态判断是否required,来追加或者删除 rule: required
if (this.get('required')) {
if (!val || !hasRequired(val)) {
val = $.trim('required ' + val);
}
} else {
if (hasRequired(val)) {
val = $.trim((' ' + val + ' ').replace(' required ', ' '));
}
}
return val;
}
},
getter: function(val){
val = $.trim(val);
// 在获取的时候动态判断是否required,来追加或者删除 rule: required
if (this.get('required')) {
if (!val || !hasRequired(val)) {
val = $.trim('required ' + val);
}
} else {
if (hasRequired(val)) {
val = $.trim((' ' + val + ' ').replace(' required ', ' '));
}
}
return val;
}
},
$.each(arr, function (i, v) {
arr[i] = $.trim(v);
if (!arr[i])
throw new Error(NOTICE);
var arr2 = arr[i].split(':');
var key = $.trim(arr2[0]),
value = $.trim(arr2[1]);
if (!key || !value)
throw new Error(NOTICE);
result[getValue(key)] = $.trim(getValue(value));
});
$.each(arr, function (i, v) {
arr[i] = $.trim(v);
if (!arr[i])
throw new Error(NOTICE);
var arr2 = arr[i].split(':');
var key = $.trim(arr2[0]),
value = $.trim(arr2[1]);
if (!key || !value)
throw new Error(NOTICE);
result[getValue(key)] = $.trim(getValue(value));
});
$.each(arr, function (i, v) {
arr[i] = $.trim(v);
if (!arr[i])
throw new Error(NOTICE);
var arr2 = arr[i].split(':');
var key = $.trim(arr2[0]),
value = $.trim(arr2[1]);
if (!key || !value)
throw new Error(NOTICE);
result[getValue(key)] = $.trim(getValue(value));
});
$.each(arr, function (i, v) {
arr[i] = $.trim(v);
if (!arr[i])
throw new Error(NOTICE);
var arr2 = arr[i].split(':');
var key = $.trim(arr2[0]),
value = $.trim(arr2[1]);
if (!key || !value)
throw new Error(NOTICE);
result[getValue(key)] = $.trim(getValue(value));
});
var element = $(options.element);
var t = element.attr('type');
switch (t) {
case 'checkbox':
case 'radio':
var checked = false;
element.each(function (i, item) {
if ($(item).prop('checked')) {
checked = true;
return false;
}
});
return checked;
default:
return Boolean($.trim(element.val()));
}
}, '请输入{{display}}');
arr && $.each(arr, function (i, v) {
var key = v.match(regexp2)[1];
var value = obj[$.trim(key)];
result = result.replace(v, value);
});
return result;