1;jQuery(document).ready( function ($) { 2 3 var calculation_driver = { 4 5 init: function init() { 6 var _this = this; 7 8 // events 9 $( '.wpuf-fields' ).keyup( function () { 10 _this.change(); 11 }); 12 }, 13 14 change: function change() { 15 var scope = {}; 16 17 var length = weFormsCalculationObj.form_fields.length, 18 form_fields = weFormsCalculationObj.form_fields; 19 20 for ( var i = 0; i < length ; i++ ) { 21 var index = form_fields[i]; 22 23 var val = parseFloat( $("input[name="+index+"]").val() ); 24 25 if ( isNaN(val) ) { 26 val = 0; 27 } 28 scope[index] = val; 29 } 30 31 $('input[type=number]').each(function(){ 32 if ( $(this).hasClass('we-calc-result') ) { 33 var total_field = $(this).attr("name"); 34 var result = math.eval(String(weFormsCalculationObj.calculation_vars['formulas'][String(total_field)]), scope); 35 $(this).val(result); 36 } 37 }); 38 }, 39 }; 40 41 calculation_driver.init(); 42});
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.