Kullanıcı:HastaLaVi2/common.js

/*
 Automate purge confirmation dialog
if ( mw.config.get( 'wgAction' ) === 'purge' ) {
       $('form[action*="action=purge"]').submit();
}

window.DilAraclariSenk = function(){
	this.langNameToLangCode = new mw.Api().get({
		"action": "expandtemplates",
		"format": "json",
		"text": "{{#invoke:diller/javascript-arayüzü|TumAsilAddanKoda}}",
		"prop": "wikitext"
	}).then(function (response) {
		return JSON.parse(response.expandtemplates.wikitext);
	});

	this.langCodeToLangName = this.langNameToLangCode.then(function(name2code){
		var code2name = {};
		for (var name in name2code) 
		{
			code2name[name2code[name]] = name;
		}
		return code2name;
	});
	
	
	this.GetWiktionaryCodeByCanonicalName = function(canonicalName){
		return this.langNameToLangCode.then(function(r){ return r[canonicalName];});
	};
	this.GetCanonicalNameByWiktionaryCode = function(langcode) {
		return this.langCodeToLangName.then(function(r){ return r[langcode];});
	};
};

//$('#firstHeading').replaceWith(turkish);
$( document ).ready( function ( $, mw ) {
	var scripts = (new DilAraclariSenk()).GetWiktionaryCodeByCanonicalName("Türkçe");
	
	$( '#firstHeading' ).after(scripts);
}( jQuery, mediaWiki ) );

*/

// Description         : With a new button "Ædit" one can edit specific sections without reloading the whole page. 
//                       Supports TabbedLanguages gadget
// Dependencies: mediawiki.util, mediawiki.Uri, mediawiki.user, mediawiki.api
/* jshint maxerr:1048576, strict:true, undef:true, latedef:true, sub:true */
/* global mw, $ */
/*
mw.loader.using(['mediawiki.util', 'mediawiki.cookie'], function(){
	importScript("Kullanıcı:HastaLaVi2/Gadget-CeviriEkleyici.js");
});
*/

var conf = mw.config.get([
	'wgPageName',
	'wgArticleId'
]);

console.log(conf.wgArticleId);

var t = new mw.Title( 'hayat' );
console.log(t.exists(t));