User:Speravir/global.js: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 12:
/***************************************/
// Several scripts loaded by Fliegelflagel, but some
// [[m:User:Hoo man/Scripts/Smart rollback]]
if(typeof(smartRollbackConfig) === 'undefined') smartRollbackConfig = {};
smartRollbackConfig.lang = 'de';
smartRollbackConfig.toolLinkMethod = 'p-cactions';
mw.loader.load("https://meta.wikimedia.org/w/index.php?title=User:Hoo_man/smart_rollback.js&action=raw&ctype=text/javascript");// for statistics: [[File:Hoo man/smart_rollback.js]]
|
Revision as of 22:48, 12 July 2021
// <nowiki>
var isActive = true;
if (isActive) {
var ns = mw.config.get('wgNamespaceNumber'), // cf. [[m: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 scripts with additional settings loaded separately below
// [[m:User:Hoo man/Scripts/Smart rollback]]
if(typeof(smartRollbackConfig) === 'undefined') smartRollbackConfig = {};
smartRollbackConfig.lang = 'de';
smartRollbackConfig.toolLinkMethod = 'p-cactions';
mw.loader.load("https://meta.wikimedia.org/w/index.php?title=User:Hoo_man/smart_rollback.js&action=raw&ctype=text/javascript");// for statistics: [[File:Hoo man/smart_rollback.js]]
/* Start of scripts from PerfektesChaos (PC) */
// [[:de:Benutzer:PerfektesChaos/js/clickDivertimento]]
// "Open particular links automatically on new browser window or tab."
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/pageLinkHelper]]
/* "several little helpers for links related to pages" (wiki links for diff and
* permalink; purge link; redirect in browsing history; system language qqx link) */
if ( typeof mw.libs.pageLinkHelper !== "object" ) {
mw.libs.pageLinkHelper = { };
}
mw.libs.pageLinkHelper.purge = "p-tb";
mw.libs.pageLinkHelper = { slangQQX: true };
mw.loader.load( "https://en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/pageLinkHelper/r.js&action=raw&bcache=1&maxage=604800&ctype=text/javascript", "text/javascript" );
// [[:de:Benutzer:PerfektesChaos/js/prettyPageHeading]]
// "nicer presentation of page headlines, in particular on subpages"
if ( typeof mw.libs.prettyPageHeading !== "object" ) {
mw.libs.prettyPageHeading = { };
}
mw.libs.prettyPageHeading.link = true;// see also [[m:User:Speravir/global.css]]
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]]
// displays information about a user on user and user-discussion pages
$(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]]
/* Gadgets from Commons */
// Gadget "search-new-tab", [[commons:MediaWiki talk:Gadget-search-new-tab.js]]
// open search results from small search bar in a new window or tab
mw.loader.load("https://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-search-new-tab.js&action=raw&ctype=text/javascript");
// Gadget "NewPP-report", [[commons:MediaWiki talk:Gadget-NewPP-report.js]] (actually from Perhelion)
// makes the [[mw:NewPP parser report]] visible on every content page at the bottom
mw.loader.load("https://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-NewPP-report.js&action=raw&ctype=text/javascript");
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 [[m:User:Speravir/global.css]]
}
});
}// if (isActive)
// </nowiki>