MediaWiki:Gadget-mySandbox.js i Usuari:Vriullop/vector.js: Diferència entre les pàgines
(Diferència entre pàgines)
Contingut suprimit Contingut afegit
rv, prova |
m pr |
||
Línia 1: | Línia 1: | ||
/** |
/** |
||
* |
* Prova de MediaWiki:Gadget-mySandbox.js |
||
* |
* |
||
* Add a "My sandbox" link to the personal portlet menu. |
* Add a "My sandbox" link to the personal portlet menu. |
||
* Dependencies: mediawiki.util, mediawiki.Title, mediawiki.Uri |
* Dependencies: mediawiki.util, mediawiki.Title, mediawiki.Uri*/ |
||
mw.loader.using( ['mediawiki.util', 'mediawiki.Title', 'mediawiki.Uri', 'jquery.client'], function () { |
|||
⚫ | |||
/** |
|||
* @source mediawiki.org/wiki/Snippets/MySandbox |
* @source mediawiki.org/wiki/Snippets/MySandbox |
||
* @version 2 |
* @version 2 |
||
*/ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
$( document ).ready( function () { |
$( document ).ready( function () { |
||
var conf, title, url; |
var conf, title, url; |
||
// |
// Customize/Translate this to your needs |
||
conf = { |
conf = { |
||
ca: { |
|||
⚫ | |||
⚫ | |||
}, |
|||
en: { |
|||
portletLabel: 'Sandbox', |
|||
portletTooltip: 'Your sandbox page' |
|||
}, |
|||
subpageName: 'proves', |
subpageName: 'proves', |
||
⚫ | |||
⚫ | |||
editintroPagename: "Plantilla:Proves_d'usuari", |
editintroPagename: "Plantilla:Proves_d'usuari", |
||
preloadPagename: "Plantilla:Proves_d'usuari/preload" |
preloadPagename: "Plantilla:Proves_d'usuari/preload" |
||
}; |
}; |
||
// Don't alter the code below |
// Don't alter the code below |
||
var lang = mw.user.options.get( 'language' ); |
|||
if( !conf[ lang ] ) { |
|||
lang = 'en'; |
|||
}; |
|||
// Use Special:MyPage (as opposed to mw.user.getName()) so that it |
// Use Special:MyPage (as opposed to mw.user.getName()) so that it |
||
Línia 38: | Línia 49: | ||
'p-personal', |
'p-personal', |
||
url, |
url, |
||
conf.portletLabel, |
conf[lang].portletLabel, |
||
'pt- |
'pt-sandbox', |
||
conf.portletTooltip, |
conf[lang].portletTooltip, |
||
null, |
null, |
||
'#pt-preferences' |
'#pt-preferences' |
||
); |
); |
||
}); |
}); |
||
/* End of mw.loader.using callback */ |
|||
⚫ | |||
} ); |
|||
⚫ |