MediaWiki:Common.js: Difference between revisions

From Disaster Risk Gateway
Added correct path for About
Tags: Mobile edit Mobile web edit
Trying lazy loading
Tags: Mobile edit Mobile web edit
Line 1: Line 1:
$(function () {
mw.loader.using('mediawiki.util').then(function () {
     var $footer = $('#footer');
     function insertCustomFooter() {
    if ($footer.length === 0) return;
        var $footer = $('#footer');
        if (!$footer.length) return setTimeout(insertCustomFooter, 100); // Retry until #footer is available


    $footer.append(`
        $footer.append(`
        <div id="lcc-footer">
            <div id="lcc-footer">
            <div id="lcc-footer-content">
                <div id="lcc-footer-content">
                <div class="footer-links">
                    <div class="footer-links">
                    <a href="/index.php/Disaster_Risk_Gateway">About</a>
                        <a href="/index.php/Disaster_Risk_Gateway">About</a>
                    <a href="/index.php/Contact">Contact</a>
                        <a href="/index.php/Contact">Contact</a>
                </div>
                    </div>
                <div class="footer-nav">
                    <div class="footer-nav">
                    <a href="/index.php/Disaster_Risk_Gateway:Privacy_Notice">Privacy Notice</a>
                        <a href="/index.php/Disaster_Risk_Gateway:Privacy_Notice">Privacy Notice</a>
                    <a href="/index.php/Disaster_Risk_Gateway:Terms_of_Use">Terms of Use</a>
                        <a href="/index.php/Disaster_Risk_Gateway:Terms_of_Use">Terms of Use</a>
                    <a href="/index.php?title=Main_Page&mobileaction=toggle_view_mobile">Mobile View</a>
                        <a href="/index.php?title=Main_Page&mobileaction=toggle_view_mobile">Mobile View</a>
                </div>
                    </div>
                <div class="footer-legal">
                    <div class="footer-legal"></div>
                    <!-- If you want to add legal/disclaimer info, add links here -->
                    <div class="footer-eu-logo">
                </div>
                        <img src="/wiki/Special:FilePath/EU-logo.png" alt="EU logo">
                <div class="footer-eu-logo">
                    </div>
                    <img src="/wiki/Special:FilePath/EU-logo.png" alt="EU logo">
                    <div class="footer-eu-text">
                </div>
                        <p>This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No. 123456.</p>
                <div class="footer-eu-text">
                    </div>
                    <p>This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No. 123456.</p>
                 </div>
                 </div>
             </div>
             </div>
         </div>
         `);
     `);
     }
 
    insertCustomFooter();
});
});

Revision as of 15:40, 21 May 2025

mw.loader.using('mediawiki.util').then(function () {
    function insertCustomFooter() {
        var $footer = $('#footer');
        if (!$footer.length) return setTimeout(insertCustomFooter, 100); // Retry until #footer is available

        $footer.append(`
            <div id="lcc-footer">
                <div id="lcc-footer-content">
                    <div class="footer-links">
                        <a href="/index.php/Disaster_Risk_Gateway">About</a>
                        <a href="/index.php/Contact">Contact</a>
                    </div>
                    <div class="footer-nav">
                        <a href="/index.php/Disaster_Risk_Gateway:Privacy_Notice">Privacy Notice</a>
                        <a href="/index.php/Disaster_Risk_Gateway:Terms_of_Use">Terms of Use</a>
                        <a href="/index.php?title=Main_Page&mobileaction=toggle_view_mobile">Mobile View</a>
                    </div>
                    <div class="footer-legal"></div>
                    <div class="footer-eu-logo">
                        <img src="/wiki/Special:FilePath/EU-logo.png" alt="EU logo">
                    </div>
                    <div class="footer-eu-text">
                        <p>This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No. 123456.</p>
                    </div>
                </div>
            </div>
        `);
    }

    insertCustomFooter();
});