function showGallery(data) { if (data !== undefined && data.length > 0) { $.each(data, function (index, value) { value = value + "?updated=1678157514"; $(".html5gallery").append(""); }); var tag = document.createElement("script"); tag.src = "./lib/html5gallery/html5gallery.js"; document.getElementsByTagName("head")[0].appendChild(tag); } else { $(".html5gallery").remove(); } } function showZoneInfo(data) { let serviceDesk = data.service_desk; let hasServiceDesk = serviceDesk && serviceDesk.service_desk_as_contact; let hasOutlook = data.phish_report_on_microcourse && data.phish_report_on_microcourse.outlook; let hasGmail = data.phish_report_on_microcourse && data.phish_report_on_microcourse.gmail; let hasAddin = hasOutlook || hasGmail; if (!data.phish_report_on_microcourse && data.modules && data.modules.outlook_add_in) { hasAddin = true; hasOutlook = true; // Set default in case has Addin but phish_report_on_microcourse is undefined } const customLink = data.custom_link; let hasCustomLink = customLink && (customLink.description.length || (customLink.link_text.length && customLink.link_url.length)); if (hasServiceDesk) { $.each(serviceDesk, function (key, value) { if (key === "instruction") { if (value.trim()) { $(".service-desk-instruction").html(value.trim()); } else { $(".service-desk-extend").remove(); } } else if (key === "service_desk_as_contact") { // Do nothing } else { if (value.trim()) { $("." + key).html(value); } else { $("." + key) .parent(".item") .remove(); } } }); } if (hasServiceDesk) { $(".service-desk-wrapper").show(); $(".service-desk-extend").show(); } if (hasOutlook) { $(".outlook-tooltip").show(); } else if (hasGmail) { $(".gmail-tooltip").show(); } if (hasServiceDesk && hasOutlook) { $(".heading i").text("If you identify a phishing email, report the email by:"); $(".service-desk-title").show(); $(".outlook-title").show(); } else if (hasServiceDesk && hasGmail) { $(".heading i").text("If you identify a phishing email, report the email by:"); $(".service-desk-title").show(); $(".gmail-title").show(); } else if (hasServiceDesk && !hasAddin) { $(".heading i").text("If you identify a phishing email, report the email by contacting:"); } else if (!hasServiceDesk && hasOutlook) { $(".heading i").text("If you identify a phishing email, report the email by clicking on the Phish reporter above in Outlook:"); } else if (!hasServiceDesk && hasGmail) { $(".heading i").text("If you identify a phishing email, report the email by clicking on the Phish reporter on the side panel in Gmail:"); } if (!hasServiceDesk || !hasAddin) { $(".footer-wrapper").addClass("center"); $(".custom-link-title").hide(); $(".footer-content .heading").hide(); } if (hasCustomLink) { $(".more-info").show(); $(".custom-link .description").text(customLink.description); $(".custom-link .link").text(customLink.link_text); $(".custom-link .link").attr("href", customLink.link_url); } }