• File: settings.js
  • Full Path: /home/daemondevin/public_html/portableapps/personal/settings.js
  • Date Modified: 10/17/2026 7:00 PM
  • File size: 920 bytes
  • MIME-type: application/javascript
  • Charset: utf-8
// Settings page: the "Test my server again" button.
(function () {
  'use strict';
  var b = document.getElementById('recheck'), m = document.getElementById('recheck-msg');
  if (!b || !window.tsProbe) return;
  var cfg = JSON.parse(b.getAttribute('data-probe'));
  b.addEventListener('click', function () {
    b.disabled = true; m.textContent = 'Testing…';
    window.tsProbe(cfg).then(function (r) {
      var fd = new FormData();
      fd.append('_csrf', cfg.csrf);
      fd.append('pretty', r.pretty ? '1' : '0');
      fd.append('exposed', r.exposed === null ? '' : (r.exposed ? '1' : '0'));
      return fetch(cfg.post, { method: 'POST', body: fd, credentials: 'same-origin', headers: { 'X-CSRF-Token': cfg.csrf } });
    }).then(function () { m.textContent = 'Done. Reloading…'; location.reload(); })
      .catch(function () { m.textContent = 'The test could not run.'; b.disabled = false; });
  });
})();