User:Gguigui1/global.js

/* Add LookUpContribs in all contributions page */ $( document ).ready(function { var page = mw.config.get('wgPageName'); var specialpage = mw.config.get('wgCanonicalSpecialPageName'); var href; var name = page.split('/')[1]; if (specialpage === "Contributions" && page.split('.').length != 4) { href = 'http://community.wikia.com/wiki/Special:LookUpContribs?target=' + name;  $('#WikiaMainContent a').each(function { var attrs = $(this).attr('title'); if (attrs === 'Voir les modifications globales de l\'utilisateur') { return false; } });  var linktitle = "Spécial:Permissions/" + name.replace('_', ' ');	$('#contentSub').find('a[title="' + linktitle + '"]').after(' • Recherche de contributions'); } });

var qtUserPageTemplate = ''; var qtEnableUserPageOverwrite = true; importArticles({   type: 'script',    articles: [        'u:dev:WHAM/code.2.js',        'u:dev:Quick_Management/code.js',        'w:c:dev:MassNullEdit/code.js',        "w:c:dev:RevealAnonIP/usercode.js",        'u:dev:QuickCreateUserPage/code.js',        'u:dev:PortableCSSPad/code.js'    ] }); function addadoptionsrights { var qUserName = encodeURIComponent($('#Name').val); if (qUserName == null) { return false; }					var reason = $('#motif').val; var url = wgServer + wgScriptPath + '/api.php?action=query&list=users&ususers=' + qUserName + '&ustoken=userrights&format=json'; $.getJSON( url, function (data) {					if (reason == null ) {						reason = '';					}					for ( var p in data.query.users ) {						break;					};					var token = data.query.users[p].userrightstoken;					if( $('#bureaucrat').attr('checked') ) {						var url = wgServer + wgScriptPath + '/api.php?action=userrights&user=' + qUserName + '&add=bureaucrat|sysop&reason=' + encodeURIComponent(reason) + '&format=json&token=' + encodeURIComponent(token);						$.post( url, function { alert('Réussi.'); $('#adoption').closeModal; });					} else {						var url = wgServer + wgScriptPath + '/api.php?action=userrights&user=' + qUserName + '&add=sysop&reason=' + encodeURIComponent(reason) + '&format=json&token=' + encodeURIComponent(token);						$.post( url, function { alert('Réussi.'); $('#adoption').closeModal; });					}				});				} var quickadoptionHTML = '\  \ \       Pseudo de la personne : \  \ Donner les droits bureaucrate: \  \ Motif : \  \ \ '; function quickadoption { $.showCustomModal('Adoption de wiki', quickadoptionHTML, {       id: 'adoption',        width: 200,        buttons: [{            id: 'startButton',            message: 'Adoption',            defaultButton: true,            handler: function  {                addadoptionsrights;                }        }, {            message: 'Annuler',            handler: function {                $('#adoption').closeModal;            }        }]    }); } $( document ).ready(function {	if( skin == 'oasis' ) { $('Adoption ').appendTo('#WikiaBarWrapper .toolbar > .tools'); $('#quickadoption').attr('onclick', 'quickadoption');		} var chemin = window.location.href; chemin = chemin.replace('http://',''); var cheminprefix = chemin.split('.',2); if (cheminprefix[0] !== "fr") { console.log('Disable the button...');  $('#quickadoption').attr('disabled', true);  console.log('Button disabled.'); } });