User:Kaniivel/RefConsolidate start.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 user script seems to have a documentation page at User:Kaniivel/RefConsolidate start. |
// Make sure the document is ready and dependencies are loaded
$.when (
$.ready,
mw.loader.using(['mediawiki.util'])
).done(function () {
// Only load on appropriate namespaces
var namespace = mw.config.get( 'wgNamespaceNumber' );
if ( namespace === 0 || namespace === 2 ) {
// Only load when editing wikitext (and not in common.js or common.css, for example)
var contentModel = mw.config.get( 'wgPageContentModel' );
if ( contentModel === 'wikitext' ) {
// Configure the gadget for this particular wiki
mw.config.set({
'refcon-summary': 'Converted references to list-defined format', // Edit summary automatically added by RefCon
'refcon-linkname': 'Consolidate refs', //Portlet link name
'refcon-linkhover': 'Consolidate references', //Text that is displayed when hovering above the link; link title
'refcon-reftemplatenames': [ //List template {{reflist}} name and aliases that are used in wiki. Put main first
'reflist'
],
'refcon-reftemplategroupnames': [ //List template {{reflist}} 'group' parameter aliases that are used in wiki. Put main first
'group'
],
'refcon-reftemplaterefsnames': [ //List template {{reflist}} 'refs' parameter aliases that are used in wiki. Put main first
'refs'
]
});
mw.loader.load( '/w/index.php?title=User:Cumbril/RefConsolidate.js&action=raw&ctype=text/javascript', 'text/javascript' );
}
}
}
);