Usuario:Renamed user 9thz5duyuxms/MySandbox.js

De Wikipedia, la enciclopedia libre

Nota: Después de guardar, debes refrescar la caché de tu navegador para ver los cambios. Internet Explorer: mantén presionada Ctrl mientras pulsas Actualizar. Firefox: mientras presionas Mayús pulsas el botón Actualizar, (o presiona Ctrl-Shift-R). Los usuarios de Google Chrome y Safari pueden simplemente pulsar el botón Recargar. Para más detalles e instrucciones acerca de otros exploradores, véase Ayuda:Cómo limpiar la caché.

/**
 * Add a "My sandbox" link to the personal portlet menu.
 * Dependencies: mediawiki.util, mediawiki.Title, mediawiki.Uri
 *
 * @source mediawiki.org/wiki/Snippets/MySandbox
 * @version 3
 */
( function ( mw, $ ) {
 
        $( document ).ready( function () {
                var conf, title, url;
 
                // Customize/Translate this to your needs
                conf = {
                        subpageName: 'Zona de pruebas',
                        portletLabel: 'Zona de pruebas',
                        portletTooltip: 'Ir a tu zona de pruebas',
                        editintroPagename: 'Plantilla:ZDP usuario',
                        preloadPagename: 'Plantilla:ZDP usuario'
                };
                // 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.extend({
                        action: 'edit',
                        redlink: 1,
                        editintro: new mw.Title( conf.editintroPagename ),
                        preload: new mw.Title( conf.preloadPagename )
                });
 
                mw.util.addPortletLink(
                        'p-personal',
                        url,
                        conf.portletLabel,
                        'pt-sandbox',
                        conf.portletTooltip,
                        null,
                        '#pt-preferences'
                );
        });
}( mediaWiki, jQuery ) );