Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix aboutblank toggle #740

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions static/assets/scripts/h.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ try {
} catch (e) {
inFrame = true
}

if (!inFrame && !navigator.userAgent.includes("Firefox")) {
if (!localStorage.getItem("ab")) localStorage.setItem("ab", true)
if (!inFrame && !navigator.userAgent.includes("Firefox") && localStorage.getItem("ab") === "true") {
const popup = open("about:blank", "_blank")
if (!popup || popup.closed) {
alert("Please allow popups and redirects.")
Expand Down Expand Up @@ -47,7 +47,7 @@ if (!inFrame && !navigator.userAgent.includes("Firefox")) {
}
}
// Particles
document.addEventListener("DOMContentLoaded", function (event) {
document.addEventListener("DOMContentLoaded", (event) => {
if (window.localStorage.getItem("Particles") === "true") {
var particlesConfig = {
particles: {
Expand Down Expand Up @@ -163,7 +163,7 @@ document.addEventListener("DOMContentLoaded", function (event) {
}
})
// Splash
let SplashT = [
const SplashT = [
"Over 8 Million Users since 2023",
"Fastest growing proxy server",
"Made by xBubbo",
Expand Down
32 changes: 15 additions & 17 deletions static/assets/scripts/s.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Ads
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", () => {
function adChange(selectedValue) {
if (selectedValue === "default") {
localStorage.setItem("ads", "on")
Expand Down Expand Up @@ -42,7 +42,7 @@ document.addEventListener("DOMContentLoaded", function () {
})

// Dyn
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", () => {
function pChange(selectedValue) {
if (selectedValue === "uv") {
localStorage.setItem("uv", "true")
Expand Down Expand Up @@ -77,7 +77,7 @@ let eventKey = localStorage.getItem("eventKey") || "`"
let eventKeyRaw = localStorage.getItem("eventKeyRaw") || "`"
let pLink = localStorage.getItem("pLink") || "https://classroom.google.com/"

document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", () => {
document.getElementById("eventKeyInput").value = eventKeyRaw
document.getElementById("linkInput").value = pLink

Expand All @@ -88,12 +88,12 @@ document.addEventListener("DOMContentLoaded", function () {
})

const eventKeyInput = document.getElementById("eventKeyInput")
eventKeyInput.addEventListener("input", function () {
eventKeyInput.addEventListener("input", () => {
eventKey = eventKeyInput.value.split(",")
})

var linkInput = document.getElementById("linkInput")
linkInput.addEventListener("input", function () {
linkInput.addEventListener("input", () => {
pLink = linkInput.value
})

Expand All @@ -109,15 +109,13 @@ function saveEventKey() {
var dropdown = document.getElementById("dropdown")
var options = dropdown.getElementsByTagName("option")

var sortedOptions = Array.from(options).sort(function (a, b) {
return a.textContent.localeCompare(b.textContent)
})
var sortedOptions = Array.from(options).sort((a, b) => a.textContent.localeCompare(b.textContent))

while (dropdown.firstChild) {
dropdown.removeChild(dropdown.firstChild)
}

sortedOptions.forEach(function (option) {
sortedOptions.forEach((option) => {
dropdown.appendChild(option)
})

Expand Down Expand Up @@ -165,7 +163,7 @@ function redirectToMainDomain() {
}
}

document.addEventListener("DOMContentLoaded", function (event) {
document.addEventListener("DOMContentLoaded", (event) => {
const icon = document.getElementById("tab-favicon")
const name = document.getElementById("tab-title")
var selectedValue = localStorage.getItem("selectedOption") || "Default"
Expand Down Expand Up @@ -196,9 +194,9 @@ function updateHeadSection(selectedValue) {
}
}
// Background Image
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", () => {
var saveButton = document.getElementById("save-button")
saveButton.addEventListener("click", function () {
saveButton.addEventListener("click", () => {
var backgroundInput = document.getElementById("background-input")
var imageURL = backgroundInput.value

Expand All @@ -211,7 +209,7 @@ document.addEventListener("DOMContentLoaded", function () {
})

var resetButton = document.getElementById("reset-button")
resetButton.addEventListener("click", function () {
resetButton.addEventListener("click", () => {
localStorage.removeItem("backgroundImage")
document.body.style.backgroundImage = "url('default-background.jpg')"
})
Expand Down Expand Up @@ -250,7 +248,7 @@ if (themeId == "") {
document.getElementsByClassName("td")[0].value = themeId

const themeDropdown = document.getElementsByClassName("td")
dropdown.addEventListener("change", function () {
dropdown.addEventListener("change", () => {
const selectedValue = dropdown.value

localStorage.setItem("theme", selectedValue)
Expand Down Expand Up @@ -319,9 +317,9 @@ function AB() {

function toggleAB() {
ab = localStorage.getItem("ab")
if (ab == null) {
if (!ab) {
localStorage.setItem("ab", "false")
} else if (ab == "true") {
} else if (ab === "true") {
localStorage.setItem("ab", "false")
} else {
localStorage.setItem("ab", "true")
Expand Down Expand Up @@ -357,7 +355,7 @@ function SaveEngine() {
}
}

document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", () => {
var selectedEngineName = localStorage.getItem("enginename")
var dropdown = document.getElementById("engine")
if (selectedEngineName) {
Expand Down
Loading