PageSourceSearch

https://helpthehelpless.org/js/ss/frontend/CsrfTokenHandler.js?1789539201

js helpthehelpless.org collected 2026-10-04 20:23:43 UTC 1,225 bytes, 44 lines download raw bytes

1if (typeof Ext != 'undefined' && Ext.onReady) {
2    
3    Ext.require(['Ext.Ajax']);
4    
5    Ext.onReady(function(){
6
7        Ext.Ajax.on('beforerequest', function(conn, options, eOpts) {
8            if(!options.method || options.method.toUpperCase() == 'POST') {
9                if (!options.params) {
10                    options.params = {};
11                }
12                options.params['data[_Token][key]'] = SS.csrfToken;
13            }
14        });
15        
16    });
17}
18
19if (typeof jQuery != 'undefined') {
20
21    $( document ).ajaxSend(function(event, jqXHR, ajaxOptions) {
22
23        var s = ajaxOptions;
24        
25        if (s.type.toUpperCase() == 'POST') {
26
27            if (s.hasContent && s.contentType !== false) {
28                jqXHR.setRequestHeader( "Content-Type", s.contentType );
29            }
30            
31            if (!ajaxOptions.data) {
32                ajaxOptions.data = '';
33            }
34            
35            if($.type(ajaxOptions.data)=='object') {
36                ajaxOptions.data['data[_Token][key]'] = SS.csrfToken;
37            } else {
38                ajaxOptions.data += (ajaxOptions.data.length?'&':'') + 'data[_Token][key]=' + SS.csrfToken;
39            }
40        }
41        
42    });
43    
44}

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.