PageSourceSearch

https://web.fredden.org/assets/lib.js

js fredden.org collected 2026-10-04 11:13:39 UTC 1,261 bytes, 51 lines download raw bytes

1"use strict";
2
3function ajax(url, data) {
4  var b = document.getElementById('banner');
5  var bs = document.getElementById('banner_spin');
6  bs.classList.remove('hidden');
7  if (b.timer) {
8    window.clearTimeout(b.timer);
9  }
10  var req = new XMLHttpRequest();
11  req.onreadystatechange = function() {
12    if (req.readyState != 4) return;
13    b.innerHTML = req.response;
14    b.className = req.status == 200 ? 'okay' : 'error';
15    b.classList.remove('hidden');
16    bs.classList.add('hidden');
17    b.timer = window.setTimeout(function() {
18      if ('okay' == b.className) {
19        window.location.reload();
20      } else {
21        b.classList.add('hidden');
22      }
23    }, 8 * req.status);
24  };
25  req.open('POST', url, true);
26  req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
27  var p = 'xsrf=' + XSRF;
28  if (data) {
29    for (var n in data) {
30      var d = encodeURIComponent(data[n]);
31      n = encodeURIComponent(n);
32      p = p + '&'+n+'='+d;
33    }
34  }
35  req.send(p);
36}
37
38
39if (navigator.id) navigator.id.watch({
40  loggedInUser: currentUser,
41
42  onlogin: function(assertion) {
43    ajax('log-in', {assertion:assertion});
44  },
45
46  onlogout: function() {
47    if (window.location.pathname == '/log-out') return;
48    ajax('log-out');
49  },
50
51});

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.