1// defining global variables 2var validatorConfigPublic = ''; 3 4 5(function ($) { 6 "use strict"; 7 8 var createConfig = function (translationsKey) { 9 var config = { 10 'lang': ip.languageCode, 11 //'errorClass' : 'ipmControlError', 12 'messageClass': 'hidden', //hide default jqueryTools absolutely positioned error message 13 //'position' : 'bottom left', 14 //'offset' : [-3, 0], 15 'onFail': function (e, errors) { 16 $.each(errors, function () { 17 var err = this; 18 var $control = this.input; 19 $control.parents('.form-group') 20 .addClass('has-error') 21 .find('.help-error').html(this.messages.join(' ')); 22 if (this.messages.join('') == '') { 23 //hide error if no error text present 24 $control.parents('.form-group').find('.help-error').hide() 25 } else { 26 $control.parents('.form-group').find('.help-error').show() 27 } 28 }); 29 if (!isScrolledIntoView(errors[0].input) && !$(errors[0].input).hasClass('ipsDisableAutoscrollOnError')) { 30 $('html, body').animate({ 31 scrollTop: Math.max($(errors[0].input).offset().top - 70, 0) 32 }, 300); 33 34 } 35 $(e.target).trigger('ipOnFail', [e, errors]); 36 }, 37 'onSuccess': function (e, valids) { 38 $.each(valids, function () { 39 var $control = $(this); 40 $control.parents('.form-group').removeClass('has-error'); 41 }); 42 } 43 }; 44 return config; 45 }; 46 47 var isScrolledIntoView = function (elem) 48 { 49 var docViewTop = $(window).scrollTop(); 50 var docViewBottom = docViewTop + $(window).height(); 51 52 var elemTop = $(elem).offset().top; 53 var elemBottom = elemTop + $(elem).height(); 54 55 return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop)); 56 } 57 58 $.each(ipValidatorTranslations, function (key, value) { 59 if (validatorConfigPublic === '') { 60 validatorConfigPublic = createConfig(key); 61 } 62 $.tools.validator.localize(key, value); 63 }); 64 65 66})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.