small improvements
- removed tabs permission apparently it was unnecessary - fixed store main page "owned" tags when the user's inventory is private/friends-only - fixed "creator" tags in comment sections around the site - deleted currently-unused currencies.json resource
This commit is contained in:
parent
120f8cc23e
commit
4bf9139a60
8 changed files with 88 additions and 168 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
PolyPlusItem.classList = 'nav-link';
|
||||
PolyPlusItem.href = SettingsURL;
|
||||
PolyPlusItem.innerHTML = `
|
||||
<i class="fa-regular fa-sparkles me-1"></i> <span class="pilltitle">Poly+</span>
|
||||
`;
|
||||
<i class="fa-regular fa-sparkles me-1"></i> <span class="pilltitle">Poly+</span>
|
||||
`;
|
||||
|
||||
Nav.insertBefore(PolyPlusItem, Nav.getElementsByTagName('hr')[0]);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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 = `
|
||||
<div id="p+ei">
|
||||
${Groups[Page].map(
|
||||
(x, index) => `
|
||||
<div class="row px-2 px-lg-0" style="animation-delay: 0.24s;">
|
||||
<div class="col">
|
||||
<h6 class="dash-ctitle2">${x.date}</h6>
|
||||
<h5 class="dash-ctitle">${x.name}</h5>
|
||||
</div>
|
||||
${
|
||||
x.link !== undefined
|
||||
? `
|
||||
<div class="col-auto d-flex align-items-center">
|
||||
<a class="text-muted" href="${x.link}">
|
||||
<span class="d-none d-lg-inline">${x.link.startsWith('https://polytoria.com/places/') ? 'Event Place' : 'Blog Post'}</span>
|
||||
<i class="fas fa-angle-right ms-2"></i>
|
||||
${Groups[Page].map((x, index) => `
|
||||
<div class="row px-2 px-lg-0" style="animation-delay: 0.24s;">
|
||||
<div class="col">
|
||||
<h6 class="dash-ctitle2">${x.date}</h6>
|
||||
<h5 class="dash-ctitle">${x.name}</h5>
|
||||
</div>
|
||||
${x.link !== undefined ? `
|
||||
<div class="col-auto d-flex align-items-center">
|
||||
<a class="text-muted" href="${x.link}">
|
||||
<span class="d-none d-lg-inline">${x.link.startsWith('https://polytoria.com/places/') ? 'Event Place' : 'Blog Post'}</span>
|
||||
<i class="fas fa-angle-right ms-2"></i>
|
||||
</a>
|
||||
</div>
|
||||
`
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
<div class="card card-dash mcard mb-3" style="animation-delay: 0.27s;">
|
||||
<div class="card-body p-0 m-1 scrollFadeContainer">
|
||||
<div class="d-flex">
|
||||
${x.items.map((x) => `
|
||||
<a href="/store/${x.id}">
|
||||
<div class="scrollFade card me-2 place-card force-desktop text-center mb-2" style="opacity: 1;">
|
||||
<div class="card-body">
|
||||
<img src="${x.thumbnail}" class="place-card-image">
|
||||
<div>
|
||||
<div class="mt-2 mb-1 place-card-title">
|
||||
${x.name}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
`).join('')}
|
||||
</div>
|
||||
`
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
<div class="card card-dash mcard mb-3" style="animation-delay: 0.27s;">
|
||||
<div class="card-body p-0 m-1 scrollFadeContainer">
|
||||
<div class="d-flex">
|
||||
${x.items
|
||||
.map(
|
||||
(x) => `
|
||||
<a href="/store/${x.id}">
|
||||
<div class="scrollFade card me-2 place-card force-desktop text-center mb-2" style="opacity: 1;">
|
||||
<div class="card-body">
|
||||
<img src="${x.thumbnail}" class="place-card-image">
|
||||
<div>
|
||||
<div class="mt-2 mb-1 place-card-title">
|
||||
${x.name}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
`
|
||||
)
|
||||
.join('')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
).join('')}
|
||||
</div>
|
||||
</div>
|
||||
`).join('')}
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-center mt-3">
|
||||
|
|
@ -280,20 +277,27 @@ function EventItems() {
|
|||
|
||||
const UpdateEventItems = function () {
|
||||
Current.innerText = Page + 1;
|
||||
Container.innerHTML = Groups[Page].map(
|
||||
(x, index) => `
|
||||
<div class="row px-2 px-lg-0" style="animation-delay: 0.24s;">
|
||||
<div class="col">
|
||||
<h6 class="dash-ctitle2">${x.date}</h6>
|
||||
<h5 class="dash-ctitle">${x.name}</h5>
|
||||
</div>
|
||||
</div>
|
||||
Container.innerHTML = Groups[Page].map((x, index) => `
|
||||
<div class="row px-2 px-lg-0" style="animation-delay: 0.24s;">
|
||||
<div class="col">
|
||||
<h6 class="dash-ctitle2">${x.date}</h6>
|
||||
<h5 class="dash-ctitle">${x.name}</h5>
|
||||
</div>
|
||||
${x.link !== undefined ? `
|
||||
<div class="col-auto d-flex align-items-center">
|
||||
<a class="text-muted" href="${x.link}">
|
||||
<span class="d-none d-lg-inline">${x.link.startsWith('https://polytoria.com/places/') ? 'Event Place' : 'Blog Post'}</span>
|
||||
<i class="fas fa-angle-right ms-2"></i>
|
||||
</a>
|
||||
</div>
|
||||
`
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
<div class="card card-dash mcard mb-3" style="animation-delay: 0.27s;">
|
||||
<div class="card-body p-0 m-1 scrollFadeContainer">
|
||||
<div class="d-flex">
|
||||
${x.items
|
||||
.map(
|
||||
(x) => `
|
||||
${x.items.map((x) => `
|
||||
<a href="/store/${x.id}">
|
||||
<div class="scrollFade card me-2 place-card force-desktop text-center mb-2" style="opacity: 1;">
|
||||
<div class="card-body">
|
||||
|
|
@ -306,9 +310,7 @@ function EventItems() {
|
|||
</div>
|
||||
</div>
|
||||
</a>
|
||||
`
|
||||
)
|
||||
.join('')}
|
||||
`).join('')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
"version_name": "Pre-Release Build (v1.1.1)",
|
||||
"description": "Power-up your Polytoria experience with Poly+! Created by Index.",
|
||||
"homepage_url": "https://polyplus.vercel.app/",
|
||||
"permissions": ["storage", "contextMenus", "tabs", "scripting", "alarms", "notifications"],
|
||||
"permissions": ["storage", "contextMenus", "scripting", "alarms", "notifications"],
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["https://polytoria.com/*"],
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
{
|
||||
"Date": "2023-7-17",
|
||||
"Data": [
|
||||
{
|
||||
"USD": 0.009899999999999999,
|
||||
"EUR": 0.011200000000000002,
|
||||
"CAD": 0.0123,
|
||||
"GBP": 0.008100000000000001,
|
||||
"MXN": 0.1928,
|
||||
"AUD": 0.014199999999999999,
|
||||
"TRY": 0.1583
|
||||
},
|
||||
{
|
||||
"USD": 0.009072727272727274,
|
||||
"EUR": 0.010163636363636363,
|
||||
"CAD": 0.011290909090909091,
|
||||
"GBP": 0.007363636363636363,
|
||||
"MXN": 0.17534545454545455,
|
||||
"AUD": 0.013418181818181819,
|
||||
"TRY": 0.14616363636363636
|
||||
},
|
||||
{
|
||||
"USD": 0.00868695652173913,
|
||||
"EUR": 0.009721739130434783,
|
||||
"CAD": 0.010730434782608695,
|
||||
"GBP": 0.007043478260869565,
|
||||
"MXN": 0.1676521739130435,
|
||||
"AUD": 0.012834782608695652,
|
||||
"TRY": 0.13767826086956522
|
||||
},
|
||||
{
|
||||
"USD": 0.009087272727272727,
|
||||
"EUR": 0.00996,
|
||||
"CAD": 0.010625454545454546,
|
||||
"GBP": 0.006981818181818182,
|
||||
"MXN": 0.17294545454545454,
|
||||
"AUD": 0.012698181818181819,
|
||||
"TRY": 0.14424
|
||||
},
|
||||
{
|
||||
"USD": 0.008331666666666668,
|
||||
"EUR": 0.009323333333333333,
|
||||
"CAD": 0.00974,
|
||||
"GBP": 0.006066666666666666,
|
||||
"MXN": 0.15853333333333333,
|
||||
"AUD": 0.012306666666666667,
|
||||
"TRY": 0.13222
|
||||
},
|
||||
{
|
||||
"USD": 0.0079992,
|
||||
"EUR": 0.008950399999999999,
|
||||
"CAD": 0.0093504,
|
||||
"GBP": 0.005824,
|
||||
"MXN": 0.152192,
|
||||
"AUD": 0.011814400000000001,
|
||||
"TRY": 0.12693120000000002
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -390,15 +390,15 @@
|
|||
<option value="BRL">Brazilian Real (BRL)</option>
|
||||
</select>
|
||||
<!--
|
||||
<select id="IRLPriceWithCurrencyPackage" class="form-select form-select-sm mb-2" style="width:350px;" data-setting="Package" data-parent="IRLPriceWithCurrency">
|
||||
<option value="0" selected>$0.99 Brick Package</option>
|
||||
<option value="1">$4.99 Brick Package</option>
|
||||
<option value="2">$9.99 Brick Package</option>
|
||||
<option value="3">$24.99 Brick Package</option>
|
||||
<option value="4">$49.99 Brick Package</option>
|
||||
<option value="5">$99.99 Brick Package</option>
|
||||
</select>
|
||||
-->
|
||||
<select id="IRLPriceWithCurrencyPackage" class="form-select form-select-sm mb-2" style="width:350px;" data-setting="Package" data-parent="IRLPriceWithCurrency">
|
||||
<option value="0" selected>$0.99 Brick Package</option>
|
||||
<option value="1">$4.99 Brick Package</option>
|
||||
<option value="2">$9.99 Brick Package</option>
|
||||
<option value="3">$24.99 Brick Package</option>
|
||||
<option value="4">$49.99 Brick Package</option>
|
||||
<option value="5">$99.99 Brick Package</option>
|
||||
</select>
|
||||
-->
|
||||
</p>
|
||||
<p class="setting-container" id="hide-notification-badges">
|
||||
<span class="indicator"> </span>
|
||||
|
|
@ -484,17 +484,6 @@
|
|||
<br />
|
||||
<span class="desc"> Wishlist that item that you REALLY want! </span>
|
||||
</p>
|
||||
<!--
|
||||
<p class="setting-container" id="hide-upgrade-button">
|
||||
<span class="indicator"> </span>
|
||||
<span class="title">
|
||||
Hide Upgrade Button
|
||||
<button class="btn btn-sm toggle-btn" data-setting="HideUpgradeBtnOn">Toggle</button>
|
||||
</span>
|
||||
<br>
|
||||
<span class="desc">Hide the ugly blue "Upgrade" button on the sidebar!</span>
|
||||
</p>
|
||||
-->
|
||||
<p class="setting-container" id="try-on-items">
|
||||
<span class="indicator"> </span>
|
||||
<span class="title">
|
||||
|
|
|
|||
Reference in a new issue