1
0
mirror of https://github.com/MailHops/mailhops-plugin.git synced 2025-05-16 06:10:08 -07:00

{content/preferences.html,js/{mailhops,preferences}.js}: prepare option for extra information.

The current code only shows the basic auth status and a description of
what it means. Some users (i.e., me) would like to see more information,
typically the whole header part that is responsible for the decision, so
prepare to show this information.

This commit does NOT hook it up just yet. This will be done in a later
commit.
This commit is contained in:
Mihai Moldovan 2024-04-17 11:47:52 +02:00
parent 50ca444c6b
commit 72ac705df2
3 changed files with 31 additions and 3 deletions

View File

@ -136,6 +136,22 @@
</div>
<p>Flag messages as junk if travel time takes longer than normal.</p>
</div>
<div class="grouped fields">
<div class="field">
<label>Additional information</label>
<div class="ui radio checkbox">
<input type="radio" id="extrainfo_on" name="extrainfo" value="on" />
<label for="extrainfo_on">Show</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" id="extrainfo_off" name="extrainfo" value="off" />
<label for="extrainfo_off">Hide</label>
</div>
</div>
<p>Show additional information in authentication results, typically contains more header content.</p>
</div>
<div class="grouped fields">
<div class="field">
<label>Debug Messages</label>

View File

@ -18,8 +18,9 @@ class MailHops {
theme: 'light',
api_http: 'https://',
api_host: 'api.Mailhops.com',
debug: false,
travel_time_junk: false,
extrainfo: false,
debug: false,
country_filter: []
}
message = {
@ -68,6 +69,9 @@ class MailHops {
if (data.travel_time_junk && data.travel_time_junk != 'off') {
this.options.travel_time_junk = Boolean(data.travel_time_junk);
}
if (data.extrainfo) {
this.options.extrainfo = Boolean(data.extrainfo);
}
if (data.debug) {
this.options.debug = Boolean(data.debug);
}

View File

@ -3,8 +3,9 @@ const MailHopPreferences = {
valid_api_key: false,
unit: 'mi',
theme: 'light',
debug: false,
travel_time_junk: false,
extrainfo: false,
debug: false,
owm_key: '', //OpenWeatherMap.org api key
countries: [],
@ -78,6 +79,7 @@ const MailHopPreferences = {
this.theme = data.theme || 'light';
this.unit = data.unit || 'mi';
this.travel_time_junk = Boolean(data.travel_time_junk);
this.extrainfo = Boolean(data.extrainfo);
this.debug = Boolean(data.debug);
if (data.countries) {
@ -123,6 +125,11 @@ const MailHopPreferences = {
else
document.getElementById("travel_time_junk_off").setAttribute('checked', 'checked');
if (this.extrainfo)
document.getElementById("extrainfo_on").setAttribute('checked', 'checked');
else
document.getElementById("extrainfo_off").setAttribute('checked', 'checked');
if (this.debug)
document.getElementById("debug_on").setAttribute('checked', 'checked');
else
@ -209,6 +216,7 @@ const MailHopPreferences = {
unit: document.querySelector('input[name="unit"]:checked').value,
theme: document.querySelector('input[name="theme"]:checked').value,
travel_time_junk: document.querySelector('input[name="travel_time_junk"]:checked').value == 'on' ? true : false,
extrainfo: document.querySelector('input[name="extrainfo"]:checked').value == 'on' ? true : false,
debug: document.querySelector('input[name="debug"]:checked').value == 'on' ? true : false,
countries: self.countries.join(','),
});
@ -318,4 +326,4 @@ const MailHopPreferences = {
};
MailHopPreferences.init();
MailHopPreferences.init();