Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
No edit summary
No edit summary
Line 31: Line 31:
   document.head.appendChild(script);
   document.head.appendChild(script);
});
});
$(document).ready(function() {
// Wrap in mw.loader to ensure MediaWiki environment is ready
     // Check if banner was dismissed
mw.loader.using(['jquery'], function() {
    if (!localStorage.getItem('siteNoticeDismissed')) {
     $(function() {
        // Create banner
        // Only show if not dismissed
        var banner = $('<div id="site-notice-banner">Due to higher spamming on this platform we have limited creating pages, if you want to edit or remove a page you can connect with us.<span class="close-banner">×</span></div>');
        if (!localStorage.getItem('siteNoticeDismissed')) {
       
            // Create banner
        // Append to body
            var banner = $('<div id="site-notice-banner">Due to higher spamming on this platform we have limited creating pages, if you want to edit or remove a page you can connect with us.<span class="close-banner">×</span></div>');
        $('body').prepend(banner);
           
            // Append to #mw-content-text or to body for fixed position
            $('body').prepend(banner);


        // Close button click event
            // Close button
        $('#site-notice-banner .close-banner').click(function() {
            $('#site-notice-banner .close-banner').on('click', function() {
            $('#site-notice-banner').slideUp();
                $('#site-notice-banner').slideUp();
            localStorage.setItem('siteNoticeDismissed', 'true');
                localStorage.setItem('siteNoticeDismissed', 'true');
        });
            });
     }
        }
     });
});
});

Revision as of 05:10, 4 November 2025

mw.loader.using('mediawiki.util').then(function() {
  var script = document.createElement('script');
  script.type = 'application/ld+json';
  script.text = JSON.stringify({
    "@context": "https://schema.org",
    "@type": "Organization",
    "name": "WikiGenius",
    "url": "https://wikigenius.org/",
    "logo": "https://static.wikioasis.org/wikigeniuswiki/2/21/WikiGenius.png",
    "foundingDate": "2023-07-22",
    "description": "WikiGenius is a dedicated online encyclopedia that profiles entrepreneurs, startups, business leaders, and founders worldwide. Our platform highlights inspiring success stories, innovative companies, and industry pioneers, providing reliable and well-researched information to support the business community and aspiring entrepreneurs.",
    "founder": {
      "@type": "Person",
      "name": "Shovon Ahmed",
      "sameAs": [
        "https://g.co/kgs/VEEEjKG",
        "https://www.google.com/search?kgmid=/g/11r3_4dnj8"
      ]
    },
    "sameAs": [
      "https://www.facebook.com/profile.php?id=61574894462519",
      "https://www.instagram.com/wiki.genius/",
      "https://www.linkedin.com/company/wikigenius10/"
    ],
    "address": {
      "@type": "PostalAddress",
      "addressRegion": "Florida",
      "addressCountry": "United States"
    }
  });
  document.head.appendChild(script);
});
// Wrap in mw.loader to ensure MediaWiki environment is ready
mw.loader.using(['jquery'], function() {
    $(function() {
        // Only show if not dismissed
        if (!localStorage.getItem('siteNoticeDismissed')) {
            // Create banner
            var banner = $('<div id="site-notice-banner">Due to higher spamming on this platform we have limited creating pages, if you want to edit or remove a page you can connect with us.<span class="close-banner">×</span></div>');
            
            // Append to #mw-content-text or to body for fixed position
            $('body').prepend(banner);

            // Close button
            $('#site-notice-banner .close-banner').on('click', function() {
                $('#site-notice-banner').slideUp();
                localStorage.setItem('siteNoticeDismissed', 'true');
            });
        }
    });
});