Help:Gadget-ProveIt

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

ProveIt is a powerful reference manager for Wikipedia (and any other MediaWiki wiki). Referencing is a key task at Wikipedia, but the process is often difficult because the citation templates are complex. ProveIt simplifies the process by adding a smart and simple graphical user interface at the moment of editing any article. You deal with the interface, ProveIt deals with the wikitext.

Installation[edit]

To install this gadget on your Wikipedia (or any MediaWiki wiki), first visit Special:Version to make sure the following extensions are installed:

Then go to MediaWiki:Gadgets-definition and add the following:

* ProveIt[ResourceLoader]|ProveIt.js

Finally, go to MediaWiki:Gadget-ProveIt.js, add the following code and read the code comments to do the necessary adjustments:

/**
 * ProveIt is a powerful reference manager for Wikipedia
 * Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt
 *
 * The gadget code is loaded directly from Wikimedia Commons,
 * but here are a few conditionals to minimize requests
 * and some configuration options specific to this wiki
 */

// Only load on appropriate namespaces
var namespace = mw.config.get( 'wgNamespaceNumber' );
if ( namespace === 0 || namespace === 2 ) {

	// Only load when editing 
	var action = mw.config.get( 'wgAction' );
	if ( action === 'edit' || action === 'submit' ) {

		// Only load when editing wikitext (and not in common.js or common.css, for example)
		var contentModel = mw.config.get( 'wgPageContentModel' );
		if ( contentModel === 'wikitext' ) {

			// Only load with the classic wikitext editors, not the new one
			$( function () {
				var textbox = $( '#wpTextbox1' );
				if ( textbox.length ) {

					// Configure the gadget (all options are optional)
					mw.config.set({
						'proveit-tag': 'ProveIt edit', // Revision tag created at Special:Tags
						'proveit-summary': 'Reference edited with ProveIt', // Automatic edit summary
						'proveit-templates': [ // These templates should have their TemplateData defined
							'Template:Cite book',
							'Template:Cite encyclopedia',
							'Template:Cite web'
						]
					});

					// Load the latest code directly from Commons
					mw.loader.load( '//commons.wikimedia.org/w/load.php?modules=ext.gadget.ProveIt&only=scripts' );
					mw.loader.load( '//commons.wikimedia.org/w/load.php?modules=ext.gadget.ProveIt&only=styles', 'text/css' );
				}
			} );
		}
	}
}

Done! You can now enable the gadget from your preferences.

If your community doesn't have the Gadgets extension installed, or decides not to enable the gadget, you can still use the gadget by just adding the code above to your personal common.js ($wgAllowUserJs must be enabled for this). You may also add the code above to MediaWiki:Common.js to activate the gadget for all users.

TemplateData[edit]

ProveIt is closely integrated with the TemplateData of the citation templates. Before starting to work with the gadget, try to check that all needed templates have the right TemplateData information. The more template data you specify, the smarter ProveIt can get. You can even add a Map object to the template data to further optimize ProveIt. The Map object allows you to specify:

  • The main parameter of the template, so that ProveIt shows its value on the reference list for easily finding the reference you're looking.
  • The parameters that should be displayed as text boxes rather than inline fields, usually parameters meant for long quotes.

For example, the map object of the Template:Cite web in the English Wikipedia looks like this:

"proveit": {
	"main": "title",
	"textarea": [
		"quote"
	]
}

Due to cache issues, ProveIt may take a while to reflect any changes to the template data.

Credits[edit]

  • Originally developed between 2008 and 2011 by a team of Wikipedians at Georgia Tech, including Kurt Luther, Matthew Flaschen, Terris Johnson, Amy Bruckman, Andrea Forte and Christopher Jordan.
  • Rewritten and internationalized by Sophivorus in 2014, who in 2016 got a grant to further enhance the gadget.
  • Many other users contributed with feedback, translations and other forms of input. To name a few: Iniquity (Russian localization and feedback), Olli (Finnish translation), MrX and Lindsay (feedback and testing).
  • Also thanks to the authors of the dependencies: MediaWiki itself, jQuery, jQuery UI, jQuery cookie and jQuery textSelection.

See also[edit]

We try to keep all links related to the project in this section.

Wikipedia Localized messages Initialization code Documentation Usage Tags
English Link Link Link Link Link
Spanish Link Link Link Link Link
Portuguese Link Link Link Link Link
French Link Link Link Link Link
Italian Link Link Link Link Link
Russian Link Link Link Link Link
Estonian Link Link Link Link Link
Finnish Link Link Link Link Link
Bengali Link Link Link Link Link
Chinese Hans - Hant Link Link Link Link
Hindi Link Link Link Link Link
Bihari Link Link Link Link Link
Japanese Link
Polish Link
German Link
Turkish Link Link (old version) Link Link Link
Kazakh Link JS - CSS (old version) Link Link Link
Persian Link JS - CSS (old version) Link Link Link
Tamil Link Link (old version) Link Link Link