PageSourceSearch

https://www.parcel2go.com/scripts/prohibited-items/prohibited-items.js

js parcel2go.com collected 2026-09-24 08:35:46 UTC 2,557 bytes, 75 lines download raw bytes

1var prohib_app = angular.module("parcel2go.prohib", ["ui.bootstrap"]);
2prohib_app.controller("ProhibitedItemsController", ["$scope", "$timeout", "_localConfig", function(scope, timeout, config) {
3    scope.data = config.data;
4    scope.selectedCourier = 0;
5    scope.selectedCountry = 0;
6    scope.selectedService = 0;
7    scope.showSpinner = false;
8
9    scope.joinDescriptionList = function (list) {
10        return list.map(function(item) { return item.Description }).join(', ');
11    }
12    
13    scope.filterItems = function(items) {
14        angular.forEach(items, function(item)
15        {
16            var countryMatch;
17            var courierMatch;
18            var serviceMatch;
19
20            if (item.Countries.length == 0 || scope.selectedCountry == 0) {
21                countryMatch = true;
22            }
23            else {
24                countryMatch = false;
25                angular.forEach(item.Countries, function(country)
26                {
27                    if (country.Id == scope.selectedCountry) {
28                        countryMatch = true;
29                    }
30                });
31            }
32
33            if (item.Couriers.length == 0 || scope.selectedCourier == 0) {
34                courierMatch = true;
35            }
36            else{
37                courierMatch = false;
38                angular.forEach(item.Couriers, function(courier) {
39                    if (courier.Id == scope.selectedCourier) {
40                        courierMatch = true;
41                    }
42                });
43            }
44
45            if (item.Services.length == 0 || scope.selectedService == 0) {
46                serviceMatch = true;
47            }
48            else {
49                serviceMatch = false;
50                angular.forEach(item.Services, function (service) {
51                    if (service.Id == scope.selectedService) {
52                        serviceMatch = true;
53                    }
54                });
55            }
56
57            item.Show = countryMatch && courierMatch && serviceMatch;
58
59        });
60    };
61
62    scope.filterData = function() {
63        scope.filterItems(scope.data.ProhibItems);
64        scope.filterItems(scope.data.NoCompItems);
65        scope.filterItems(scope.data.MoreInfoItems);
66        scope.filterItems(scope.data.SpecialProvisionsItems);
67
68        scope.toggleSpinner();
69    };
70
71    scope.toggleSpinner = function() {
72        scope.showSpinner = true;
73        timeout(function () { scope.showSpinner = false; }, 1000);
74    }
75}]);

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.