Bruger:SimmeD/Scripts/brugerrettigheder.js: Forskelle mellem versioner

Fra Wikisource, det frie bibliotek
Content deleted Content added
SimmeD (diskussion | bidrag)
Ny side: // This script is created by Pathoschild, and is hosted on meta. importScriptURI('http://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Ajax_sysop.js&action=raw&ctype=te...
 
updated scripts, migrated deprecated functions
Linje 1: Linje 1:
/**
// This script is created by Pathoschild, and is hosted on meta.
* Ajax sysop

* @see https://github.com/Pathoschild/Wikimedia-contrib#user-scripts
importScriptURI('http://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Ajax_sysop.js&action=raw&ctype=text/javascript');
* @update-token [[File:pathoschild/ajaxsysop.js]]
*/
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');


/* Import from http://translatewiki.net/wiki/MediaWiki:Gadget-setuserrights.js */
/* Import from http://translatewiki.net/wiki/MediaWiki:Gadget-setuserrights.js */
/* Created there by SPQRobin, translated by Laaknor */
/* Created there by SPQRobin, translated by Laaknor */

/* Adds a link on userpages to Special:UserRights */
/* Adds a link on userpages to Special:UserRights */
addOnloadHook(function() {
$(function() {
if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1) //no subpages or history
if (mw.config.get('wgTitle').indexOf("/") != -1 || document.title.indexOf("- History -") != -1) //no subpages or history
return;
return;
if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
if (mw.config.get('wgCanonicalNamespace') == "User" || mw.config.get('wgCanonicalNamespace') == "User_talk") {
var username = encodeURIComponent( wgTitle );
var username = encodeURIComponent( mw.config.get('wgTitle') );
addPortletLink("p-cactions", wgServer + "/wiki/Special:UserRights/" + username, "Brugerrettigheder", "ca-contrib", "Ændr denne brugers rettigheder");
mw.util.addPortletLink("p-cactions", mw.config.get('wgServer') + "/wiki/Special:UserRights/" + username, "Brugerrettigheder", "ca-contrib", "Ændr denne brugers rettigheder");
}
}
});
});

Versionen fra 28. mar. 2015, 00:42

/**
 * Ajax sysop
 * @see https://github.com/Pathoschild/Wikimedia-contrib#user-scripts
 * @update-token [[File:pathoschild/ajaxsysop.js]]
 */
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');

/* Import from http://translatewiki.net/wiki/MediaWiki:Gadget-setuserrights.js */
/* Created there by SPQRobin, translated by Laaknor */

/* Adds a link on userpages to Special:UserRights */
$(function() {
	if (mw.config.get('wgTitle').indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history
		return;
	if (mw.config.get('wgCanonicalNamespace') == "User" || mw.config.get('wgCanonicalNamespace') == "User_talk") {
		var username = encodeURIComponent( mw.config.get('wgTitle') );
		mw.util.addPortletLink("p-cactions", mw.config.get('wgServer') + "/wiki/Special:UserRights/" + username, "Brugerrettigheder", "ca-contrib", "Ændr denne brugers rettigheder");
	}
});