PageSourceSearch

https://www.scalabad.no/scripts/productlistprice.js

js scalabad.no collected 2026-10-08 01:16:17 UTC 2,466 bytes, 64 lines download raw bytes

1mcWeb.productlistprice = new (function ($) {
2    'use strict';
3
4    var obj = this;
5    obj.productlist;
6
7    this.vm = function (product) {
8        obj.productlist = product;
9
10        var self = this;
11        self.service = obj.productlist.service;
12        self.events = {
13            onUpdatePercentageSaved : "mcWeb.productlistprice.onUpdatePercentageSaved"
14        };
15
16        PubSub.subscribe(self.events.onUpdatePercentageSaved, function (message, data) {
17            if (data.YouSavePercent != null && data.YouSavePercent.trim().length > 0) {
18                $('#list-yousave-' + data.Plid).html(data.YouSavePercent);
19                $('#list-yousave-' + data.Plid).show();
20            } else {
21                $('#list-yousave-' + data.Plid).hide();
22            }
23        });
24
25        self.updatePrice = function (plid, quantity, incVat) {
26
27            var data = {
28                plid: plid,
29                quantity: quantity
30            };
31
32            self.service.GetAction("GetProductPrice", data).then(function (priceModel) {
33                try {
34                    if (priceModel != null) {
35
36                        if (incVat) {
37                            if (priceModel.PriceIncVat != null && priceModel.PriceIncVat.length > 0) {
38                                $('#pr' + plid).html(priceModel.PriceIncVat);
39                            }
40                        } else {
41                            if (priceModel.PriceExVat != null && priceModel.PriceExVat.length > 0) {
42                                $('#pr' + plid).html(priceModel.PriceExVat);
43                            }
44                        }
45                        
46                        if (priceModel.PriceRetail != null && priceModel.PriceRetail.length > 0) {
47                            $('#prre' + plid).html(priceModel.PriceRetail);
48                        }
49
50                        if (priceModel.YouSavePercent != null && priceModel.YouSavePercent.trim().length > 0) {
51                            $('#list-yousave-' + plid).html(priceModel.YouSavePercent);
52                            $('#list-yousave-' + plid).show();
53                        } else {
54                            $('#list-yousave-' + plid).hide();
55                        }
56                    }
57                } catch (e) {
58                    alert('Error - Ex: ' + e);
59                }
60            });
61        };
62    }
63
64})(jQuery);

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.