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

Genral quality of life improvements to settings page #610

Merged
merged 8 commits into from
Apr 15, 2024
2 changes: 1 addition & 1 deletion static/apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/assets/styles/main.css?v=8" />
<link rel="stylesheet" href="/assets/styles/themes/default.css?v=5" />
<script src="/assets/scripts/main.js?v=30"></script>
<script src="/assets/scripts/main.js?v=31"></script>
<script src="/assets/scripts/index.js?v=14"></script>
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>
<script src="assets/scripts/a.js?v=40"></script>
Expand Down
4 changes: 2 additions & 2 deletions static/assets/json/a.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,13 @@
"name": "W3Schools",
"link": "https://www.w3schools.com",
"image": "/assets/media/icons/W3Schools.png",
"categories": ["all"],
"categories": ["all"]
},
{
"name": "Newgrounds",
"link": "https://www.newgrounds.com",
"image": "/assets/media/icons/ng.png",
"categories": ["all", "social", "game", "media"],
"categories": ["all", "social", "game", "media"]
},
{
"name": "Instagram",
Expand Down
310 changes: 91 additions & 219 deletions static/assets/scripts/main.js

Large diffs are not rendered by default.

34 changes: 27 additions & 7 deletions static/assets/scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ document.addEventListener('DOMContentLoaded', function () {
adTypeElement.value = 'default'
}
}
//makes the custom icon and name persistent
const iconElement = document.getElementById('icon')
const nameElement = document.getElementById('name')
const customIcon = localStorage.getItem('CustomIcon')
const customName = localStorage.getItem('CustomName')
iconElement.value = customIcon
nameElement.value = customName

localStorage.setItem('ab', true)
document.getElementById('ab-settings-switch').checked = true
})

// Dyn
Expand Down Expand Up @@ -59,11 +69,12 @@ document.addEventListener('DOMContentLoaded', function () {
})

// Key
var eventKey = localStorage.getItem('eventKey') || '`'
var pLink = localStorage.getItem('pLink') || 'https://classroom.google.com/'
let eventKey = localStorage.getItem('eventKey') || '`'
let eventKeyRaw = localStorage.getItem('eventKeyRaw') || '`'
let pLink = localStorage.getItem('pLink') || 'https://classroom.google.com/'

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

const selectedOption = localStorage.getItem('selectedOption')
Expand All @@ -72,9 +83,9 @@ document.addEventListener('DOMContentLoaded', function () {
}
})

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

var linkInput = document.getElementById('linkInput')
Expand All @@ -83,9 +94,12 @@ linkInput.addEventListener('input', function () {
})

function saveEventKey() {
eventKey = eventKeyInput.value
localStorage.setItem('eventKey', eventKey)
eventKey = eventKeyInput.value.split(',')
eventKeyRaw = eventKeyInput.value
localStorage.setItem('eventKey', JSON.stringify(eventKey))
localStorage.setItem('pLink', pLink)
localStorage.setItem('eventKeyRaw', eventKeyRaw)
window.location = window.location
}
// Tab Cloaker
var dropdown = document.getElementById('dropdown')
Expand Down Expand Up @@ -130,6 +144,12 @@ function CustomName() {
console.log('saveName function called with name value:', nameValue)
localStorage.setItem('CustomName', nameValue)
}
function ResetCustomCloak() {
localStorage.removeItem('CustomName')
localStorage.removeItem('CustomIcon')
document.getElementById('icon').value = ''
document.getElementById('name').value = ''
}

function redirectToMainDomain() {
var currentUrl = window.location.href
Expand Down
9 changes: 9 additions & 0 deletions static/assets/styles/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,12 @@ select {
#last-updated {
margin-top: -3%;
}
#ab-settings {
display: flex;
align-items: center;
gap: 5vw;
}
#ab-settings-container {
margin-top: 13px;
margin-left: 20px;
}
6 changes: 3 additions & 3 deletions static/games.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<script src="./m/bundle.js?v=6"></script>
<script src="./m/config.js?v=6"></script>
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>
<script src="/assets/scripts/main.js?v=30"></script>
<script src="/assets/scripts/main.js?v=31"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WKJQ5QHQTJ"></script>
<!-- DO NOT REMOVE-->
<!-- DO NOT REMOVE-->
<script>
window.dataLayer = window.dataLayer || []
function gtag() {
Expand All @@ -44,7 +44,7 @@

gtag('config', 'G-WKJQ5QHQTJ')
</script>
<!-- DO NOT REMOVE-->
<!-- DO NOT REMOVE-->
<div id="adv"></div>
</body>
</html>
2 changes: 1 addition & 1 deletion static/go.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h1>Now.gg fix is being applied, please wait.</h1>
width="100%"
allowfullscreen></iframe>
<script src="assets/scripts/index.js?v=14"></script>
<script src="/assets/scripts/main.js?v=30"></script>
<script src="/assets/scripts/main.js?v=31"></script>
<script src="./m/bundle.js?v=5"></script>
<script src="./m/config.js?v=5"></script>
<script src="assets/scripts/frame.js?v=36"></script>
Expand Down
6 changes: 3 additions & 3 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ <h1 class="title"><xn>Inter</xn>stellar</h1>
<script src="./m/bundle.js?v=5"></script>
<script src="./m/config.js?v=5"></script>
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>
<script src="/assets/scripts/main.js?v=30"></script>
<!-- DO NOT REMOVE-->
<script src="/assets/scripts/main.js?v=31"></script>
<!-- DO NOT REMOVE-->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WKJQ5QHQTJ"></script>
<script>
window.dataLayer = window.dataLayer || []
Expand All @@ -44,7 +44,7 @@ <h1 class="title"><xn>Inter</xn>stellar</h1>

gtag('config', 'G-WKJQ5QHQTJ')
</script>
<!-- DO NOT REMOVE-->
<!-- DO NOT REMOVE-->
<div id="adv"></div>
</body>
</html>
33 changes: 23 additions & 10 deletions static/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel="shortcut icon" id="tab-favicon" href="favicon.png" />
<title id="tab-title">Home</title>
<link rel="stylesheet" href="/assets/styles/main.css?v=8" />
<link rel="stylesheet" href="/assets/styles/settings.css?v=4" />
<link rel="stylesheet" href="/assets/styles/settings.css?v=5" />
<link rel="stylesheet" href="/assets/styles/themes/default.css?v=5" />
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>
</head>
Expand All @@ -20,16 +20,24 @@
<div class="settings-card">
<h3>About:Blank</h3>
<p>Cloak the site in an about:blank page and toggle about:blank on startup (enabled by default)</p>
<button onclick="AB()" class="key-button">Open Popup</button>
<button class="key-button" onclick="toggleAB()">Toggle automatic about:blank</button>
<div id="ab-settings">
<div id="ab-settings-container">
<label class="switch">
<input type="checkbox" id="ab-settings-switch" class="slider-checkbox" onchange="toggleAB()" />
<span class="slider-round"></span>
</label>
</div>
<button onclick="AB()" class="key-button">Open Popup</button>
</div>
</div>

<div class="settings-card">
<h3>Set Panic Key</h3>
<p>
Quickly open an educational site when the teacher comes. The panic link is also used to redirect you when
about:blank windows are opened.
about:blank windows are opened. For multiple key strokes separate them with a comma. (e.g. "a, b, c")
</p>
<input type="text" id="eventKeyInput" placeholder="Panic Key" class="key-form" />
<input type="text" id="eventKeyInput" placeholder="Panic Keys (comma separated)" class="key-form" />
<input class="key-form" placeholder="Panic Link" type="text" id="linkInput" value />
<button class="key-button" value="Save" onclick="saveEventKey()">Save</button>
</div>
Expand Down Expand Up @@ -87,6 +95,9 @@ <h3>Tab Cloaker</h3>
<button class="key-button" value="Save" onclick="CustomIcon(); CustomName(); redirectToMainDomain();">
Save
</button>
<button class="key-button" value="Reset" onclick="ResetCustomCloak(); redirectToMainDomain();">
Reset Cloak
</button>
</div>
<div class="settings-card">
<h3>Search Engine</h3>
Expand Down Expand Up @@ -161,13 +172,15 @@ <h3>Site Info</h3>
Questions? Need more links? Join our community at
<a style="color: white" href="https://discord.gg/interstellar">discord.gg/interstellar</a>!
</p>
<a style="color: white"href="/tos">By using Interstellar, you agree you understand and acknowledge our Terms of Service and Privacy Policy.</p>
<a style="color: white" href="/tos"
>By using Interstellar, you agree you understand and acknowledge our Terms of Service and Privacy Policy.</a
>
</div>
</div>
</div>
<script src="/assets/scripts/main.js?v=30"></script>
<script src="/assets/scripts/settings.js?v=20"></script>
<!-- DO NOT REMOVE-->
<script src="/assets/scripts/main.js?v=31"></script>
<script src="/assets/scripts/settings.js?v=21"></script>
<!-- DO NOT REMOVE-->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WKJQ5QHQTJ"></script>
<script>
window.dataLayer = window.dataLayer || []
Expand All @@ -178,7 +191,7 @@ <h3>Site Info</h3>

gtag('config', 'G-WKJQ5QHQTJ')
</script>
<!-- DO NOT REMOVE-->
<!-- DO NOT REMOVE-->
<div id="adv"></div>
</body>
</html>
6 changes: 3 additions & 3 deletions static/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
</script>
<script src="./m/bundle.js?v=4"></script>
<script src="./m/config.js?v=3"></script>
<script src="/assets/scripts/main.js?v=30"></script>
<!-- DO NOT REMOVE-->
<script src="/assets/scripts/main.js?v=31"></script>
<!-- DO NOT REMOVE-->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WKJQ5QHQTJ"></script>
<script>
window.dataLayer = window.dataLayer || []
Expand All @@ -104,6 +104,6 @@

gtag('config', 'G-WKJQ5QHQTJ')
</script>
<!-- DO NOT REMOVE-->
<!-- DO NOT REMOVE-->
</body>
</html>
Loading