Changeset 3751456
- Timestamp:
- 10/17/2026 06:11:25 AM (4 weeks ago)
- Location:
- cf7-cost-calculator-price-calculation
- Files:
-
- 30 added
- 3 edited
-
tags/10.5 (added)
-
tags/10.5/backend (added)
-
tags/10.5/backend/checkbox.php (added)
-
tags/10.5/backend/index.php (added)
-
tags/10.5/backend/js (added)
-
tags/10.5/backend/js/cf7_calculator.js (added)
-
tags/10.5/backend/libs (added)
-
tags/10.5/backend/libs/tribute (added)
-
tags/10.5/backend/libs/tribute/tribute.css (added)
-
tags/10.5/backend/libs/tribute/tribute.esm.js (added)
-
tags/10.5/backend/libs/tribute/tribute.js (added)
-
tags/10.5/backend/libs/tribute/tribute.min.js (added)
-
tags/10.5/backend/libs/tribute/tribute.min.js.map (added)
-
tags/10.5/backend/number_format.php (added)
-
tags/10.5/backend/select.php (added)
-
tags/10.5/frontend (added)
-
tags/10.5/frontend/index.php (added)
-
tags/10.5/frontend/js (added)
-
tags/10.5/frontend/js/autoNumeric-1.9.45.js (added)
-
tags/10.5/frontend/js/cf7_calculator.js (added)
-
tags/10.5/frontend/js/formula_evaluator-min.js (added)
-
tags/10.5/frontend/js/style.css (added)
-
tags/10.5/index.php (added)
-
tags/10.5/languages (added)
-
tags/10.5/languages/cf7-cost-calculator-price-calculation.pot (added)
-
tags/10.5/readme.txt (added)
-
tags/10.5/yeekit (added)
-
tags/10.5/yeekit/document.php (added)
-
tags/10.5/yeekit/yeekit.css (added)
-
tags/10.5/yeekit/yeekit.js (added)
-
trunk/frontend/js/cf7_calculator.js (modified) (3 diffs)
-
trunk/index.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cf7-cost-calculator-price-calculation/trunk/frontend/js/cf7_calculator.js
r3586889 r3751456 65 65 var field_regexp = new RegExp('(' + reg.join("|") + ')(?!\\()'); 66 66 $(".ctf7-total").each(function (index) { 67 var eq = $(this).data('formulas'); 67 // Use attr() instead of data(): jQuery's data() coerces numeric 68 // strings like "40" to numbers, which breaks eq.replace below. 69 var eq = $(this).attr('data-formulas'); 68 70 var value_key_vl = false; 69 if (eq == "") {71 if (eq === undefined || eq === null || String(eq).trim() === "") { 70 72 return; 71 73 } 74 eq = String(eq); 72 75 eq = eq.replace(/ /g, ''); 73 76 // Convert function names in formulas to lowercase to make them case-insensitive … … 264 267 $(this).autoNumeric(); 265 268 $(this).autoNumeric("set", total); 269 // Keep the default value in sync so a native form.reset() 270 // (CF7 calls it on load when wpcf7.cached is set) does not 271 // revert the field to the initial "0". 272 $(this).attr("value", $(this).val()); 266 273 $(this).parent().find('.cf7-calculated-name').autoNumeric(); 267 274 $(this).parent().find('.cf7-calculated-name').autoNumeric("set", total); … … 612 619 $(".cf7-hide").closest('p').css('display', 'none'); 613 620 } 621 // Re-run calculations whenever CF7 resets the form: the native reset 622 // event fires before values are restored, so defer to the next tick; 623 // wpcf7reset fires after CF7 finishes its refill request. 624 $(document).on("reset", "form.wpcf7-form", function () { 625 setTimeout(function () { 626 $.cf7_formulas(); 627 }, 0); 628 }); 629 $(document).on("wpcf7reset", function () { 630 $.cf7_formulas(); 631 }); 614 632 }) 615 633 })(jQuery); -
cf7-cost-calculator-price-calculation/trunk/index.php
r3586889 r3751456 7 7 * Description: Create forms with field values calculated based in other form field values for contact form 7 8 8 * Author: add-ons.org 9 * Version: 10. 49 * Version: 10.5 10 10 * Author URI: https://add-ons.org/ 11 11 * License: GPL v2 or later -
cf7-cost-calculator-price-calculation/trunk/readme.txt
r3646828 r3751456 4 4 Requires at least: 2.5 5 5 Tested up to: 7.1 6 Stable tag: 10. 46 Stable tag: 10.5 7 7 Requires PHP: 5.2 8 8 License: GPLv2 or later … … 117 117 118 118 == Changelog == 119 = 10.4 = 119 = 10.5 = 120 Fixed: Comatible with Contact Form 7 version 6.2 121 120 122 Added: SWITCH function 121 123 Example: [calculated name1 "switch(field1,1,10,2,20,3,30,40)"]
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)