build: processing parts
This commit is contained in:
1 parent
a5b4a4c59f
commit
e2b09caff3
12 files changed
+16
-149
No files matched your search
@@ -1,97 +1,2 @@
|
||||
window.calc = function(id) {
|
||||
var $obj = $('#crewType{0}'.format(id));
|
||||
var crew = $obj.find('.form_double').val();
|
||||
var baseCost = $obj.data('cost');
|
||||
var $cost = $obj.find('.form_cost');
|
||||
|
||||
var cost = crew * baseCost;
|
||||
if(window.is모병){
|
||||
cost *= 2;
|
||||
}
|
||||
$cost.val(Math.round(cost));
|
||||
}
|
||||
|
||||
$(function(){
|
||||
|
||||
|
||||
var $postForm = $('#post_form');
|
||||
var $formAmount = $('#amount');
|
||||
var $formCrewtype = $('#crewType');
|
||||
$('.form_double').on('keyup change',function(e){
|
||||
var $this = $(this);
|
||||
var $parent = $this.parents('.input_form');
|
||||
var crewtype = parseInt($parent.data('crewtype'));
|
||||
calc(crewtype);
|
||||
$formCrewtype.val(crewtype);
|
||||
$formAmount.val($this.val()*100);
|
||||
|
||||
if(e.which === 13){
|
||||
submitAction();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.btn_half').click(function(){
|
||||
var $this = $(this);
|
||||
var $parent = $this.closest('.input_form');
|
||||
var crewtype = parseInt($parent.data('crewtype'));
|
||||
var $input = $parent.find('.form_double:eq(0)');
|
||||
|
||||
var fillValue = Math.round(leadership / 2);
|
||||
$formCrewtype.val(crewtype);
|
||||
$input.val(fillValue).change();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.btn_fill').click(function(){
|
||||
var $this = $(this);
|
||||
var $parent = $this.closest('.input_form');
|
||||
var crewtype = parseInt($parent.data('crewtype'));
|
||||
var $input = $parent.find('.form_double:eq(0)');
|
||||
|
||||
var fillValue = Math.ceil((leadership*100 - currentCrew)/100);
|
||||
if(crewtype != currentCrewType){
|
||||
fillValue = leadership;
|
||||
}
|
||||
$formCrewtype.val(crewtype);
|
||||
$input.val(fillValue).change();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.btn_full').click(function(){
|
||||
var $this = $(this);
|
||||
var $parent = $this.closest('.input_form');
|
||||
var crewtype = parseInt($parent.data('crewtype'));
|
||||
var $input = $parent.find('.form_double:eq(0)');
|
||||
|
||||
var fillValue = fullLeadership + 15;
|
||||
$formCrewtype.val(crewtype);
|
||||
$input.val(fillValue).change();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.submit_btn').click(function(){
|
||||
var $this = $(this);
|
||||
var $parent = $this.closest('tr').find('.input_form');
|
||||
var crewtype = parseInt($parent.data('crewtype'));
|
||||
var $input = $parent.find('.form_double');
|
||||
|
||||
$formCrewtype.val(crewtype);
|
||||
$formAmount.val($input.val()*100);
|
||||
|
||||
submitAction();
|
||||
});
|
||||
|
||||
$('.btn_fill').click();
|
||||
|
||||
$('#show_unavailable_troops').change(function(){
|
||||
var show = $('#show_unavailable_troops').is(":checked");
|
||||
if(show){
|
||||
$('.show_default_false').show();
|
||||
}
|
||||
else{
|
||||
$('.show_default_false').hide();
|
||||
}
|
||||
});
|
||||
$('.show_default_false').hide();
|
||||
});
|
||||
(()=>{"use strict";var e,t={3904:(e,t,r)=>{r(1058),r(9826),r(4678);var n=r(9755),o=r.n(n);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}function l(e){var t=d();return function(){var r,n=b(e);if(t){var o=b(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}function f(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){var t="function"==typeof Map?new Map:void 0;return(p=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}functiLine truncated
|
||||
//# sourceMappingURL=recruitCrewForm.js.map
|
||||
Reference in new issue
Block a user