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

Merge pull request #35 from Ionic/feature/prepare-aux-data

Prepare for showing additional information.
This commit is contained in:
Andrew Van Tassel 2024-07-24 16:23:17 -06:00 committed by GitHub
commit 7afd1173de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 31 additions and 3 deletions

View File

@ -136,6 +136,22 @@
</div> </div>
<p>Flag messages as junk if travel time takes longer than normal.</p> <p>Flag messages as junk if travel time takes longer than normal.</p>
</div> </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="grouped fields">
<div class="field"> <div class="field">
<label>Debug Messages</label> <label>Debug Messages</label>

View File

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

View File

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