MediaWiki:Common.js: Difference between revisions

MDFW - The Mystery Dungeon Tree of Information.
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
Line 45: Line 45:
label: 'Common Formatting',
label: 'Common Formatting',
characters: [
characters: [
`[[File:Wiki.png|alt=Alt text.|thumb|Description.]]`,
'[[File:Wiki.png|alt=Alt text.|thumb|Description.]]',
`{| class=\"wikitable\"
'{| class=\"wikitable\"\n|- \n! colspan=\"2\" |Name\n! rowspan=\"2\" |Description\n|- \n! English\n! Japanese\n|-\n|\n|\n|\n|}'
|-  
! colspan=\"2\" |Name
! rowspan=\"2\" |Description
|-  
! English
! Japanese
|-
|
|
|
|}`
]
]
}
}

Revision as of 15:46, 16 July 2024

/* global mw, $ */
/* jshint esversion: 10 */

/* Any JavaScript here will be loaded for all users on every page load. */

/* Include in the wiki the following JavaScript pages */
// Sandbox
importScript('MediaWiki:Sandbox.js');
//importStylesheet('MediaWiki:Sandbox.css');

//importStylesheet('MediaWiki:Templates.css');
// importScript('MediaWiki:Countdown.js');
importScript('Widget:Rescue_Password_Generator/script.js');

/* a11y */
$('a.mw-wiki-logo').attr('title', 'Mystery Dungeon Franchise Wiki');

$('#main-mobile > a').removeAttr('title');
$('#talk-mobile > a').removeAttr('title');
$('#ca-tools > a').removeAttr('title');
$('#pt-logout > a').removeAttr('title');

// $('#n- > a').removeAttr('href');
$('#n- > a')
	.attr('href', 'https://mysterydungeonwiki.com/wiki/Mystery_Dungeon_Franchise_Wiki')
	.attr('aria-label', 'bar');

if ($(location).attr("href") === 'https://mysterydungeonwiki.com/wiki/Mystery_Dungeon_Franchise_Wiki') {
	$('#n-mainpage-description > a').removeAttr('href');
}
/* end a11y */

// https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization
/* Check if we're editing a page. */
if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) {
	// Add a hook handler.
	mw.hook('wikiEditor.toolbarReady').add(function ($textarea) {
		// Configure a new toolbar entry on the given $textarea jQuery object.

		$textarea.wikiEditor('addToToolbar', {
			section: 'characters',
			pages: {
				consolelogos: {
					layout: 'characters',
					label: 'Common Formatting',
					characters: [
						'[[File:Wiki.png|alt=Alt text.|thumb|Description.]]',
						'{| class=\"wikitable\"\n|- \n! colspan=\"2\" |Name\n! rowspan=\"2\" |Description\n|- \n! English\n! Japanese\n|-\n|\n|\n|\n|}'
					]
				}
			}
		});
	});
}

/*
// Minify imported stylesheets and scripts
importArticles(
	{
		type: 'script',
		articles: [
			'MediaWiki:Sandbox.js',
			'Widget:Rescue_Password_Generator/script.js'
		]
	},
	{
		type: 'style',
		articles: [
			'Mediawiki:Sandbox.css',
			'Mediawiki:Templates.css'
		]
	}
);
*/