MediaWiki:Common.js: Difference between revisions

From Disaster Risk Gateway
No edit summary
Tag: Reverted
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
mw.loader.using('mediawiki.util').then(function () {
$(document).ready(function() {
     function insertFooter() {
     // Check if we are NOT on the main page
        var $icons = $('#footer-icons');
    if (mw.config.get('wgPageName') !== mw.config.get('wgMainPageTitle').replace(/ /g, '_')) {
        if (!$icons.length) return setTimeout(insertFooter, 100);
        // Create the back button
         $icons.before(`
         var backButton = $('<button id="backButton">Go Back</button>');
            <div id="drg-footer">
       
                <div class="drg-columns">
        // Apply styles
                    <div class="drg-column drg-column-left">
        backButton.css({
                        <a href="/index.php/Disaster_Risk_Gateway">About</a>
            "position": "fixed",
                        <a href="/index.php/Disaster_Risk_Gateway:Privacy_Notice">Privacy Notice</a>
            "bottom": "20px",
                        <a href="/index.php/Disaster_Risk_Gateway:Terms_of_Use">Terms of Use</a>
            "left": "20px",
                        <a href="mailto:DisasterRiskGateway@bgs.ac.uk"><strong>Contact Us</strong></a>
            "background-color": "#007bff",
                    </div>
            "color": "white",
                    <div class="drg-divider"></div>
            "border": "none",
                    <div class="drg-column drg-column-center">
            "padding": "5px 10px",
                        <div class="drg-eu-flag">
            "font-size": "14px",
                            <img src="/images/e/e3/Normal-reproduction-high-resolution_2.jpg" alt="EU logo">
            "cursor": "pointer",
                        </div>
            "border-radius": "5px",
                        <div class="drg-eu-text">
            "box-shadow": "0px 2px 5px rgba(0,0,0,0.2)"
                            MYRIAD-EU project has received funding from the European Union’s Horizon 2020 Research and Innovation Programme under Grant Agreement No. 101003276.
        });
                        </div>
 
                    </div>
        // Add click function to go back
                    <div class="drg-divider"></div>
        backButton.click(function() {
                    <div class="drg-column drg-column-right">
             history.back();
                        <a href="https://www.myriadproject.eu" target="_blank" rel="noopener">MYRIAD-EU</a>
        });
                        <a href="https://be.linkedin.com/company/myriad-eu-project?trk=public_post_feed-actor-name" target="_blank" rel="noopener">LinkedIn</a>
 
                        <a href="#" target="_blank" rel="noopener">MYRIAD-EU dashboard</a>
        // Add the button to the page
                    </div>
         $("body").append(backButton);
                </div>
                <div class="drg-disclaimer">
                    This site is hosted by the British Geological Survey but responsibility for the content of the site lies with the
  <a href="https://www.myriadproject.eu" target="_blank" rel="noopener noreferrer">MYRIAD-EU</a> project. Questions or comments: <a href="mailto:DisasterRiskGateway@bgs.ac.uk">DisasterRiskGateway@bgs.ac.uk</a>
                </div>
             </div>
         `);
     }
     }
    insertFooter();
});
});

Latest revision as of 11:47, 12 August 2025

mw.loader.using('mediawiki.util').then(function () {
    function insertFooter() {
        var $icons = $('#footer-icons');
        if (!$icons.length) return setTimeout(insertFooter, 100);
        $icons.before(`
            <div id="drg-footer">
                <div class="drg-columns">
                    <div class="drg-column drg-column-left">
                        <a href="/index.php/Disaster_Risk_Gateway">About</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="mailto:DisasterRiskGateway@bgs.ac.uk"><strong>Contact Us</strong></a>
                    </div>
                    <div class="drg-divider"></div>
                    <div class="drg-column drg-column-center">
                        <div class="drg-eu-flag">
                            <img src="/images/e/e3/Normal-reproduction-high-resolution_2.jpg" alt="EU logo">
                        </div>
                        <div class="drg-eu-text">
                            MYRIAD-EU project has received funding from the European Union’s Horizon 2020 Research and Innovation Programme under Grant Agreement No. 101003276.
                        </div>
                    </div>
                    <div class="drg-divider"></div>
                    <div class="drg-column drg-column-right">
                        <a href="https://www.myriadproject.eu" target="_blank" rel="noopener">MYRIAD-EU</a>
                        <a href="https://be.linkedin.com/company/myriad-eu-project?trk=public_post_feed-actor-name" target="_blank" rel="noopener">LinkedIn</a>
                        <a href="#" target="_blank" rel="noopener">MYRIAD-EU dashboard</a>
                    </div>
                </div>
                <div class="drg-disclaimer">
                    This site is hosted by the British Geological Survey but responsibility for the content of the site lies with the 
  <a href="https://www.myriadproject.eu" target="_blank" rel="noopener noreferrer">MYRIAD-EU</a> project. Questions or comments: <a href="mailto:DisasterRiskGateway@bgs.ac.uk">DisasterRiskGateway@bgs.ac.uk</a>
                </div>
            </div>
        `);
    }
    insertFooter();
});