PageSourceSearch

https://app.sol.dk/static.php/plugins/fjordmail/skins/elastic/js/login_footer.js?s=1785342169

js sol.dk collected 2026-10-02 07:19:25 UTC 3,632 bytes, 84 lines download raw bytes

1// Make sure DOM is ready
2$(document).ready(function() {
3    // Create custom sections under login form: links, status and info
4    setCustomLoginFooter();
5});
6
7function setCustomLoginFooter() {
8    // If #login-form is null, abort
9    let login_footer = document.getElementById('login-footer');
10    if (login_footer == null) return;
11    login_footer.style.visibility = 'hidden';
12
13    // Add #login-custom-footer before #login-footer
14    login_footer.insertAdjacentHTML('beforebegin', '<div id="login-custom-footer"></div>');
15    let login_custom_footer = document.getElementById('login-custom-footer');
16
17    // Add login-status after #login-custom-footer
18    login_custom_footer.insertAdjacentHTML('afterend', '<div id="login-custom-status"></div>');
19    let login_custom_status = document.getElementById('login-custom-status');
20
21    // Fill the containers
22    setLoginFooterLinks(login_custom_footer);
23    setStatusText(login_custom_status);
24}
25
26// Append #login-links to #login_custom_footer
27function setLoginFooterLinks(container) {
28    let login_links = document.createElement('div');
29    login_links.setAttribute('id', 'login-links');
30
31    // Create links in login-links
32    createLoginFooterLink(login_links, rcmail.env.fm_brand_url, rcmail.gettext('login_mainsite', 'fjordmail'), rcmail.gettext('login_mainsite_title', 'fjordmail'));
33    createLoginFooterLink(login_links, rcmail.env.support_url, rcmail.gettext('login_support', 'fjordmail'), rcmail.gettext('login_support_title', 'fjordmail'));
34    if (rcmail.env.fm_status_url) createLoginFooterLink(login_links, rcmail.env.fm_status_url, rcmail.gettext('login_status', 'fjordmail'), rcmail.gettext('login_status_title', 'fjordmail'), true);
35
36    if (rcmail.env.fm_registration) createLoginFooterLink(login_links, rcmail.env.fm_registration_url, rcmail.gettext('login_newaccount', 'fjordmail'), rcmail.gettext('login_newaccount', 'fjordmail'));
37    if (rcmail.env.fm_payment_page) createLoginFooterLink(login_links, rcmail.env.fm_payment_page_url, rcmail.gettext('login_reactivate', 'fjordmail'), rcmail.gettext('login_reactivate', 'fjordmail'), true);
38
39    if (rcmail.env.fm_password_reset) createLoginFooterLink(login_links, rcmail.env.fm_password_reset_url, rcmail.gettext('login_resetpw', 'fjordmail'), rcmail.gettext('login_resetpw_title', 'fjordmail'));
40
41    container.appendChild(login_links);
42}
43
44// Add status text to #login-status
45function setStatusText(container) {
46    if (!(rcmail.env.fm_show_status_message == true && rcmail.env.fm_show_status_message))
47        return;
48
49    let login_status = document.createElement('div');
50    login_status.setAttribute('id', 'login-status');
51
52    let p = document.createElement('p');
53    p.innerHTML = rcmail.gettext('login_status_message', 'fjordmail');
54
55    let span = document.createElement('span');
56    span.setAttribute('class', 'login-status');
57
58    span.append(p);
59    login_status.append(span);
60    container.appendChild(login_status);
61}
62
63/*
64 * Helpers
65*/
66
67// Create '<span>&nbsp;&bull;&nbsp; <a></a></span>' links
68function createLoginFooterLink(container, href, innerHTML, title, breakline = false) {
69    let a = document.createElement('a')
70    a.setAttribute('href', href);
71    a.setAttribute('title', (title == '') ? innerHTML : title);
72    a.setAttribute('target', '_blank');
73    a.setAttribute('rel', 'noopener noreferrer');
74    a.innerHTML = innerHTML;
75
76    let span = document.createElement('span');
77    span.setAttribute('class', 'support-link');
78    span.innerHTML = '&nbsp;&bull;&nbsp;'
79    span.append(a);
80
81    container.append(span);
82
83    if (breakline) container.append(document.createElement('br'));
84}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.