11 908
edições
Sem resumo de edição |
Sem resumo de edição |
||
| Linha 52: | Linha 52: | ||
mw.loader.using('jquery', function () { | mw.loader.using('jquery', function () { | ||
$(document).ready(function () { | $(document).ready(function () { | ||
var $sortButton = $('<div class="sort-button" style="width: 25px; height: 25px; background-image: url(https://wiki.otpokemon.com/images/e/e2/O-d.png);'></div>'); | |||
var $sortButton = $('<div class="sort-button"> | |||
$('.square-div-gym').before($sortButton); | $('.square-div-gym').before($sortButton); | ||
$sortButton.on('click', function () { | $sortButton.on('click', function () { | ||
var $container = $('.square-div-gym'); | var $container = $('.square-div-gym'); | ||
var $boxes = $container.children('.square-box-gym'); | var $boxes = $container.children('.square-box-gym'); | ||
$boxes.sort(function (a, b) { | $boxes.sort(function (a, b) { | ||
var numA = parseInt($(a).find('.square-name-gym').text().match(/\d+/)[0], 10); | var numA = parseInt($(a).find('.square-name-gym').text().match(/\d+/)[0], 10); | ||
| Linha 68: | Linha 65: | ||
}); | }); | ||
$container.append($boxes); | $container.append($boxes); | ||
}); | }); | ||
}); | }); | ||
}); | }); | ||