MediaWiki:Common.js: Difference between revisions

MDFW - The Mystery Dungeon Tree of Information.
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Tag: Manual revert
 
(31 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/* global mw, $ */
/* globals mw, $ */
/* jshint esversion: 10 */
/* jshint esversion: 10 */


Line 5: Line 5:


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


//importStylesheet('MediaWiki:Templates.css');
/* Accessibility (a11y) */
// importScript('MediaWiki:Countdown.js');
importScript('Widget:Rescue_Password_Generator/script.js');
 
/* a11y */
$('a.mw-wiki-logo').attr('title', 'Mystery Dungeon Franchise Wiki');
$('a.mw-wiki-logo').attr('title', 'Mystery Dungeon Franchise Wiki');


Line 21: Line 16:
$('#pt-logout > 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') {
if ($(location).attr("href") === 'https://mysterydungeonwiki.com/wiki/Mystery_Dungeon_Franchise_Wiki') {
$('#n-mainpage-description > a').removeAttr('href');
$('#n-mainpage-description').remove();
}
}
/* end a11y */
/* end a11y */
Line 34: Line 31:
mw.hook('wikiEditor.toolbarReady').add(function ($textarea) {
mw.hook('wikiEditor.toolbarReady').add(function ($textarea) {
// Configure a new toolbar entry on the given $textarea jQuery object.
// Configure a new toolbar entry on the given $textarea jQuery object.
$textarea.wikiEditor('addToToolbar', {
section: 'characters',
pages: {
gametitles: {
layout: 'characters',
label: 'Game Titles',
characters: [
'{{Shiren|Shiren the Wanderer 3 - The Sleeping Princess and the Karakuri Mansion}}',
'{{Pkmn|Pokémon Mystery Dungeon: Red and Blue Rescue Team}}',
'{{Pkmn|Pokémon Mystery Dungeon: Gates to Infinity}}',
'{{Pkmn|Pokémon Super Mystery Dungeon}}',
'{{Pkmn|Pokémon Mystery Dungeon: Rescue Team DX}}'
]
}
}
});
$textarea.wikiEditor('addToToolbar', {
$textarea.wikiEditor('addToToolbar', {
section: 'characters',
section: 'characters',
Line 56: Line 36:
consolelogos: {
consolelogos: {
layout: 'characters',
layout: 'characters',
label: 'Console Logos',
label: 'Common Formatting',
characters: [
characters: [
'{{ConsoleLogo|Wii|small}}',
'[[File:Wiki.png|alt=Alt text.|thumb|Description.]]',
'{{ConsoleLogo|3DS|small}}',
'{| class="wikitable"\n|- \n! colspan="2" |Name\n! rowspan="2" |Description\n|- \n! English\n! Japanese\n|-\n|\n|\n|\n|}'
'{{ConsoleLogo|DS|small}}',
'{{ConsoleLogo|GBA|small}}',
'{{ConsoleLogo|GB|small}}'
]
]
}
}
Line 71: Line 48:


/*
/*
// Minify imported stylesheets and scripts
var notice = document.getElementById("writereply");
importArticles(
notice.append("Forum posts can be made anonymously, however the associated IP address may be shown in some parts of the website.");
{
type: 'script',
articles: [
'MediaWiki:Sandbox.js',
'Widget:Rescue_Password_Generator/script.js'
]
},
{
type: 'style',
articles: [
'Mediawiki:Sandbox.css',
'Mediawiki:Templates.css'
]
}
);
*/
*/

Latest revision as of 22:17, 4 June 2025

/* globals 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 */
//importScript('MediaWiki:Sandbox.js');
//importScript('MediaWiki:Countdown.js');

/* Accessibility (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')
	.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').remove();
}
/* 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|}'
					]
				}
			}
		});
	});
}

/*
var notice = document.getElementById("writereply");
notice.append("Forum posts can be made anonymously, however the associated IP address may be shown in some parts of the website.");
*/