playerx / Save Both Lineup Script

// ==UserScript==
// @name       Save Both Lineup Script
// @namespace  http://playerx.hitwicket.com/
// @version    0.2
// @description  Add the Save Changes to Both Lineup button
// @match      http*://*hitwicket.com/match/setorder*
// @copyright  2012+, You
// ==/UserScript==


function copyToSecondBatLineup() {
   $("#copy_bat_first_in_bat_second").trigger("click");
   $(".save_match_orders").trigger("click");
}

var saveBothLineupButton = '<input type="button" value="Save Changes to Both Lineup" id="copy_both_lineup" class="btn btn-success btn-md m10">';
$(".save_match_orders").parent().prepend(saveBothLineupButton);

$("#copy_both_lineup").click(function(event) {
    copyToSecondBatLineup();
});