İçeriğe atla

Kullanıcı:CosmosAway/ProveIt.js

Vikipedi, özgür ansiklopedi
Not: Sayfayı kaydettikten sonra değişiklikleri görebilmek için tarayıcınızın önbelleğinizi temizlemeniz gerekir. Google Chrome, Firefox, Microsoft Edge ve Safari: ⇧ Shift tuşuna basılı tutun ve Yeniden Yükle araç çubuğu düğmesine tıklayın. Ayrıntılar ve diğer tarayıcılara yönelik yönergeler için Vikipedi:Önbelleğinizi atlayın sayfasını inceleyin.
/**
 * 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 || namespace === 118 ) {

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

		// Only with the basic wikitext editor and the classic wikieditor, not the new one
		var textbox = document.getElementById( 'wpTextbox1' );
		if ( textbox ) {

			// 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 (all options are optional)
				mw.config.set({
					'proveit-tag': 'ProveIt düzenle', // Revision tag created at Special:Tags
					'proveit-summary': 'Kaynak, [[Vikipedi:Araçlar/ProveIt|ProveIt]] ile düzenlendi.', // Edit summary automatically added by ProveIt
					'proveit-templates': [ // These templates should have their TemplateData defined
						'Template:Kaynak',
						'Template:Video kaynağı',
						'Template:Kitap kaynağı',
						'Template:Ansiklopedi kaynağı',
						'Template:Bölüm kaynağı',
						'Template:Dergi kaynağı',
						'Template:Haber kaynağı',
						'Template:Basın açıklaması kaynağı',
						'Template:Tez kaynağı',
						'Template:Tweet kaynağı',
						'Template:Web kaynağı',
						'Kullanıcı:CosmosAway/Çalışma5'
					]
				});

				// 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' );
			}
		}
	}
}