MediaWiki:Gadget-AdRail.js

From PUBG Wiki
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/*$(function() {
    var $rail = $('<aside class="games-showcase-sidebar">').appendTo($('#content > .content-body'));
    for (var index = 0; index < 3; index++) {
        $('<div class="sidebar-showcase"><img src="/images/d/df/Wiki.gg_logo-pink.svg" class="sidebar-img" width=300></div>').appendTo($rail);
    }
});*/
mw.loader.using(['skins.vector.legacy.js','ext.detectdevice']).then(function(){
	var origIsAnon = mw.user.isAnon;
	mw.user.isAnon = function() {return true};
	setTimeout(function() {
		if ($('.games-showcase-sidebar').length === 0) {
			mw.loader.moduleRegistry['skins.vector.legacy.js'].packageExports['resources/skins.vector.legacy.js/wikigg.js'].init();
			mw.loader.using('ext.detectdevice').then(function(){
				mw.user.isAnon = origIsAnon;
				$('.games-showcase-sidebar + .games-showcase-sidebar').remove();
			});
		}
	}, 40);
});