PageSourceSearch

https://app.ollee.org.uk/apps/_global/js/core/class.xhr.js?v=1664896207

js ollee.org.uk collected 2026-10-04 20:16:12 UTC 1,725 bytes, 75 lines download raw bytes

1/*globals $*/
2
3function Xhr(root) {
4
5    'use strict';
6
7    this.root = root === false ? '' : root || '/';
8
9    this.compactData = true;
10
11    this.get = function (url, success, failure) {
12
13        success = success || this.success;
14        failure = failure || this.failure;
15
16        var self = this;
17
18        $.ajax({
19            type: 'GET',
20            url: this.root + url
21        })
22            .done(function (data, textStatus, request) {
23                success(data, textStatus, request);
24            })
25            .fail(function (request, textStatus, errorThrown) {
26                failure(request, textStatus, errorThrown);
27            });
28    };
29
30    this.post = function (url, data, success, failure) {
31
32        success = success || this.success;
33        failure = failure || this.failure;
34
35        if (this.compactData === true) {
36            data = {
37                data: JSON.stringify(data)
38            };
39        }
40
41        var self = this;
42
43        $.ajax({
44            type: 'POST',
45            url: this.root + url,
46            data: data
47        })
48            .done(function (data, textStatus, request) {
49                success(data, textStatus, request);
50            })
51            .fail(function (request, textStatus, errorThrown) {
52                failure(request, textStatus, errorThrown);
53            });
54
55    };
56
57    this.success = function (data, textStatus, request) {
58
59        if (data !== undefined && data.redirect_uri !== undefined) {
60            window.location = data.redirect_uri;
61        }
62
63    };
64
65    this.failure = function (request, textStatus, errorThrown) {
66
67        console.warn(errorThrown);
68    };
69
70    this.setRequiredData = function (data) {
71
72        return data;
73    };
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.