1
0
mirror of https://github.com/MailHops/mailhops-plugin.git synced 2025-05-21 16:40:14 -07:00

js/mailhops_details.js: add debugging to auth data output.

This commit is contained in:
Mihai Moldovan 2024-04-17 11:07:17 +02:00
parent 37546872f9
commit 50ca444c6b

View File

@ -57,6 +57,7 @@ function updateContent(msg, noauth) {
const sender = msg.message.sender || null; const sender = msg.message.sender || null;
const unit = msg.options.unit || "mi"; const unit = msg.options.unit || "mi";
const theme = msg.options.theme || "light"; const theme = msg.options.theme || "light";
const debug = msg.options.debug || false;
let client = null; let client = null;
let items = []; let items = [];
@ -138,15 +139,24 @@ function updateContent(msg, noauth) {
if (!noauth && msg.message.auth.length) { if (!noauth && msg.message.auth.length) {
for (var a = 0; a < msg.message.auth.length; a++){ for (var a = 0; a < msg.message.auth.length; a++){
if (msg.message.auth[a].icon) { if (msg.message.auth[a].icon) {
auth += '<label class="tiny ui label ' + msg.message.auth[a].color + '"><img src="' + msg.message.auth[a].icon + '"/>' + msg.message.auth[a].type + ' ' + msg.message.auth[a].copy + '</label>'; var add = '<label class="tiny ui label ' + msg.message.auth[a].color + '"><img src="' + msg.message.auth[a].icon + '"/>' + msg.message.auth[a].type + ' ' + msg.message.auth[a].copy + '</label>';
if (debug) {
console.log("adding to auth (type icon): '" + add + "'");
}
auth += add;
} }
else if (msg.message.auth[a].link) { else if (msg.message.auth[a].link) {
if (-1 !== msg.message.auth[a].link.indexOf(',')) { var add = '';
auth += '<a class="tiny ui label ' + msg.message.auth[a].color + '" href="'+msg.message.auth[a].link.substr(0,msg.message.auth[a].link.indexOf(','))+'" target="_blank">' + msg.message.auth[a].type + '</a>'; if (-1 != msg.message.auth[a].link.indexOf(',')) {
add = '<a class="tiny ui label ' + msg.message.auth[a].color + '" href="'+msg.message.auth[a].link.substr(0,msg.message.auth[a].link.indexOf(','))+'" target="_blank">' + msg.message.auth[a].type + '</a>';
} }
else { else {
auth += '<a class="tiny ui label ' + msg.message.auth[a].color + '" href="'+msg.message.auth[a].link+'" target="_blank">' + msg.message.auth[a].type + '</a>'; add = '<a class="tiny ui label ' + msg.message.auth[a].color + '" href="'+msg.message.auth[a].link+'" target="_blank">' + msg.message.auth[a].type + '</a>';
} }
if (debug) {
console.log("adding to auth (type link): '" + add + "'");
}
auth += add;
} }
} }
} }