diff --git a/css/polytoria.css b/css/polytoria.css index 059a8f3..07e15d6 100644 --- a/css/polytoria.css +++ b/css/polytoria.css @@ -1,9 +1,7 @@ /* - -I did not create this CSS, this CSS is from Polytoria.com -I was given permission by Alyx to download and use it for the extension: https://imgur.com/a/uJW9f5i -I will remove this at request if neccessary - + I did not create this CSS, this CSS is from Polytoria.com + I was given permission by Alyx to download and use it for the extension: https://imgur.com/a/uJW9f5i + I will remove this at request if neccessary */ @charset "UTF-8"; diff --git a/js/background.js b/js/background.js index d15c5cf..1df4530 100755 --- a/js/background.js +++ b/js/background.js @@ -1,14 +1,6 @@ const Manifest = chrome.runtime.getManifest(); const SettingsURL = chrome.runtime.getURL('settings.html'); -/* -ON INSTALL: - -chrome.runtime.onInstalled.addListener(() => { - chrome.tabs.create({url: 'https://polyplus.vercel.app/app/welcome.html'}) -}); -*/ - // WHEN CLICKING ON EXTENSION ICON OPEN THE SETTINGS PAGE chrome.action.onClicked.addListener((tab) => { chrome.tabs.create({active: true, url: SettingsURL}); @@ -73,12 +65,6 @@ function RunUpdateNotifier() { }); } ); - /* - chrome.action.setBadgeBackgroundColor( - {color: 'red'}, - () => { }, - ); - */ } }) .catch((error) => { @@ -93,7 +79,7 @@ chrome.contextMenus.removeAll(function () { title: 'Run Update Notifier', id: 'PolyPlus-RunUpdateNotifier', contexts: ['all'], - documentUrlPatterns: ['https://polytoria.com/my/settings/polyplus#dev'] + documentUrlPatterns: ['https://polytoria.com/my/settings/polyplus*'] }); // COPY ASSET ID CONTEXT MENU ITEM REGISTRATION diff --git a/js/op-comments.js b/js/op-comments.js index e5e9e82..67a5557 100755 --- a/js/op-comments.js +++ b/js/op-comments.js @@ -1,3 +1,7 @@ +/* + this script will need to be updated when the new profile URLs are fully rolled out +*/ + !(() => { let Comments = document.getElementById('comments'); const Type = window.location.pathname.split('/')[1]; @@ -21,7 +25,7 @@ const Observer = new MutationObserver(function (list) { for (let record of list) { for (let element of record.addedNodes) { - if (element.classList === 'card mb-3') { + if (element.classList.contains('card')) { LoadCreatorTag(element); } } diff --git a/js/settings.js b/js/settings.js index d9bae77..10b2895 100755 --- a/js/settings.js +++ b/js/settings.js @@ -11,8 +11,8 @@ document.addEventListener('DOMContentLoaded', function () { PolyPlusItem.classList = 'nav-link'; PolyPlusItem.href = SettingsURL; PolyPlusItem.innerHTML = ` - Poly+ - `; + Poly+ + `; Nav.insertBefore(PolyPlusItem, Nav.getElementsByTagName('hr')[0]); }); diff --git a/js/store/store.js b/js/store/store.js index 9506367..bfb7feb 100755 --- a/js/store/store.js +++ b/js/store/store.js @@ -22,13 +22,18 @@ chrome.storage.sync.get(['PolyPlus_Settings'], async function (result) { } if (Settings.StoreOwnTagOn === true) { - Inventory = (await (await fetch('https://api.polytoria.com/v1/users/' + UserID + '/inventory?type=hat&limit=100')).json()).inventory; - Inventory.concat(await (await fetch('https://api.polytoria.com/v1/users/' + UserID + '/inventory?type=face&limit=100')).json()).inventory; - Inventory.concat(await (await fetch('https://api.polytoria.com/v1/users/' + UserID + '/inventory?type=tool&limit=100')).json()).inventory; - console.log(Inventory); - Array.from(ItemGrid.children).forEach((element) => { - LoadOwnedTags(element); - }); + Inventory = (await (await fetch('https://api.polytoria.com/v1/users/' + UserID + '/inventory?type=hat&limit=100')).json()); + if (Inventory.errors === undefined) { + Inventory = Inventory.inventory + Inventory.concat(await (await fetch('https://api.polytoria.com/v1/users/' + UserID + '/inventory?type=face&limit=100')).json()).inventory; + Inventory.concat(await (await fetch('https://api.polytoria.com/v1/users/' + UserID + '/inventory?type=tool&limit=100')).json()).inventory; + console.log(Inventory); + Array.from(ItemGrid.children).forEach((element) => { + LoadOwnedTags(element); + }); + } else { + console.log(Inventory) + } } if (Settings.EventItemsCatOn === true) { @@ -153,52 +158,44 @@ function EventItems() { ItemGrid.classList.remove('itemgrid'); ItemGrid.innerHTML = `
@@ -484,17 +484,6 @@
Wishlist that item that you REALLY want!