REMOVA OS ANÚNCIOS!

Apoiando através de https://apoia.se/arddhu a partir do tier de Apoiador, você pode navegar na wiki sem anúncios e ainda colabora com o projeto!

MediaWiki:Common.js: mudanças entre as edições

De Runarcana Wiki
Sem resumo de edição
Etiqueta: Revertido
Sem resumo de edição
Etiqueta: Reversão manual
Linha 6: Linha 6:
/* Tabela */
/* Tabela */


$(document).ready(function() {
OO.ui.throttle( function () {
     setTimeout(function(){
     var $table = $( '.organize' );
        var $table = $( '.organize' );
    var $rows = $table.find( 'tr' );
        var $rows = $table.find( 'tr' );
    $rows.sort( function( a, b ) {
        $rows.sort( function( a, b ) {
        var keyA = $(a).find( 'td' ).text().toUpperCase();
            var keyA = $(a).find( 'td' ).text().toUpperCase();
        var keyB = $(b).find( 'td' ).text().toUpperCase();
            var keyB = $(b).find( 'td' ).text().toUpperCase();
        if ( keyA < keyB ) return -1;
            if ( keyA < keyB ) return -1;
        if ( keyA > keyB ) return 1;
            if ( keyA > keyB ) return 1;
        return 0;
            return 0;
    });
        });
    $table.append( $rows );
        $table.append( $rows );
}, 250 ).execute();
    },250);
});


/* Lista */
/* Lista */

Edição das 12h31min de 12 de janeiro de 2023

/* Códigos JavaScript aqui colocados serão carregados por todos aqueles que acessarem alguma página deste wiki */

mw.loader.load( 'https://wiki.runarcana.org/util/ptoc.css', 'text/css' );
mw.loader.load( 'https://wiki.runarcana.org/util//ptoc.js', 'text/javascript' );

/* Tabela */

OO.ui.throttle( function () {
    var $table = $( '.organize' );
    var $rows = $table.find( 'tr' );
    $rows.sort( function( a, b ) {
        var keyA = $(a).find( 'td' ).text().toUpperCase();
        var keyB = $(b).find( 'td' ).text().toUpperCase();
        if ( keyA < keyB ) return -1;
        if ( keyA > keyB ) return 1;
        return 0;
    });
    $table.append( $rows );
}, 250 ).execute();

/* Lista */
$(document).ready(function() {
    $(".organiza_lista").each(function() {
        var list = $(this);
        var items = list.find("li");
        items.sort(function(a, b) {
            return $(a).text().localeCompare($(b).text());
        });
        list.html("");
        items.each(function() {
            list.append($(this));
        });
    });
});