User:Fortek67/common.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump.
This code will be executed when previewing this page.
This code will be executed when previewing this page.
The accompanying .css page for this skin is at User:Fortek67/common.css.
mw.loader.load( '/w/index.php?title=User:Evad37/rater.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Evad37/rater.js]]
importScript('User:BilledMammal/MovePlus.js'); // Backlink: [[User:BilledMammal/MovePlus.js]]
importScript('User:Andrybak/Scripts/Archiver.js'); // Backlink: [[User:Andrybak/Scripts/Archiver.js]]
importScript( 'User:Danski454/stubsearch.js' ); // Backlink: [[User:Danski454/stubsearch.js]]
importScript('User:MPGuy2824/MoveToDraft.js'); // Backlink: [[User:MPGuy2824/MoveToDraft.js]]
mw.loader.load( '/w/index.php?title=User:LuniZunie/scripts/WikiShield.js&action=raw&ctype=text/javascript' ); // Backlink:
mw.loader.load( '/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Joeytje50/JWB.js/load.js]]
importScript('User:Nardog/CatChangesViewer.js'); // Backlink: [[User:Nardog/CatChangesViewer.js]]
( function () {
'use strict';
// Map of normalized template titles -> { paramName: { ...overrides } }.
// - Keys must be the full prefixed, normalized title as VE sees it:
// "Template:" prefix, spaces (not underscores), first letter capitalized.
// - Values are merged into each parameter's TemplateData object, so besides
// `suggested` you can override other TemplateData fields (label, description,
// autovalue, example, type, etc.) for that param.
const TEMPLATE_PARAM_OVERRIDES = {
'Template:Cite web': {
language: { suggested: true },
"trans-title": { suggested: true }
},
'Template:Cite news': {
language: { suggested: true },
"trans-title": { suggested: true }
}
};
mw.hook( 've.newTarget' ).add( function () {
const Cache = ve.getProp( ve, 'init', 'mw', 'TemplateDataCache' );
// Bail if VE structure isn't what we expect, or we've already patched.
if ( ve.getProp( Cache, 'static', 'suggestedOverridePatched' ) ) {
return;
}
const orig = Cache.static.processPage;
Cache.static.processPage = function ( page ) {
// Run VE's own processing first
page = orig ? orig.call( this, page ) : page;
var overrides = page && page.title && TEMPLATE_PARAM_OVERRIDES[ page.title ];
// console.log('processPage', page, overrides);
if ( overrides ) {
page.params = page.params || {};
for ( var name in overrides ) {
// Deep-apply overrides (creating the param entirely if it doesn't exist...)
page.params[ name ] = ve.extendObject(
true, {}, page.params[ name ], overrides[ name ]
);
}
}
return page;
};
Cache.static.suggestedOverridePatched = true;
} );
}() );
importScript('User:BilledMammal/DiscussionPlus.js'); // Backlink: [[User:BilledMammal/DiscussionPlus.js]]