User:Gguigui1/global.js

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',        'u:dev:PageMakerPro/code.js',        "w:c:dev:RevealAnonIP/usercode.js",        'w:dev:QuickCreateUserPage/code.js',        'u:dev:AutoEditPages/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');		} });