Skip to content
wiki.fftac.org

Front Debug

**Site relevance:** Antichrist.net

**Memory type:** plugin source memory

**Source path:** Antichrist.net/wp-content/plugins/uaix-locale-router/assets/front-debug.js

**Size:** 1.1 KB

Summary

if (window.uaixlrFrontDebugReady)

Source Preview

This source file is short enough to preview directly on its source-memory page.

(function () {
  if (window.uaixlrFrontDebugReady) {
    return;
  }

  window.uaixlrFrontDebugReady = true;

  document.addEventListener('DOMContentLoaded', function () {
    var banner = document.querySelector('[data-uaixlr-front-debug]');

    if (!banner) {
      return;
    }

    var toggleLabel = banner.querySelector('[data-uaixlr-front-debug-label]');
    var storageKey = 'uaixlrFrontDebugState';

    var updateLabel = function () {
      if (!toggleLabel) {
        return;
      }

      toggleLabel.textContent = banner.open ? 'Minimize' : 'Expand';
    };

    try {
      if (window.localStorage.getItem(storageKey) === 'collapsed') {
        banner.open = false;
      }
    } catch (error) {
      // Ignore storage access errors and keep the default state.
    }

    updateLabel();

    banner.addEventListener('toggle', function () {
      updateLabel();

      try {
        window.localStorage.setItem(storageKey, banner.open ? 'expanded' : 'collapsed');
      } catch (error) {
        // Ignore storage access errors and keep the UI functional.
      }
    });
  });
})();