Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/tbl_change.js')
-rw-r--r--js/tbl_change.js42
1 files changed, 28 insertions, 14 deletions
diff --git a/js/tbl_change.js b/js/tbl_change.js
index ba969a382c..bac1b8fb01 100644
--- a/js/tbl_change.js
+++ b/js/tbl_change.js
@@ -341,28 +341,38 @@ AJAX.registerOnload('tbl_change.js', function () {
// validate the comment form when it is submitted
$("#insertForm").validate();
jQuery.validator.addMethod("validationFunctionForHex", function(value, element) {
- return value.match(/^[a-f0-9]*$/i) !== null;
+ if (value.match(/^[a-f0-9]*$/i) === null) {
+ return false;
+ } else {
+ return true;
+ }
});
jQuery.validator.addMethod("validationFunctionForFuns", function(value, element, options) {
if (value.substring(0, 3) === "AES" && options.data('type') !== 'HEX') {
return false;
+ } else if (value.substring(0, 3) === "MD5"
+ && typeof options.data('maxlength') !== 'undefined'
+ && options.data('maxlength') < 32) {
+ return false;
+ } else {
+ return true;
}
-
- return !(value.substring(0, 3) === "MD5"
- && typeof options.data('maxlength') !== 'undefined'
- && options.data('maxlength') < 32);
});
jQuery.validator.addMethod("validationFunctionForDateTime", function(value, element, options) {
var dt_value = value;
var theType = options;
if (theType == "date") {
- return isDate(dt_value);
-
+ if (! isDate(dt_value)) {
+ return false;
+ }
+ return true;
} else if (theType == "time") {
- return isTime(dt_value);
-
+ if (! isTime(dt_value)) {
+ return false;
+ }
+ return true;
} else if (theType == "datetime" || theType == "timestamp") {
var tmstmp = false;
dt_value = dt_value.trim();
@@ -377,12 +387,16 @@ AJAX.registerOnload('tbl_change.js', function () {
}
var dv = dt_value.indexOf(" ");
if (dv == -1) { // Only the date component, which is valid
- return isDate(dt_value, tmstmp);
-
+ if (! isDate(dt_value, tmstmp)) {
+ return false;
+ }
+ return true;
} else {
- return isDate(dt_value.substring(0, dv), tmstmp)
- && isTime(dt_value.substring(dv + 1));
-
+ if (! (isDate(dt_value.substring(0, dv), tmstmp)
+ && isTime(dt_value.substring(dv + 1)))) {
+ return false;
+ }
+ return true;
}
}
});