silencing changelogs now available
This commit is contained in:
@ -365,6 +365,13 @@
|
||||
<input name="bic" id="bic" />
|
||||
</label>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Miscellaneous</legend>
|
||||
<label class="item">
|
||||
<span class="fh">Show me information about updates</span>
|
||||
<input type="checkbox" id="showChangelog" name="showChangelog" />
|
||||
</label>
|
||||
</fieldset>
|
||||
<div class="item"><button type="submit">Save</button><span id="success"></span></div>
|
||||
<p id="errors"></p>
|
||||
</form>
|
||||
|
@ -87,6 +87,7 @@ async function saveOptions(ev) {
|
||||
let placeName = this.querySelector('#placename').value;
|
||||
let iban = this.querySelector('#iban').value.replaceAll(" ", "");
|
||||
let country = this.querySelector("#country").value;
|
||||
let allowChangelogMessages = this.querySelector("#showChangelog").checked;
|
||||
if (iban != "" && !ibanValidate(iban)) {
|
||||
putError("Please check your IBAN for typing errors.");
|
||||
return;
|
||||
@ -107,7 +108,8 @@ async function saveOptions(ev) {
|
||||
addr__placename: placeName,
|
||||
addr__country: country,
|
||||
pymt__iban: iban,
|
||||
pymt__bic: bic
|
||||
pymt__bic: bic,
|
||||
showChangelog: allowChangelogMessages,
|
||||
};
|
||||
options = Object.fromEntries(Object.entries(options).filter(([k, v]) => v !== ""))
|
||||
console.info("saving", options);
|
||||
@ -121,6 +123,13 @@ async function saveOptions(ev) {
|
||||
|
||||
}
|
||||
|
||||
function boolDefaultTrue(dict, key){
|
||||
if (key in dict){
|
||||
return dict[key];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
async function restoreOptions() {
|
||||
// We do not save user data in managed storage.
|
||||
// let res = await browser.storage.managed.get('colour');
|
||||
@ -128,7 +137,8 @@ async function restoreOptions() {
|
||||
|
||||
let settings = await browser.storage.sync.get();
|
||||
console.info("restoring", settings);
|
||||
document.querySelector('#enable').checked = settings.enable || true;
|
||||
|
||||
document.querySelector('#enable').checked = boolDefaultTrue(settings, "enable");
|
||||
document.querySelector("#bcnum").value = settings.bcnum || "";
|
||||
document.querySelector("#birthday").value = settings.bday || "";
|
||||
document.querySelector("#default_action").value = settings.defaultAction || "";
|
||||
@ -143,6 +153,7 @@ async function restoreOptions() {
|
||||
document.querySelector('#country').value = settings.addr__country || "";
|
||||
document.querySelector('#iban').value = settings.pymt__iban || "";
|
||||
document.querySelector('#bic').value = settings.pymt__bic || "";
|
||||
document.querySelector('#showChangelog').checked = boolDefaultTrue(settings, "showChangelog");
|
||||
}
|
||||
|
||||
let bahncardWindow;
|
||||
|
Reference in New Issue
Block a user