From 899840c596766610a684310370ad3cc34b2196ed Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Mon, 27 Jan 2025 22:46:00 -0500 Subject: [PATCH] Update TGBeta.ps1 --- TGBeta.ps1 | 79 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 6 deletions(-) diff --git a/TGBeta.ps1 b/TGBeta.ps1 index 6e612c9..05c0ba5 100644 --- a/TGBeta.ps1 +++ b/TGBeta.ps1 @@ -956,13 +956,80 @@ function GetHtmlContent { } } - function triggerTweaks() { - const setedgedefaultsearch = document.querySelector('input[name="setedgedefaultsearch"]'); - - - if (setedgedefaultsearch.checked) { - fetch('/setedgedefaultsearch', { method: 'GET' }) + function triggerTweaks() { + // Get the state of the checkboxes + const setEdgeDefaultSearch = document.getElementById('setedgedefaultsearchCheckbox').checked; + const optimizeWindowsPerformance = document.getElementById('setWindowsPerformanceCheckbox').checked; + const stopUnnecessaryServices = document.getElementById('stopUnnecessaryServicesCheckbox').checked; + const disableAnimations = document.getElementById('disableAnimationsCheckbox').checked; + const optimizePerformance = document.getElementById('optimizePerformanceCheckbox').checked; + const increaseFontSize = document.getElementById('increaseFontSizeCheckbox').checked; + const enableDarkMode = document.getElementById('enableDarkModeCheckbox').checked; + const clearTempFiles = document.getElementById('clearTempFilesCheckbox').checked; + + // Get the selected radio button for Windows Performance Optimization + let optimizeWindowsPerformanceLevel = "none"; + if (optimizeWindowsPerformance) { + const radios = document.querySelectorAll('input[name="optimizeWindowsPerformanceLevel"]'); + radios.forEach(radio => { + if (radio.checked) { + optimizeWindowsPerformanceLevel = radio.value; + } + }); } + + // Log or handle the tweaks (replace console.log with actual logic as needed) + console.log("Set Edge Default Search Engine:", setEdgeDefaultSearch); + console.log("Optimize Windows Performance:", optimizeWindowsPerformance); + console.log("Windows Performance Optimization Level:", optimizeWindowsPerformanceLevel); + console.log("Stop Unnecessary Services:", stopUnnecessaryServices); + console.log("Disable Animations:", disableAnimations); + console.log("Optimize Application Performance:", optimizePerformance); + console.log("Increase Font Size:", increaseFontSize); + console.log("Enable Dark Mode:", enableDarkMode); + console.log("Clear Temporary Files:", clearTempFiles); + + // Example: Apply tweaks (replace these comments with actual implementations) + if (setEdgeDefaultSearch) { + // Call function or API to set Edge default search engine + } + + if (optimizeWindowsPerformance) { + if (optimizeWindowsPerformanceLevel === "full") { + // Apply full optimization + } else if (optimizeWindowsPerformanceLevel === "partial") { + // Apply partial optimization + } else { + // No optimization + } + } + + if (stopUnnecessaryServices) { + // Stop unnecessary services + } + + if (disableAnimations) { + // Disable animations in the system + } + + if (optimizePerformance) { + // Optimize application performance + } + + if (increaseFontSize) { + // Increase font size + } + + if (enableDarkMode) { + // Enable dark mode + } + + if (clearTempFiles) { + // Clear temporary files + } + + // Notify user tweaks are applied + alert("Tweaks applied successfully!"); }