MediaWiki:Common.js: Difference between revisions

From Arisepedia
(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: $(document).ready(function() { var currentDomain = window.location.hostname; var currentPath = window.location.pathname; var currentTitle = mw.config.get('wgPageName'); var englishDomain = 'arisepedia.com'; var hindiDomain = 'hi.arisepedia.com'; var switcherHtml = '<div id="language-switcher" style="position: fixed; top: 10px; right: 10px; z-index: 1000;">' +...")
 
Tag: Replaced
 
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
$(document).ready(function() {
    var currentDomain = window.location.hostname;
    var currentPath = window.location.pathname;
    var currentTitle = mw.config.get('wgPageName');
   
    var englishDomain = 'arisepedia.com';
    var hindiDomain = 'hi.arisepedia.com';
   
    var switcherHtml = '<div id="language-switcher" style="position: fixed; top: 10px; right: 10px; z-index: 1000;">' +
        '<a href="https://' + englishDomain + currentPath + '" style="margin-right: 10px; padding: 5px 10px; background-color: #f8f9fa; border: 1px solid #a2a9b1; border-radius: 3px; color: #202122; text-decoration: none;">English</a>' +
        '<a href="https://' + hindiDomain + currentPath + '" style="padding: 5px 10px; background-color: #f8f9fa; border: 1px solid #a2a9b1; border-radius: 3px; color: #202122; text-decoration: none;">हिन्दी</a>' +
    '</div>';
   
    $('body').append(switcherHtml);
});

Latest revision as of 17:47, 30 September 2024

/* Any JavaScript here will be loaded for all users on every page load. */