Jump to content

User:Speravir/global.js

From Meta, a Wikimedia project coordination wiki
This is an archived version of this page, as edited by Speravir (talk | contribs) at 22:45, 16 February 2021. It may differ significantly from the current version.

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// <nowiki>
var isActive = true;

if (isActive) {
var ns = mw.config.get('wgNamespaceNumber'), // cf. [[Help:Namespaces]]
	action = mw.config.get('wgAction');

$.when(mw.loader.using(['mediawiki.util']), $.ready).done(function () {
// Script collection Fliegelflagel, [[:de:Benutzer:Schnark/js/fliegelflagel]]
	mw.loader.load("https://meta.wikimedia.org/w/index.php?title=User:Speravir/config-Fliegelflagel.js&action=raw&ctype=text/javascript");
	// [[m:User:Speravir/config-Fliegelflagel.js]]

/***************************************/
// Several scripts loaded by Fliegelflagel, but some more complex scripts loaded separately below
/* Start of scripts from PerfektesChaos (PC) */
// [[:de:Benutzer:PerfektesChaos/js/clickDivertimento]]
if ( typeof mw.libs.clickDivertimento !== "object" ) {
	mw.libs.clickDivertimento = { };
}
mw.libs.clickDivertimento.large = true;
mw.loader.load("https://en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/clickDivertimento/r.js&action=raw&bcache=1&maxage=604800&ctype=text/javascript", "text/javascript");

// [[:de:Benutzer:PerfektesChaos/js/prettyPageHeading]]
if ( typeof mw.libs.prettyPageHeading !== "object" ) {
	mw.libs.prettyPageHeading = { };
}
mw.libs.prettyPageHeading.link = true;
mw.loader.load( "https://en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/prettyPageHeading/r.js&action=raw&bcache=1&maxage=604800&ctype=text/javascript", "text/javascript" );
/* End of scripts from PC */

// [[m:User:Perhelion/userstatus]]
$(document).on("loadWikiScript", function (e, userstatus) {
	if (userstatus.name === "Userstatus") {
		userstatus.lastEditSeconds = true; // show seconds of last edit
		userstatus.viewPatrolNumber = true; // uses data from [[:de:Benutzer:HRoestBot]]
		userstatus.styleMissingData = "color: #987; font-style: italic";
		userstatus.styleLoading = "font-style: italic";
		userstatus.styleBlocked = "color: #c20";
		userstatus.styleNotBlocked = "color: #182";
	}
});
if ( [ 2, 3 ].indexOf( mw.config.get( 'wgNamespaceNumber' ) ) !== -1 && ( !mw.config.get( 'wgArticleId' ) || mw.config.get( 'wgAction' ) === 'view' ) )
	mw.loader.load( "https://meta.wikimedia.org/w/index.php?title=User:Perhelion/userstatus.js&action=raw&ctype=text/javascript" ); // for statistics: [[File:Perhelion/userstatus.js]]

// [[:de:Benutzer:Schnark/js/linkUnlinked]]

if ( action === "edit" || "submit" ) {
// [[mw:Extension:WikiEditor]] / [[mw:Extension:WikiEditor/Toolbar customization]]
	mw.loader.load( "https://meta.wikimedia.org/w/index.php?title=User:Speravir/config-WikiEditor.js&action=raw&ctype=text/javascript" );
	// [[:m:User:Speravir/config-WikiEditor.js]]

// [[m:Force ltr]] / [[m:User talk:Pathoschild]]
/* Forces left-to-right layout and editing on RTL wikis.
 * @update-token [[File:pathoschild/forceltr.js]] */
	mw.loader.load("https://tools-static.wmflabs.org/meta/scripts/pathoschild.forceltr.js");

// [[m:TemplateScript]] / [[m:User talk:Pathoschild]]
/* Adds a regex editor and configurable templates and scripts to the sidebar.
 * @update-token [[File:Pathoschild/templatescript.js]] */
	mw.loader.load( "https://tools-static.wmflabs.org/meta/scripts/i18n/de.js" );
	mw.loader.load( "https://tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js" );
} // if action "edit"/"submit"

if (action === "view" && ns !== (6 || 7) ) { // 6 = File, 7 = File talk
// [[:en:User:Yair rand]]/[[d:User:Yair rand/WikidataInfo.js]]
mw.loader.load("https://www.wikidata.org/w/index.php?title=User:Yair_rand/WikidataInfo.js&action=raw&ctype=text/javascript"); //Wikidata descriptions also used on mobile devices
}
}); // End of loading function for
   // mw.loader.using( 'mediawiki.util' )

/***************************************/
// Hotcat, cf. [[:commons:Help:Gadget-HotCat]]
window.hotcat_list_size = 10;
window.hotcat_use_category_links = false;

// Media-Viewer always inactive
mw.config.set('wgMediaViewerOnClick', false);

// picked up from [[:m:User:MisterSynergy/columnedRefs.js]]
$("ol.references").each(function() {
	if( $(this).contents('li').length >= 4 ){
	$(this).addClass("columned_refs"); // rule in [[User:Speravir/global.css]]
	}
});
}// if (isActive)
// </nowiki>