Usuari:Unapersona/common.js
Nota: Després de publicar, possiblement necessitareu refrescar la memòria cau del vostre navegador per a veure'n els canvis.
- Firefox / Safari: Premeu Majús i alhora cliqueu el botó Actualitzar, o pressioneu Ctrl+F5 o Ctrl+R (⌘+R en un Mac)
- Google Chrome: Premeu Ctrl+Majús+R (⌘+Shift+R en un Mac)
- Internet Explorer / Edge: Premeu Ctrl i alhora cliqueu a Actualitza o pressioneu Ctrl+F5
- Opera: Premeu Ctrl-F5.
/**
* Add a "Sandbox" link to the personal portlet menu.
*
* Required modules: mediawiki.util, mediawiki.Title, mediawiki.Uri
*
* @source mediawiki.org/wiki/Snippets/MySandbox
* @version 2014-05-14
* modificat per fer traduccions
*/
( function ( mw, $ ) {
$( function () {
var conf, title, url;
var lang = mw.user.options.get( 'language' );
// Customize/Translate this to your needs
conf = {
ca: {
portletLabel: 'Importa',
portletTooltip: 'Importa una pàgina'
},
en: {
portletLabel: 'Import',
portletTooltip: 'Import a page'
}
};
if( !conf[ lang ] ) {
lang = 'en';
}
// 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:Import' );
url = new mw.Uri( title.getUrl() );
mw.util.addPortletLink(
'p-personal',
url,
conf[lang].portletLabel,
'pt-sandbox',
conf[lang].portletTooltip,
null,
'#pt-preferences'
);
});
}( mediaWiki, jQuery ));