This repository has been archived on 2026-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
polyplus/js/debug.js
Index 3e01832005 quality of life improvements and 1 new feature
- added expanding of messages on the inbox page to quickly see the entire message content (maybe add quick reply feature too?)

- local settings page now uses Polytoria's CSS and isn't weird anymore

- clicking on the extension now opens the settings page instead of a old popup menu

- added debug menu at /my/settings/polyplus-debug to quickly clear all pinned games, clear all best friends, and quick editing of a setting's value

- simplified profile URLs are no longer a setting and are on by default (haven't fully deleted the settings code only deleted the if statement checking if it's enabled)

- simplified profile URLs now have an optional reference URL parameter to fall back on if the user doesn't exist (may replace with history.back or whatever the function is to go to the last location history page)

- forum mentions have been rewritten and no longer require ID caching because they use simplified profile URLs so the user ID is only fetcehd if you click on the URL if the user doesn't exist it sends you back to the forum post. the code is also now way shorter and simpler

- removed "Launch Creator" button because it has been re-added officially

- work in progress unix timestamp markdown for forum posts (not working right now for some reason will fix soon)

- small changes that I'm too lazy to list here
2024-01-23 17:27:49 -06:00

53 lines
No EOL
2 KiB
JavaScript

// DEBUG MENU FOR CLEARING PINNED GAMES AND BEST FRIENDS
document.querySelector('#main-content .container').innerHTML = `
<button class="btn btn-warning" id="clear-pins">Clear Pinned Games</button>
<br>
<button class="btn btn-warning" id="clear-bf">Clear Best Friends</button>
<br>
<label for="settingName">Edit Setting Value</label>
<div class="input-group">
<input type="text" name="settingName" id="edit-setting-name" class="form-control" placeholder="Setting Name..">
<input type="text" id="edit-setting-value" class="form-control" placeholder="New Value..">
<button class="btn btn-warning" id="edit-setting">Submit</button>
</div>
`
const ClearPins = document.getElementById('clear-pins')
const ClearBF = document.getElementById('clear-bf')
const EditSettingName = document.getElementById('edit-setting-name')
const EditSettingValue = document.getElementById('edit-setting-value')
const EditSettingBtn = document.getElementById('edit-setting')
ClearPins.addEventListener('click', function(){
chrome.storage.sync.set({ 'PolyPlus_PinnedGames': [] }, function() {
alert('Successfully cleared Pinned Games.')
});
});
ClearBF.addEventListener('click', function(){
chrome.storage.sync.set({ 'PolyPlus_BestFriends': [] }, function() {
alert('Successfully cleared Best Friends.')
});
});
EditSettingBtn.addEventListener('click', function(){
chrome.storage.sync.get(['PolyPlus_Settings'], function(result) {
result = result.PolyPlus_Settings
let NewValue = EditSettingValue.value
if (NewValue === "true") {NewValue = true}
if (NewValue === "false") {NewValue = false}
if (parseInt(NewValue)) {NewValue = parseInt(NewValue)}
result[EditSettingName.value] = NewValue
chrome.storage.sync.set({ 'PolyPlus_Settings': result }, function() {
alert('Successfully set: "' + EditSettingName.value + '" to ' + NewValue)
});
alert('Successfully cleared Best Friends.')
});
});