From 8c7a8f977786f6aa9362f7288e230e0cb1024cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Sat, 18 Oct 2014 18:28:18 +0200 Subject: [PATCH] Simplified Bonus-Output --- src/jsds.js | 50 ++++++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/src/jsds.js b/src/jsds.js index 2b416c1..f31d664 100644 --- a/src/jsds.js +++ b/src/jsds.js @@ -298,40 +298,26 @@ sel_bon: function() { var outstr="

"; outstr += "Boni?
"; - outstr += "Waffenbonus Nahkampf:
"; - outstr += "Waffenbonus Fernkampf:
"; - outstr += "Panzerungsbonus:
"; - outstr += "Zauberbonus:
"; + outstr += "Waffenbonus Nahkampf:
"; + outstr += "Waffenbonus Fernkampf:
"; + outstr += "Panzerungsbonus:
"; + outstr += "Zauberbonus:
"; $('#uibon').html(outstr); - $('#wbn').attr("value", cur_sel.extern.weapon_near+"") - .bind("change", - function() {cur_sel.extern.weapon_near = this.value*1; - cur_sel.recalc_battle(); - cur_sel.printoutput(); - } - ); - $('#wbf').attr("value", cur_sel.extern.weapon_far) - .bind("change", - function() {cur_sel.extern.weapon_far = this.value*1; - cur_sel.recalc_battle(); - cur_sel.printoutput(); - } - ); - $('#pb').attr("value",cur_sel.extern.armor) - .bind("change", - function() {cur_sel.extern.armor = this.value*1; - cur_sel.recalc_battle(); - cur_sel.printoutput(); - } - ); - $('#zb').attr("value",cur_sel.extern.chant) - .bind("change", - function() {cur_sel.extern.chant = this.value*1; - cur_sel.recalc_battle(); - cur_sel.printoutput(); - } - ); + $('.bon').bind("change", function() { + cur_sel.extern.weapon_near = $('#wbn').val()*1; + cur_sel.extern.weapon_far = $('#wbf').val()*1; + cur_sel.extern.armor = $('#pb').val()*1; + cur_sel.extern.chant = $('#zb').val()*1; + cur_sel.recalc_battle(); + cur_sel.sel_att(); + cur_sel.printoutput(); + }); + + $('#wbn').attr("value", cur_sel.extern.weapon_near+""); + $('#wbf').attr("value", cur_sel.extern.weapon_far); + $('#pb').attr("value",cur_sel.extern.armor); + $('#zb').attr("value",cur_sel.extern.chant); }, printoutput: function() { outstr = "

";