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
 
(104 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/* globals mw, $ */
/* jshint esversion: 10 */
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */


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


// MediaWiki:jCarousel.js
/* Accessibility (a11y) */
mw.loader.load( '/w/index.php?title=MediaWiki:jCarousel.js&action=raw&ctype=text/javascript' );
$('a.mw-wiki-logo').attr('title', 'Mystery Dungeon Franchise Wiki');


/*
$('#main-mobile > a').removeAttr('title');
// MediaWiki:Countdown.js
$('#talk-mobile > a').removeAttr('title');
mw.loader.load( '/w/index.php?title=MediaWiki:Countdown.js&action=raw&ctype=text/javascript' );
$('#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 */


// Widget:Rescue Password Generator/script.js
// https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization
mw.loader.load( '/w/index.php?title=Widget:Rescue_Password_Generator/script.js&action=raw&ctype=text/javascript' );
/* 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|}'
]
}
}
});
});
}


/* Mass Move Pages Tool
/*
mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:Plastikspork/massmove.js&action=raw&ctype=text/javascript' ); //[[User:Plastikspork/massmove.js]]
var notice = document.getElementById("writereply");
mw.util.addPortletLink("p-tb", "//en.wikipedia.org/wiki/Special:Massmove", "Mass move", "p-massmove", "Mass move");
notice.append("Forum posts can be made anonymously, however the associated IP address may be shown in some parts of the website.");
*/
*/

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.");
*/