// ]
mw.loader.load("//www.wikidata.orghttps://en.wiktionary.org/w/index.php?title=User:Yair rand/WikidataInfo.js&action=raw&ctype=text/javascript");
// ]
mw.loader.load("//www.wikidata.orghttps://en.wiktionary.org/w/index.php?title=User:Yair_rand/checksitelinks.js&action=raw&ctype=text/javascript");
// Warning! This gadget also use other projects.
// Original version:
// - QuickEditCounter script by ]
// - Released under the
// Modified by: ], ], ], ]
window.qecGadget = {
version: 10,
_i18n: ( function() {
var l10n = {
bn: {
thismaleusermade: 'এই পুরুষ ব্যবহারকারী',
thisfemaleusermade: 'এই মহিলা ব্যবহারকারী',
total: 'মোট',
edits: 'টি সম্পাদনা করেছেন'
},
ca: {
thismaleusermade: 'Aquest usuari ha fet',
thisfemaleusermade: 'Aquesta usuària ha fet',
total: 'un total de',
edits: 'edicions'
},
en: {
thismaleusermade: 'This user has made',
thisfemaleusermade: 'This user has made',
total: 'a total of',
edits: 'edits'
},
eo: {
thismaleusermade: 'Tiu ĉi uzanto faris',
thisfemaleusermade: 'Tiu ĉi uzanto faris',
total: 'entute',
edits: 'redaktojn'
},
es: {
thismaleusermade: 'Este usuario hizo',
thisfemaleusermade: 'Esta usuaria hizo',
total: 'un total de',
edits: 'ediciones'
},
fr: {
thismaleusermade: 'Cet utilisateur a fait',
thisfemaleusermade: 'Cette utilisatrice a fait',
total: 'un total de',
edits: 'éditions'
},
gl: {
thismaleusermade: 'Este usuario fixo',
thisfemaleusermade: 'Esta usuaria fixo',
total: 'un total de',
edits: 'edicións'
},
id: {
thismaleusermade: 'Pengguna ini telah membuat',
thisfemaleusermade: 'Pengguna ini telah membuat',
total: 'sebanyak',
edits: 'suntingan'
},
ko: {
thismaleusermade: '이 사용자는',
thisfemaleusermade: '이 사용자는',
total: '총',
edits: '회 편집하였습니다'
},
ms: {
thismaleusermade: 'Pengguna ini telah melakukan',
thisfemaleusermade: 'Pengguna ini telah melakukan',
total: 'sebanyak',
edits: 'suntingan'
},
pl: {
thismaleusermade: 'Ten użytkownik wykonał',
thisfemaleusermade: 'Ta użytkowniczka wykonała',
total: 'łącznie',
edits: 'edycji'
},
sk: {
thismaleusermade: 'Tento redaktor vykonal',
thisfemaleusermade: 'Táto redaktorka vykonala',
total: 'dokopy',
edits: 'úprav'
}
};
var lang = mw.user.options.get( 'language' );
if( !l10n ) {
lang = 'en';
}
return function( key ) {
if( l10n ) {
return l10n;
} else {
return l10n;
}
};
} )(),
init: function() {
if ( mw.config.get( 'wgNamespaceNumber' ) != 2 && mw.config.get( 'wgNamespaceNumber' ) != 3 ) {
return;
}
if ( mw.util.getParamValue('printable') == 'yes' ) {
return;
}
this.username = mw.config.get( 'wgTitle' ).replace( /\/.*$/, '' );
var that = this;
var request = {
action: 'query',
list: 'users',
usprop: 'editcount|gender',
format: 'json',
ususers: this.username,
requestid: new Date().getTime()
};
jQuery.getJSON( mw.util.wikiScript( 'api' ), request, function( result ) {
jQuery( document ).ready( function() {
if ( result ) {
that.showResults( result );
}
});
});
},
showResults: function( data ) {
data = data.query.users;
if ( !data || data.name != this.username || data.invalid != null || data.editcount === undefined )
return;
var firstHeading;
var headers = document.getElementsByTagName( 'h1' );
for ( var i = 0; i < headers.length; i++ ) {
var header = headers;
if ( header.className == 'firstHeading' || header.id == 'firstHeading' || header.className == 'pagetitle' ) {
firstHeading = header; break;
}
}
if( !firstHeading ) {
firstHeading = document.getElementById( 'section-0' );
}
if( !firstHeading ) {
return;
}
var html = data.gender == 'female'
? this._i18n( 'thisfemaleusermade' )
: this._i18n( 'thismaleusermade' );
var lang = 'www';
var wiki = 'wikidata';
var m;
if ( m = mw.config.get( 'wgServer' ).match( /^(?:http:)?\/\/(.+?).(+).org$/ ) ) {
lang = m;
wiki = m;
} else if ( m = mw.config.get( 'wgScriptPath' ).match( /\/(.+?)\/(.+?)\// ) ) {
lang = m;
wiki = m;
}
html += ' ' + this._i18n( 'total' ) + ' <a href="//tools.wmflabs.org/xtools/pcount/index.php?name=' + encodeURIComponent( this.username ) + '&wiki=' + encodeURIComponent( wiki ) + '&lang=' + encodeURIComponent( lang ) + '">' + data.editcount + '</a> ' + this._i18n( 'edits' ) + '.';
var div = document.createElement( 'div' );
div.style.cssText = 'font-size:0.5em;line-height:1em';
div.className = 'plainlinks';
div.innerHTML = html;
if ( mw.config.get( 'skin' ) == 'modern' ) {
div.style.marginLeft = '10px';
div.style.display = 'inline-block';
}
firstHeading.appendChild( div );
}
};
qecGadget.init();