1$.fn.extend({ 2 _disableSubmitButtonSelector : ':input[type="submit"]', 3 4 disableSubmitButtons : function() 5 { 6 $(this).find(this._disableSubmitButtonSelector) 7 .attr('disabled', 'disabled'); 8 9 $(this).find(this._disableSubmitButtonSelector + '[data-disabled-text]') 10 .each(function () { 11 var $this = $(this) 12 if ($this.prop('tagName').toLowerCase() === 'input') { 13 $this.data('enabled-text', $this.val()); 14 $this.val($this.data('disabled-text')); 15 } else { 16 $this.data('enabled-text', $this.html()); 17 $this.html($this.data('disabled-text')); 18 } 19 }); 20 }, 21 22 enableSubmitButtons: function () 23 { 24 $(this).find(this._disableSubmitButtonSelector) 25 .removeAttr('disabled'); 26 $(this).find(this._disableSubmitButtonSelector + '[data-disabled-text]') 27 .each(function () { 28 var $this = $(this) 29 if ($this.prop('tagName').toLowerCase() === 'input') { 30 $this.val($this.data('enabled-text')); 31 } else { 32 $this.html($this.data('enabled-text')); 33 } 34 }); 35 } 36}); 37 38$('form.disable-submit-buttons').on('beforeValidate', function (event) { 39 $(this).disableSubmitButtons(); 40}).on('afterValidate', function (event, messages, errors) { 41 if (errors.length == 0) { 42 return; 43 } 44 45 $(this).enableSubmitButtons(); 46}).on('ajaxComplete', function () { 47 $(this).enableSubmitButtons(); 48});
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.