PageSourceSearch

https://www.orange.pl/_ui/desktop/common/js/acc.common.js

js orange.pl collected 2026-09-24 08:44:42 UTC 3,955 bytes, 117 lines download raw bytes

1var ACC = {};
2
3ACC.common = {
4
5    bindAll: function() {
6        ACC.common.bindToUiCarouselLink();
7    },
8
9    bindToUiCarouselLink: function() {
10    }
11};
12
13$(document).ready(function() {
14    ACC.common.bindAll();
15});
16
17
18/* Extend jquery with a postJSON method */
19jQuery.extend({
20	postJSON: function (url, data, callback)
21    {
22        return jQuery.post(url, data, callback, "json");
23    }
24});
25
26// add a CSRF request token to POST ajax request if its not available
27$.ajaxPrefilter(function (options, originalOptions, jqXHR)
28{
29    // Modify options, control originalOptions, store jqXHR, etc
30    if (options.type === "post" || options.type === 'POST')
31    {
32        if (options.data.indexOf("CSRFToken") === -1)
33        {
34            if ( !options.beforeSend) {
35                options.beforeSend = function (xhr) {
36                    xhr.setRequestHeader('CSRFToken', ACC.common.CSRFToken);
37                }
38            }
39        }
40    }
41});
42if (!Array.from) {
43    Array.from = (function () {
44        var toStr = Object.prototype.toString;
45        var isCallable = function (fn) {
46            return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
47        };
48        var toInteger = function (value) {
49            var number = Number(value);
50            if (isNaN(number)) { return 0; }
51            if (number === 0 || !isFinite(number)) { return number; }
52            return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
53        };
54        var maxSafeInteger = Math.pow(2, 53) - 1;
55        var toLength = function (value) {
56            var len = toInteger(value);
57            return Math.min(Math.max(len, 0), maxSafeInteger);
58        };
59
60        // The length property of the from method is 1.
61        return function from(arrayLike/*, mapFn, thisArg */) {
62            // 1. Let C be the this value.
63            var C = this;
64
65            // 2. Let items be ToObject(arrayLike).
66            var items = Object(arrayLike);
67
68            // 3. ReturnIfAbrupt(items).
69            if (arrayLike == null) {
70                throw new TypeError("Array.from requires an array-like object - not null or undefined");
71            }
72
73            // 4. If mapfn is undefined, then let mapping be false.
74            var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
75            var T;
76            if (typeof mapFn !== 'undefined') {
77                // 5. else
78                // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
79                if (!isCallable(mapFn)) {
80                    throw new TypeError('Array.from: when provided, the second argument must be a function');
81                }
82
83                // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
84                if (arguments.length > 2) {
85                    T = arguments[2];
86                }
87            }
88
89            // 10. Let lenValue be Get(items, "length").
90            // 11. Let len be ToLength(lenValue).
91            var len = toLength(items.length);
92
93            // 13. If IsConstructor(C) is true, then
94            // 13. a. Let A be the result of calling the [[Construct]] internal method of C with an argument list containing the single item len.
95            // 14. a. Else, Let A be ArrayCreate(len).
96            var A = isCallable(C) ? Object(new C(len)) : new Array(len);
97
98            // 16. Let k be 0.
99            var k = 0;
100            // 17. Repeat, while k < len… (also steps a - h)
101            var kValue;
102            while (k < len) {
103                kValue = items[k];
104                if (mapFn) {
105                    A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
106                } else {
107                    A[k] = kValue;
108                }
109                k += 1;
110            }
111            // 18. Let putStatus be Put(A, "length", len, true).
112            A.length = len;
113            // 20. Return A.
114            return A;
115        };
116    }());
117}

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.