MediaWiki:JoinWiki.js

/* v1 - by Luqgreg require( [   'wikia.window',    'jquery',    'mw' ], function ( window, $, mw ) {    function createJoinWikiModule {        var blog = mw.message( 'Custom-JoinWiki-Blog' ).plain.split( '|' );        $wikiaRail.prepend( $( ' ', {               id: 'joinwiki-module',                class: 'rail-module',                css: { 'text-align': 'center' }            } ).append(                $( ' ', { html: mw.message( 'Custom-JoinWiki-Header' ).parse, css: { 'font-size': '14px', 'font-weight': 'bold', 'margin-bottom': '5px' }               } ),                $( '', { href: mw.util.getUrl( blog[0] ), title: blog[1] } ).append( $( ' ', {                       src: 'https://vignette.wikia.nocookie.net/tibia/images/0/03/PARTICIPA.png/revision/latest/scale-to-width-down/270?path-prefix=es'                    } ) )           )        );    }

function joinWikiModule { if ( $( '#joinwiki-module' ).length ) { return; }

new mw.Api.get( {           action: 'query',            meta: 'allmessages',            ammessages: 'Custom-JoinWiki-Blog|Custom-JoinWiki-Header'        } ).done( function( r, s ) {            if ( s !== 'success' || !r.query || !r.query.allmessages[0]['*'] ) {                return;            }

mw.messages.set( {               'Custom-JoinWiki-Blog': r.query.allmessages[0]['*'],                'Custom-JoinWiki-Header': r.query.allmessages[1]['*']            } );

if ( $wikiaRail.hasClass( 'loaded' ) ) { createJoinWikiModule; } else { $wikiaRail.on( 'afterLoad.rail', createJoinWikiModule ); }       } )    }    var $wikiaRail = $( '#WikiaRail' );    if ( $wikiaRail.length ) {        joinWikiModule;    } } );