Skip to content

Commit

Permalink
version 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
bmauser committed Jul 11, 2019
1 parent be6a22b commit 4565dca
Show file tree
Hide file tree
Showing 20 changed files with 69 additions and 66 deletions.
29 changes: 20 additions & 9 deletions dist/jquery.bvalidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ var bValidator = (function ($) {
var actionData = postInputs[postName].actionData;
var ajaxValidationResult;
var errorMsg = [];
var ajaxCache;

// input value after ajax request
var inputValue = $input.val();
Expand All @@ -237,6 +238,11 @@ var bValidator = (function ($) {
if (inputValue != postInputs[postName].inputValue)
continue;

if (fn.options.ajaxCache) {
ajaxCache = $input.data('ajaxCache' + fn.dataNamespace);
ajaxCache.lastMessage = null;
}

// default ajax validation function has some additional arguments
actionData.params = [ajaxResponse, postName].concat(actionData.params)

Expand All @@ -260,7 +266,6 @@ var bValidator = (function ($) {

// save last message to cache
if (fn.options.ajaxCache) {
var ajaxCache = $input.data('ajaxCache' + fn.dataNamespace);
ajaxCache.lastMessage = errorMsg;
}
}
Expand Down Expand Up @@ -1538,15 +1543,21 @@ bValidator.validators = (function ($) {

var validationResult;

// check if response from server is JSON
try {
var results = $.parseJSON(ajaxResponse);
if (results[postName])
validationResult = results[postName];
if (typeof ajaxResponse === 'object'){
if (postName in ajaxResponse)
validationResult = ajaxResponse[postName];
}
// ajaxResponse is not json
catch (err) {
validationResult = ajaxResponse;
else {
// check if response from server is JSON
try {
var results = $.parseJSON(ajaxResponse);
if (postName in results)
validationResult = results[postName];
}
// ajaxResponse is not json
catch (err) {
validationResult = ajaxResponse;
}
}

return validationResult
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.bvalidator.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/jquery.bvalidator.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/themes/bs3/bs3popover/bs3popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

bValidator.defaultOptions.themes.bs3popover = {

popoverOptions : { // see: http://getbootstrap.com/javascript/#popovers-options
html : 'true',
popoverOptions : {
html : true,
template : '<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div></div>',
viewport : null,
trigger : 'manual'
Expand Down
7 changes: 4 additions & 3 deletions dist/themes/bs3/bs3tooltip/bs3tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

bValidator.defaultOptions.themes.bs3tooltip = {

tooltipOptions : { // see: http://getbootstrap.com/javascript/#tooltips-options
html : 'true',
tooltipOptions : {
html : true,
viewport : null,
trigger : 'manual'
trigger : 'manual',
sanitize : false
},
placement : 'right', // top | bottom | left | right
content : '<div class="bvalidator-bs3tooltip-msg bvalidator-bs3tooltip-msg-noclose">{message}</div>',
Expand Down
6 changes: 2 additions & 4 deletions dist/themes/bslikerc/bslikerc.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
padding-right: 20px;
font-family: Arial, Helvetica, sans-serif;
background-color: #ffffff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
position:absolute;
line-height: 20px;
}
Expand Down
6 changes: 2 additions & 4 deletions dist/themes/bslikert/bslikert.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
padding-right: 20px;
font-family: Arial, Helvetica, sans-serif;
background-color: #ffffff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
position:absolute;
line-height: 20px;
}
Expand Down
3 changes: 1 addition & 2 deletions dist/themes/gray/gray.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
border-radius: 4px;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
-webkit-box-shadow: 0 0 6px #ddd;
box-shadow: 0 0 6px #ddd;
box-shadow: 0 0 6px #ddd;
white-space: nowrap;
padding-top: 2px;
padding-right: 15px;
Expand Down
3 changes: 1 addition & 2 deletions dist/themes/gray2/gray2.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
border-radius: 4px;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
-webkit-box-shadow: 0 0 6px #ddd;
box-shadow: 0 0 6px #ddd;
box-shadow: 0 0 6px #ddd;
white-space: nowrap;
padding-top: 2px;
padding-right: 15px;
Expand Down
6 changes: 1 addition & 5 deletions dist/themes/gray3/gray3.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@
padding-right: 20px;
font-family: Arial, Helvetica, sans-serif;
border: 1px solid #666666;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
background: #c6c6c6; /* Old browsers */
background: -webkit-gradient(linear, left top, left bottom, from(#c6c6c6), to(#3f3f3f));
background: -webkit-linear-gradient(top, #c6c6c6 0%, #3f3f3f 100%);
background: -o-linear-gradient(top, #c6c6c6 0%, #3f3f3f 100%);
background: linear-gradient(to bottom, #c6c6c6 0%,#3f3f3f 100%);
color: #FFF;
line-height: normal;
Expand Down
3 changes: 1 addition & 2 deletions dist/themes/gray4/gray4.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
border-radius: 4px;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
-webkit-box-shadow: 0 0 6px #ddd;
box-shadow: 0 0 6px #ddd;
box-shadow: 0 0 6px #ddd;
white-space: nowrap;
padding-top: 2px;
padding-right: 15px;
Expand Down
3 changes: 1 addition & 2 deletions dist/themes/orange/orange.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
border-radius: 4px;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
-webkit-box-shadow: 0 0 6px #ddd;
box-shadow: 0 0 6px #ddd;
box-shadow: 0 0 6px #ddd;
white-space: nowrap;
padding-top: 2px;
padding-right: 15px;
Expand Down
3 changes: 1 addition & 2 deletions dist/themes/postit/postit.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
border: 2px solid #100b07;
border-radius: 10px;
font-family: "Comic Sans MS", "Trebuchet MS", Trebuchet, Arial, Verdana, Sans-serif;
-webkit-box-shadow: 0 0 6px #ddd;
box-shadow: 0 0 6px #ddd;
box-shadow: 0 0 6px #ddd;
line-height: normal;
position: absolute;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/themes/presenters/bs3form.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/themes/presenters/bs3popover-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ bValidator.Bs3PopoverTooltipPresenter = (function ($) {
// displays message
showInvalid : function (messages) {

var tooltipContent = this.getTooltipContent(messages);
var $tooltipContent = this.getTooltipContent(messages);

// if popover is already initialized just replace the content
if (this.$tooltipContainer) {
this.$input.data('bs.' + this.type).options.content = tooltipContent;
this.$input.data('bs.' + this.type).options.content = $tooltipContent;
}
// make a new tooltip
else {
Expand All @@ -115,10 +115,10 @@ bValidator.Bs3PopoverTooltipPresenter = (function ($) {
}

if (this.type == 'tooltip') {
options.title = tooltipContent;
options.title = $tooltipContent;
options = $.extend({}, options, this.themeOptions.tooltipOptions);
} else { // popover
options.content = tooltipContent;
options.content = $tooltipContent;
options = $.extend({}, options, this.themeOptions.popoverOptions);
}

Expand Down
2 changes: 1 addition & 1 deletion dist/themes/presenters/bs3popover-tooltip.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4565dca

Please sign in to comment.