bug fix settings
This commit is contained in:
parent
877cd65c6d
commit
1ab547d84c
3 changed files with 28 additions and 25 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Poly+",
|
"name": "Poly+",
|
||||||
"version": "1.0",
|
"version": "1.1",
|
||||||
"description": "Power-up your Polytoria experience with Poly+! Created by Index.",
|
"description": "Power-up your Polytoria experience with Poly+! Created by Index.",
|
||||||
"permissions": ["storage", "contextMenus", "tabs", "scripting", "alarms", "notifications"],
|
"permissions": ["storage", "contextMenus", "tabs", "scripting", "alarms", "notifications"],
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
|
|
|
||||||
|
|
@ -374,26 +374,26 @@
|
||||||
<br>
|
<br>
|
||||||
<span style="font-size: 0.8rem; color: orange;">* Currencies other than USD are purely approximations.</span>
|
<span style="font-size: 0.8rem; color: orange;">* Currencies other than USD are purely approximations.</span>
|
||||||
</span>
|
</span>
|
||||||
<div role="group" class="input-group">
|
<select id="IRLPriceWithCurrencyCurrency" class="form-select form-select-sm mb-2" style="width:350px;" data-setting="IRLPriceWithCurrencyCurrency">
|
||||||
<select id="IRLPriceWithCurrencyCurrency" class="form-select form-select-sm mb-2" style="width:350px;" data-setting="IRLPriceWithCurrencyCurrency">
|
<option value="USD" selected>United States Dollar (USD)</option>
|
||||||
<option value="USD" selected>United States Dollar (USD)</option>
|
<option value="EUR">Euro (EUR)</option>
|
||||||
<option value="EUR">Euro (EUR)</option>
|
<option value="CAD">Canadian Dollar (CAD)</option>
|
||||||
<option value="CAD">Canadian Dollar (CAD)</option>
|
<option value="GBP">Great British Pound (GBP)</option>
|
||||||
<option value="GBP">Great British Pound (GBP)</option>
|
<option value="MXN">Mexican Peso (MXN)</option>
|
||||||
<option value="MXN">Mexican Peso (MXN)</option>
|
<option value="AUD">Australian Dollar (AUD)</option>
|
||||||
<option value="AUD">Australian Dollar (AUD)</option>
|
<option value="TRY">Turkish Lira (TRY)</option>
|
||||||
<option value="TRY">Turkish Lira (TRY)</option>
|
<option value="BRL">Brazilian Real (BRL)</option>
|
||||||
<option value="BRL">Brazilian Real (BRL)</option>
|
</select>
|
||||||
</select>
|
<!--
|
||||||
<select id="IRLPriceWithCurrencyPackage" class="form-select form-select-sm mb-2" style="width:350px;" data-setting="IRLPriceWithCurrencyPackage">
|
<select id="IRLPriceWithCurrencyPackage" class="form-select form-select-sm mb-2" style="width:350px;" data-setting="IRLPriceWithCurrencyPackage">
|
||||||
<option value="0" selected>$0.99 Brick Package</option>
|
<option value="0" selected>$0.99 Brick Package</option>
|
||||||
<option value="1">$4.99 Brick Package</option>
|
<option value="1">$4.99 Brick Package</option>
|
||||||
<option value="2">$9.99 Brick Package</option>
|
<option value="2">$9.99 Brick Package</option>
|
||||||
<option value="3">$24.99 Brick Package</option>
|
<option value="3">$24.99 Brick Package</option>
|
||||||
<option value="4">$49.99 Brick Package</option>
|
<option value="4">$49.99 Brick Package</option>
|
||||||
<option value="5">$99.99 Brick Package</option>
|
<option value="5">$99.99 Brick Package</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
-->
|
||||||
</p>
|
</p>
|
||||||
<p class="setting-container" id="HideNotifBadges">
|
<p class="setting-container" id="HideNotifBadges">
|
||||||
<span>
|
<span>
|
||||||
|
|
@ -533,7 +533,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<button id="Save" class="btn btn-primary" disabled="true">Save</button>
|
<button id="Save" class="btn btn-primary">Save</button>
|
||||||
<button id="ResetDefaults" class="btn btn-warning">Reset to Default Settings</button>
|
<button id="ResetDefaults" class="btn btn-warning">Reset to Default Settings</button>
|
||||||
<p class="text-muted mt-2" style="font-size: 0.8rem;">made by Index</p>
|
<p class="text-muted mt-2" style="font-size: 0.8rem;">made by Index</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,8 @@ SaveBtn.addEventListener("click", function() {
|
||||||
Elements.forEach(element => {
|
Elements.forEach(element => {
|
||||||
let Button = element.getElementsByTagName('button')[0]
|
let Button = element.getElementsByTagName('button')[0]
|
||||||
let Options = element.getElementsByTagName('button')[1]
|
let Options = element.getElementsByTagName('button')[1]
|
||||||
let Select = element.getElementsByTagName('select') || []
|
let Select = element.getElementsByTagName('select')
|
||||||
|
console.log(element, Select)
|
||||||
|
|
||||||
if (Button) {
|
if (Button) {
|
||||||
Button.addEventListener('click', function() {
|
Button.addEventListener('click', function() {
|
||||||
|
|
@ -202,6 +203,7 @@ Elements.forEach(element => {
|
||||||
if (Select.length > 0) {
|
if (Select.length > 0) {
|
||||||
Array.from(Select).forEach(element => {
|
Array.from(Select).forEach(element => {
|
||||||
element.addEventListener('change', function() {
|
element.addEventListener('change', function() {
|
||||||
|
console.log('aaa')
|
||||||
SetSetting(element.getAttribute('data-setting'), element, element.selectedIndex)
|
SetSetting(element.getAttribute('data-setting'), element, element.selectedIndex)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -230,8 +232,9 @@ function LoadCurrent() {
|
||||||
|
|
||||||
Elements.forEach(element => {
|
Elements.forEach(element => {
|
||||||
let Status = element.getElementsByClassName('status')[0]
|
let Status = element.getElementsByClassName('status')[0]
|
||||||
console.log(element, FormatBool(Settings[element.getElementsByTagName('button')[0].getAttribute('data-setting')]))
|
if (Status !== undefined) {
|
||||||
Status.innerText = FormatBool(Settings[element.getElementsByTagName('button')[0].getAttribute('data-setting')])
|
Status.innerText = FormatBool(Settings[element.getElementsByTagName('button')[0].getAttribute('data-setting')])
|
||||||
|
}
|
||||||
let SelectInput = element.getElementsByTagName('select')[0]
|
let SelectInput = element.getElementsByTagName('select')[0]
|
||||||
if (SelectInput) {
|
if (SelectInput) {
|
||||||
SelectInput.selectedIndex = Settings[SelectInput.getAttribute('data-setting')]
|
SelectInput.selectedIndex = Settings[SelectInput.getAttribute('data-setting')]
|
||||||
|
|
|
||||||
Reference in a new issue