PageSourceSearch

https://my.kpluss.com/ksretail/_ui/addons/kplussstorefrontcommons/…/common/js/common.remainingQuantity.js

js kpluss.com collected 2026-09-24 17:59:56 UTC 2,109 bytes, 60 lines download raw bytes

1ACC.remainingQuantity = {
2
3    _autoload: [],
4
5    /**
6     * @param {?Object} dataHolderParent
7     * @param {?Object} textHolder
8     * @param contractProductUid
9     */
10    updateRemainingQuantity: function (dataHolderParent, textHolder, contractProductUid) {
11        if (dataHolderParent === null || dataHolderParent.length === 0 || textHolder == null || textHolder.length === 0) {
12            return;
13        }
14        const $remainingQuantityEl = dataHolderParent.find(".js-remainingQuantity");
15
16        const changeText = function (text) {
17            textHolder.fadeOut("fast", function () {
18                $(this).html(text).fadeIn("slow");
19            });
20        };
21
22        const waitMessage = $remainingQuantityEl.data("wait-message");
23        const errorMessage = $remainingQuantityEl.data("error-message");
24        const ajaxErrorMessage = $remainingQuantityEl.data("ajax-error-message");
25        let url = $remainingQuantityEl.data("url");
26        if (contractProductUid != null) {
27            url += "&contractProductUid=" + contractProductUid;
28        }
29
30        changeText(waitMessage);
31
32        if (ACC.contractorder.hasOwnProperty("remainingQuantityRequest")) {
33            ACC.contractorder.remainingQuantityRequest.abort();
34        }
35        ACC.contractorder.remainingQuantityRequest = $.ajax({
36            type: "GET",
37            url: url,
38            timeout: 90000,
39            cache: false,
40            success: function (data) {
41                if (data != null && typeof data === typeof {}) {
42                    const quantity = data.quantity;
43                    const unit = data.unit.name;
44                    changeText(quantity + " " + unit);
45                } else {
46                    changeText(errorMessage);
47                }
48            },
49            error: function (jqXHR, textStatus) {
50                if ("abort" != textStatus) {
51                    console.log('Failed to load available quantity.', jqXHR);
52                    changeText(ajaxErrorMessage);
53                }
54            },
55            done: function (e) {
56            }
57        });
58    }
59
60}

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.