Merge branch 'master' of github.com:phpmyadmin/phpmyadmin
This commit is contained in:
commit
c94a68c849
@ -904,13 +904,15 @@ function PMA_reloadNavigation(callback, paths) {
|
||||
}
|
||||
|
||||
function PMA_selectCurrentDb() {
|
||||
var $navi_db_select = ('#navi_db_select');
|
||||
if ($navi_db_select.length) {
|
||||
if ($('#navi_db_select').length) {
|
||||
if (PMA_commonParams.get('db')) { // db selected
|
||||
$('#navi_db_select').show();
|
||||
}
|
||||
$navi_db_select.val(PMA_commonParams.get('db'));
|
||||
return $navi_db_select.val() === PMA_commonParams.get('db');
|
||||
$('#navi_db_select').val(PMA_commonParams.get('db'));
|
||||
if ($('#navi_db_select').val() !== PMA_commonParams.get('db')) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user