MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 350: Line 350:
     //    });
     //    });
     // });
     // });
   
 
});
});


var loadJS = function(url, implementationCode, location){
var loadJS = function (url, implementationCode, location) {
     var scriptTag = document.createElement('script');
     var scriptTag = document.createElement('script');
     scriptTag.src = url;
     scriptTag.src = url;
Line 360: Line 360:
     location.appendChild(scriptTag);
     location.appendChild(scriptTag);
};
};
var popperLoaded = function() {
var popperLoaded = function () {
     mw.loader.load('https://elwiki.net/wiki/index.php?title=MediaWiki:Tippy.js&action=raw&ctype=text/javascript', function(){
     mw.loader.load('https://elwiki.net/wiki/index.php?title=MediaWiki:Tippy.js&action=raw&ctype=text/javascript');
        tippy('[data-tippy-content]', {
    tippy('[data-tippy-content]', {
            interactive: true
        interactive: true
        });
        document.body.classList.add('tippy-loaded');
     });
     });
    document.body.classList.add('tippy-loaded');
}
}
loadJS('https://unpkg.com/@popperjs/core@2.11.6/dist/umd/popper.min.js', popperLoaded, document.body);
loadJS('https://unpkg.com/@popperjs/core@2.11.6/dist/umd/popper.min.js', popperLoaded, document.body);
Line 478: Line 478:
             setCookie('elwiki-dark-mode', 'true');
             setCookie('elwiki-dark-mode', 'true');
         }
         }
         setTimeout(function(){
         setTimeout(function () {
             window.location.reload(1);
             window.location.reload(1);
         }, 50)
         }, 50)