MediaWiki:Common.js

From Polcompball Wiki
Revision as of 01:58, 20 October 2021 by TheGhostOfInky (talk | contribs)
Jump to navigationJump 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.
/* Any JavaScript here will be loaded for all users on every page load. */

window.UserTagsJS = {
	modules: {},
	tags: {
	    valued: { u: 'Inner Party', order: 87 },
	    thoughtpol: { u: 'Thought Police', order: 88 },
		code: { u: 'Code Wrangler', order: 89 },
		artist: { u: 'Artist', order: 90 },
		writer: { u: 'Political Theorist', order: 91},
		sysop: { u: 'Big Brother' }
	}
};

UserTagsJS.modules.autoconfirmed = true;

UserTagsJS.modules.newuser = {
	days: 14,
	edits: 30,
	namespace: 0
};

UserTagsJS.modules.inactive = {
	days: 30,
	namespaces: [0],
	zeroIsInactive: true
};

UserTagsJS.modules.custom = {
	'Violinium': ['code', 'artist', 'writer', 'valued', 'thoughtpol'],
	'Konlord 44': ['valued', 'thoughtpol'],
	'Monkeysszz': ['valued'],
	'Popedesu': ['writer', 'thoughtpol']
};

window.highlightUsersConfig = {
    colors: {
        'sysop': '#604DFF',
        'bot': '#C3BEB6'
    },
    styles: {
        'sysop': 'font-weight: bold;'
    }
};
$.getJSON("/api/v1/Articles/Top?cb=" + new Date().getTime(), function(data) {
	var a = data.items; // array of results
	$("span.mostvisited").each(function() {
		var b = String(Number($(this).attr("data-limit"))) == "NaN" ? a.length : Number($(this).attr("data-limit")) > a.length ? a.length : Number($(this).attr("data-limit")), // limit (if larger than the results length, override with length of results))
			c = [];
		for (var i = 0; i < b; i++) {
			c.push('\t<li><a href="/wiki/' + a[i].title.replace(" ", "_") + '">' + a[i].title + '</a></li>');
			if (i + 1 == b) {
				$(this).replaceWith('<ol>\n' + c.join("\n") + '\n</ol>');
			}
		}
	});
});
$( '#discord-widget' ).html(<iframe src="https://discord.com/widget?id=756897801790554113&theme=dark" width="350" height="500" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe>)
$( '#reddit-widget' ).html(<iframe src="https://theghostofinky.github.io/reddit-iframe/frame/frame" width="350" height="500" sub="polcompball"></iframe>)