// ==UserScript== // @name Add routine to transfer list Firefox // @version 0.3 // @author Jhonatan Bianchi // @include http://trophymanager.com/transfer/* // @grant none // @description firefox // @namespace https://greasyfork.org/users/68506 // @downloadURL https://update.greasyfork.icu/scripts/23591/Add%20routine%20to%20transfer%20list%20Firefox.user.js // @updateURL https://update.greasyfork.icu/scripts/23591/Add%20routine%20to%20transfer%20list%20Firefox.meta.js // ==/UserScript== jQuery.noConflict(true); unsafeWindow.jQuery(document).ajaxComplete(function(event, xhr, settings) { rebindClicks(); if (settings.url === "/ajax/transfer.ajax.php") { calcularRotinas(); } }); function rebindClicks() { $.each($('#pages').find('span'), function(index, span) { var clickAntigo = $(span).attr('onclick'); $(span).removeAttr('onclick'); $(span).off('click'); $(span).on('click', function() { eval(clickAntigo); calcularRotinas(); rebindClicks(); }); }); } function calcularRotinas() { $('.routine').remove(); $("tr.header").append("