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. |
/**
* References Consolidator (RefCon) is a Wikipedia gadget that converts all references in an article to list-defined format.
* It supports multiple reference templates and reference group names.
*
* Copyright 2016–2017 Cumbril
*
* Parts of RefCon are derived from Wikipedia gadget ProveIt:
* Copyright 2008-2011 Georgia Tech Research Corporation, Atlanta, GA 30332-0415, ALL RIGHTS RESERVED
* Copyright 2011- Matthew Flaschen
* Rewritten, internationalized, enhanced and maintained by Felipe Schenone since 2014
*
* RefCon is available under the GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html),
* the Creative Commons Attribution/Share-Alike License 3.0 (http://creativecommons.org/licenses/by-sa/3.0/),
* and the GNU General Public License 2 (http://www.gnu.org/licenses/gpl-2.0.html)
*/
// 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 with [[User:Cumbril/References Consolidator|References Consolidator]]', // Edit summary automatically added by RefCon
'refcon-summaryseparator': ' + ', // Edit summary separator if summary is added to existing summary
'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' );
}
}
}
);