Jump to content

MediaWiki:Common.js: Difference between revisions

From Impact Evaluation Foundation
No edit summary
Tag: Reverted
No edit summary
 
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
let wordmark = document.querySelector(".mw-logo-wordmark");
if (wordmark) {
    wordmark.textContent = "Measure, Report, Verify, Repeat";
} else {
    let wordmarkMinerva = document.querySelector(".branding-box a span");
    if (wordmarkMinerva) {
        console.log("Element found");
        wordmarkMinerva.textContent = "Measure, Report, Verify, Repeat";
    } else {
    console.log("Wordmark element not found.");
    }
}


(function () {
if (document.body.classList.contains('skin-vector') && document.body.classList.contains('skin-vector-2022')) {
    // Check if the notification was shown within the last 30 days
    const lastShown = localStorage.getItem('bookBannerLastShown');
    const now = new Date().getTime();
    const ONE_MONTH = 30 * 24 * 60 * 60 * 1000;


     if (lastShown && now - lastShown < ONE_MONTH) {
        let footer = document.querySelector("#footer-info");
         return; // Do not show the banner
     if (footer) {
    }
         let disclaimer = document.createElement("li");  


    // Function to display the popup
         disclaimer.innerHTML = "IEF.wiki is open-source. All content, data, and information contributed to the IEF.wiki is made available under the CC0 1.0 Universal (Public Domain Dedication) license. This means that anyone is free to: Copy, modify, distribute, and use the content for any purpose, including commercial purposes, without asking for permission or providing attribution.";
    const showPopup = () => {
         // Create the popup element
        const bannerHTML = `
            <div id="book-banner-popup" class="book-banner-popup">
                <h3>Subscribe to our newsletter for a free eBook, Regenaissance: The Call to Heal by Sharon Gal-Or, and expert MRV insights delivered to your inbox!</h3>
                <div>
                    <a href="https://iefwiki.substack.com/embed/" target="_blank" class="book-banner-link" style="color: #121212;">Click to Subscribe</a>
                </div>
                <button id="book-banner-close" class="book-banner-close">×</button>
            </div>
        `;
        const container = document.createElement('div');
        container.innerHTML = bannerHTML;
        document.body.appendChild(container);


         // Set display to block to ensure the popup is visible
         footer.appendChild(disclaimer);  
        const bannerPopup = document.getElementById('book-banner-popup');
        bannerPopup.style.display = 'block';


         // Add event listener for the close button
         let contactInfo = document.createElement("li");
        document.getElementById('book-banner-close').addEventListener('click', function () {
            bannerPopup.style.display = 'none';
            localStorage.setItem('bookBannerLastShown', new Date().getTime());
        });
    };


    // Delay the popup display by 5 seconds
        contactInfo.innerHTML = "IEF.wiki is a platform developed by We Are Not Limited (registered in Ireland, registration number 791583). For inquiries, you can reach us via email at hello@ief.wiki or by phone at +353 87 450 8112.";
    setTimeout(showPopup, 5000);
})();


        footer.appendChild(contactInfo);
    }
} else {
    let footerMinerva = document.querySelector("#footer-info-lastmod");


    if (footerMinerva) {
        footerMinerva.innerHTML = "IEF.wiki is open-source. All content, data, and information contributed to the IEF.wiki is made available under the CC0 1.0 Universal (Public Domain Dedication) license. This means that anyone is free to: Copy, modify, distribute, and use the content for any purpose, including commercial purposes, without asking for permission or providing attribution. <br> <br> IEF.wiki is a platform developed by We Are Not Limited (registered in Ireland, registration number 791583). For inquiries, you can reach us via email at hello@ief.wiki or by phone at +353 87 450 8112.";
    footer.appendChild(footerMinerva);
}
   
}


document.addEventListener("DOMContentLoaded", function () {
    document.querySelector(".mw-logo-wordmark").textContent = "Measure, Report, Verify, Repeat";


    let footerUL = document.QuerySelector("#footer-info");
mw.loader.load("https://app.termly.io/resource-blocker/91c4b39f-b45f-4e4c-a1fb-f7ea4b31a79a?autoBlock=on");
    if (footerUL) {
        let text = "<li>All content, data, and information contributed to the IEF.wiki is made available under the CC0 1.0 Universal (Public Domain Dedication) license. This means that anyone is free to: Copy, modify, distribute, and use the content for any purpose, including commercial purposes, without asking for permission or providing attribution.</li>";
        footerUL.appendChild(text);
    }
});

Latest revision as of 14:53, 10 July 2025

let wordmark = document.querySelector(".mw-logo-wordmark");
if (wordmark) {
    wordmark.textContent = "Measure, Report, Verify, Repeat";
} else {
    let wordmarkMinerva = document.querySelector(".branding-box a span");
    if (wordmarkMinerva) {
        console.log("Element found");
        wordmarkMinerva.textContent = "Measure, Report, Verify, Repeat";
    } else {
    console.log("Wordmark element not found.");
    }
}

if (document.body.classList.contains('skin-vector') && document.body.classList.contains('skin-vector-2022')) {

        let footer = document.querySelector("#footer-info"); 
    if (footer) {
        let disclaimer = document.createElement("li"); 

        disclaimer.innerHTML = "IEF.wiki is open-source. All content, data, and information contributed to the IEF.wiki is made available under the CC0 1.0 Universal (Public Domain Dedication) license. This means that anyone is free to: Copy, modify, distribute, and use the content for any purpose, including commercial purposes, without asking for permission or providing attribution.";

        footer.appendChild(disclaimer); 

        let contactInfo = document.createElement("li");

        contactInfo.innerHTML = "IEF.wiki is a platform developed by We Are Not Limited (registered in Ireland, registration number 791583). For inquiries, you can reach us via email at hello@ief.wiki or by phone at +353 87 450 8112.";

        footer.appendChild(contactInfo);
    } 
} else {
    let footerMinerva = document.querySelector("#footer-info-lastmod"); 

    if (footerMinerva) {
        footerMinerva.innerHTML = "IEF.wiki is open-source. All content, data, and information contributed to the IEF.wiki is made available under the CC0 1.0 Universal (Public Domain Dedication) license. This means that anyone is free to: Copy, modify, distribute, and use the content for any purpose, including commercial purposes, without asking for permission or providing attribution. <br> <br> IEF.wiki is a platform developed by We Are Not Limited (registered in Ireland, registration number 791583). For inquiries, you can reach us via email at hello@ief.wiki or by phone at +353 87 450 8112.";
    footer.appendChild(footerMinerva);
}
    
}


mw.loader.load("https://app.termly.io/resource-blocker/91c4b39f-b45f-4e4c-a1fb-f7ea4b31a79a?autoBlock=on");