PageSourceSearch

https://www.domovy-klas.cz/DPSMain/media/system/js/pux-ajax.js

js domovy-klas.cz collected 2026-10-09 01:45:44 UTC 2,990 bytes, 89 lines download raw bytes

1(function () {
2    pux = window.pux || {};
3    pux.ajax = {};
4    var onBeforeRequestCallbacks = {};
5    var onAfterRequestCallbacks = {};
6
7    var globalContext = '__global';
8
9    pux.ajax.onBeforeRequest = function (callback, context) {
10        if (!context)
11            context = globalContext;
12
13        if (!onBeforeRequestCallbacks[context])
14            onBeforeRequestCallbacks[context] = [];
15
16        onBeforeRequestCallbacks[context].push(callback);
17    }
18
19    pux.ajax.onAfterRequest = function (callback, context) {
20        if (!context)
21            context = globalContext;
22
23        if (!onAfterRequestCallbacks[context])
24            onAfterRequestCallbacks[context] = [];
25
26        onAfterRequestCallbacks[context].push(callback);
27    }
28
29
30    var fireCallbacks = function (callbacks) {
31        var l = callbacks.length;
32        for (var i = 0; i < l; i++) {
33            callbacks[i].call();
34        }
35    }
36
37    var onBeforeRequestInternal = function (sender, args) {
38        /*
39            var updatePanelsToUpdate = args.get_updatePanelsToUpdate();
40            if (updatePanelsToUpdate && updatePanelsToUpdate.length) {
41              var divId = updatePanelsToUpdate[0].replace(/\$/g, '_');
42              
43              var div = jQuery(document.getElementById(divId)).slideUp();
44            }
45          */
46
47        var context = null;
48        var submitButton = $(args.get_postBackElement());
49        if (submitButton.length) {
50            context = submitButton.attr('data-ajax-context');
51            if (context && onBeforeRequestCallbacks[context]) {
52                // fire callbacks for specified context
53                fireCallbacks(onBeforeRequestCallbacks[context]);
54            }
55
56            // fire callbacks for global context
57            if (onBeforeRequestCallbacks[globalContext])
58                fireCallbacks(onBeforeRequestCallbacks[globalContext]);
59        }
60
61        if (context)
62            args.get_request().set_userContext(context);
63    }
64
65
66    var onAfterRequestInternal = function (sender, args) {
67        var context = args.get_response().get_webRequest().get_userContext();
68
69        if (context && onAfterRequestCallbacks[context]) {
70            // fire callbacks for specified context
71            fireCallbacks(onAfterRequestCallbacks[context]);
72        }
73
74        // fire callbacks for global context
75        if (onAfterRequestCallbacks[globalContext])
76            fireCallbacks(onAfterRequestCallbacks[globalContext]);
77    }
78
79    // register custom handlers to ajax manager
80    $(document).ready(function () {
81        if (typeof (Sys) !== "undefined") {
82            if (typeof (Sys.WebForms) !== "undefined") {
83                var manager = Sys.WebForms.PageRequestManager.getInstance();
84                manager.add_beginRequest(onBeforeRequestInternal);
85                manager.add_endRequest(onAfterRequestInternal);
86            }
87        }
88    });
89})();

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.