PageSourceSearch

https://csce.ca/iparts/Events/Events/Common/PriceOverride.js

js csce.ca collected 2026-10-02 10:02:04 UTC 1,900 bytes, 44 lines download raw bytes

1function Asi_Web_iParts_Events_PriceOverride(priceInputId, revertId, originalPriceId, updatePriceId) {
2
3    this.OnLoad = function () {
4        jQuery("#" + updatePriceId).on("keydown", enterKeyPress);
5        jQuery("#" + priceInputId).on("input", onPriceChange);
6
7        var originalPrice = parseFloat(jQuery("#" + originalPriceId).val());
8        originalPrice.toFixed(2);
9        var priceInput = parseFloat(jQuery("#" + priceInputId).val());
10        priceInput.toFixed(2);
11
12        if (originalPrice != priceInput) {
13            jQuery("#" + revertId).show();
14            jQuery("#" + priceInputId).removeAttr("title");
15        }
16    };
17
18    function onPriceChange() {
19        var override = jQuery("#" + priceInputId).val();
20        var originalPrice = jQuery("#" + originalPriceId).val();
21        //we need to remove the comma seperator in order to get a proper comparison using the parseFloat function otherwise parseFloat(1)==parseFloat(1,345.50) is true. 
22        //This Regex part needs to be replaced with a jQuery plugin in order to be compatible with other cultures
23        if (parseFloat(override) != parseFloat(originalPrice.replace(/[^0-9\.]+/g, ""))) {
24            jQuery("#" + revertId).show();
25            jQuery("#" + updatePriceId).show();
26            jQuery("#" + revertId).attr("tabindex", "0");
27            jQuery("#" + priceInputId).removeAttr("title");
28        }
29        else {
30            jQuery("#" + revertId).hide();
31            jQuery("#" + updatePriceId).hide();
32        }
33    }
34    
35    function enterKeyPress(e) {
36        // look for window.event in case event isn't passed in 
37        if (typeof e == 'undefined' && window.event) { e = window.event; }
38        if (e != null && (e.keyCode == 13 || e.which == 13)) {
39            jQuery("#" + updatePriceId).click();
40            e.stopPropagation();
41        }
42    }
43}
44

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.