User:Caburum/common.js

mw.hook('caburum.runLocalJS').add(function(cab) {	window.globalNavButtons.push( cab.globalNavPage('New posts', 'Special:SocialActivity?containerTypes=FORUM&new=true', { p: 'RC' }), cab.globalNavPage('New wikis', 'Special:NewWikis', { p: 'RC' }), cab.globalNavPage('Random Help', 'Special:Random/Help', { m: false, p: false }) );

importArticles({		type: 'script',		articles: [			'u:dev:MediaWiki:Matrix.js',		]	});

/* User Activity link */ mw.loader.using(['mediawiki.api', 'mediawiki.jqueryMsg']).then(function {		return new mw.Api.loadMessagesIfMissing(['user-activity-tab']);	}).then(function {		$('.global-navigation__bottom li:has([data-tracking-label="account.preferences"])').after($('') .append($('', { href: 'https://community.fandom.com/wiki/Special:UserActivity', text: mw.msg('user-activity-tab') }))		);	});

/* URL param for new posts only on Special:SocialActivity */ if (cab.wg.wgCanonicalSpecialPageName === 'SocialActivity' && mw.util.getParamValue('new')) { mw.util.addCSS('.social-activity-list li:not([data-activity-type="create"]), .social-activity-list li:not([data-content-type="post"], [data-content-type="message"], [data-content-type="comment"]) { display: none }'); }

cab.log('Executed common.js from Community Central'); });