[go: up one dir, main page]

User:Novem Linguae/Scripts/TopicSubscriptionsTab.js

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <nowiki>

/*
- Adds Watchlist tab and Topic Subscriptions tab to your watchlist and topic subscriptions pages.
*/

$(async function() {
	// could also use mw.config.get('wgCanonicalSpecialPageName')
	let title = mw.config.get('wgPageName'); // includes namespace, underscores instead of spaces
	if ( title === 'Special:Watchlist' || title === 'Special:TopicSubscriptions' ) {
		$('#mw-content-text').before(`
			<style>
				.TopicSubscriptionsTab {
					
				}

				.TopicSubscriptionsTab-Tab {
					display: inline-block;
					border-left: 1px solid black;
					border-top: 1px solid black;
					border-right: 1px solid black;
					padding: 0 10px;
				}
			</style>

			<div class="TopicSubscriptionsTab">
				<div class="TopicSubscriptionsTab-Tab">
					<a href="/wiki/Special:Watchlist">
						Watchlist
					</a>
				</div>
				<div class="TopicSubscriptionsTab-Tab">
					<a href="/wiki/Special:TopicSubscriptions">
						Topic Subscriptions
					</a>
				</div>
			</div>
		`);
	}
});

// </nowiki>