사용자:Senior9324/common.js: 두 판 사이의 차이

편집 요약 없음
편집 요약 없음
12번째 줄: 12번째 줄:
var conf, title, url;
var conf, title, url;
   
   
// Customize/Translate this to your needs
conf = {
conf = {
subpageName: '실험실',
subpageName: '실험실',
18번째 줄: 17번째 줄:
portletTooltip: '실험실로 가기'
portletTooltip: '실험실로 가기'
};
};
// Don't alter the code below
// Use Special:MyPage (as opposed to mw.user.getName()) so that it
// works for logged-out users as well.
title = new mw.Title( 'Special:MyPage/' + conf.subpageName );
   
   
url = new mw.Uri( title.getUrl() );
url = new mw.Uri( title.getUrl() );
28번째 줄: 22번째 줄:
mw.util.addPortletLink(
mw.util.addPortletLink(
(mw.config.get('skin') === 'newiwiki') ? 'personalbar' : 'p-personal',
(mw.config.get('skin') === 'newiwiki') ? 'personalbar' : 'p-personal',
url,
'/wiki/Special:MyPage/실험실',
conf.portletLabel,
conf.portletLabel,
'pt-sandbox',
'pt-sandbox',

2015년 5월 16일 (토) 00:10 판

//mw.loader.load( '//librewiki.net/index.php?title=User:Senior9324/FileUploadWizard.js&action=raw&ctype=text/javascript' );
/**
 * Add a "My sandbox" link to the personal portlet menu.
 *
 * Required modules: mediawiki.util, mediawiki.Title, mediawiki.Uri
 *
 * @source www.mediawiki.org/wiki/Snippets/MySandbox
 * @version 2014-07-16
 */
( function ( mw, $ ) {
	$( function () {
		var conf, title, url;
 
		conf = {
			subpageName: '실험실',
			portletLabel: '실험실',
			portletTooltip: '실험실로 가기'
		};
 
		url = new mw.Uri( title.getUrl() );
 
		mw.util.addPortletLink(
			(mw.config.get('skin') === 'newiwiki') ? 'personalbar' : 'p-personal',
			'/wiki/Special:MyPage/실험실',
			conf.portletLabel,
			'pt-sandbox',
			conf.portletTooltip,
			null,
			'#pt-preferences'
		);
	} );
}( mediaWiki, jQuery ) );