From 2eb7217f490f05b3516b67f076a85b44fbe48f0e Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 21 Aug 2021 00:29:50 +0900 Subject: [PATCH] =?UTF-8?q?js2ts:=20processing=20plugin=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/templates/recruitCrewForm.php | 194 ----------------------------- hwe/ts/colorSelect.ts | 8 +- hwe/ts/defaultSelectCityByMap.ts | 9 +- hwe/ts/defaultSelectNationByMap.ts | 6 +- hwe/ts/recruitCrewForm.ts | 18 ++- 5 files changed, 25 insertions(+), 210 deletions(-) delete mode 100644 hwe/templates/recruitCrewForm.php diff --git a/hwe/templates/recruitCrewForm.php b/hwe/templates/recruitCrewForm.php deleted file mode 100644 index 1b3feb5e..00000000 --- a/hwe/templates/recruitCrewForm.php +++ /dev/null @@ -1,194 +0,0 @@ -병사를 모집합니다. - -훈련과 사기치는 낮지만 가격이 저렴합니다.
- -훈련과 사기치는 높지만 자금이 많이 듭니다. - -가능한 수보다 많게 입력하면 가능한 최대 병사를 모집합니다.
-이미 병사가 있는 경우 추가되며, 병종이 다를경우는 기존의 병사는 소집해제됩니다.
-현재 가능한 병종은 녹색으로 표시되며,
-현재 가능한 특수병종은 초록색으로 표시됩니다.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
불가능한 병종 표시
- -
모병은 가격 2배의 자금이 소요됩니다.
- -
- 현재 기술력 : - 현재 통솔 : - 현재 병종 : - 현재 병사 : - 현재 자금 : -
사진병종공격방어기동회피가격군량병사수행동특징
계열
name?>attack?>defence?>speed?>avoid?>baseCostShort?>baseRiceShort?> -
- 00명 - 원 - -
info?>
-
- - - - - - -
- \ No newline at end of file diff --git a/hwe/ts/colorSelect.ts b/hwe/ts/colorSelect.ts index 37b06433..80f19263 100644 --- a/hwe/ts/colorSelect.ts +++ b/hwe/ts/colorSelect.ts @@ -1,6 +1,6 @@ import $ from 'jquery'; -$(function($){ +export function loadPlugin(): void{ function changeNationColorPlate(){ const $this = $('#colorType'); const $option = $this.find('option:selected'); @@ -9,8 +9,12 @@ $(function($){ 'color':$option.css('color') }); } - $('#colorType').change(function(){ + $('#colorType').on('change', function(){ changeNationColorPlate(); }); changeNationColorPlate(); +} + +$(function(){ + loadPlugin(); }); \ No newline at end of file diff --git a/hwe/ts/defaultSelectCityByMap.ts b/hwe/ts/defaultSelectCityByMap.ts index 9e548e04..13782803 100644 --- a/hwe/ts/defaultSelectCityByMap.ts +++ b/hwe/ts/defaultSelectCityByMap.ts @@ -3,7 +3,8 @@ import { unwrap_any } from "./util/unwrap_any"; /*import $ from 'jquery'; import 'select2';*///TODO: processing -$(function() { + +export function loadPlugin(): void { const $target = $("#destCityID"); console.log('target', $target); void reloadWorldMap({ @@ -11,7 +12,7 @@ $(function() { clickableAll: true, neutralView: true, useCachedMap: true, - selectCallback: function(city) { + selectCallback: function (city) { const currVal = unwrap_any($target.val()); $target.val(city.id).trigger("change"); if ($target.val() === null) { @@ -20,4 +21,8 @@ $(function() { return false; } }); +} + +$(function () { + loadPlugin(); }); \ No newline at end of file diff --git a/hwe/ts/defaultSelectNationByMap.ts b/hwe/ts/defaultSelectNationByMap.ts index dedef34e..3397c01c 100644 --- a/hwe/ts/defaultSelectNationByMap.ts +++ b/hwe/ts/defaultSelectNationByMap.ts @@ -3,7 +3,7 @@ import { unwrap_any } from "./util/unwrap_any"; /*import $ from 'jquery'; import 'select2';*///TODO: processing -$(function() { +export function loadPlugin(): void{ const $target = $("#destNationID"); void reloadWorldMap({ isDetailMap: false, @@ -22,4 +22,8 @@ $(function() { return false; } }); +} + +$(function() { + loadPlugin(); }); \ No newline at end of file diff --git a/hwe/ts/recruitCrewForm.ts b/hwe/ts/recruitCrewForm.ts index db0b0efc..1dddbea2 100644 --- a/hwe/ts/recruitCrewForm.ts +++ b/hwe/ts/recruitCrewForm.ts @@ -3,7 +3,6 @@ import { unwrap_any } from './util/unwrap_any'; declare global { interface Window { - calc: (id: number) => void; submitAction: () => void; } } @@ -12,9 +11,9 @@ declare const leadership: number; declare const fullLeadership: number; declare const currentCrewType: number; declare const currentCrew: number; -declare const currentGold: number; +//declare const currentGold: number; declare const is모병 = false; -window.calc = function (id) { +function calc(id: number) { const $obj = $('#crewType{0}'.format(id)); const crew = parseInt(unwrap_any($obj.find('.form_double').val())); const baseCost = $obj.data('cost'); @@ -28,16 +27,13 @@ window.calc = function (id) { } $(function () { - - - const $postForm = $('#post_form'); const $formAmount = $('#amount'); const $formCrewtype = $('#crewType'); $('.form_double').on('keyup change', function (e) { const $this = $(this); const $parent = $this.parents('.input_form'); const crewtype = parseInt($parent.data('crewtype')); - window.calc(crewtype); + calc(crewtype); $formCrewtype.val(crewtype); $formAmount.val(parseFloat(unwrap_any($this.val())) * 100); @@ -47,7 +43,7 @@ $(function () { return false; }); - $('.btn_half').click(function () { + $('.btn_half').on('click', function () { const $this = $(this); const $parent = $this.closest('.input_form'); const crewtype = parseInt($parent.data('crewtype')); @@ -59,7 +55,7 @@ $(function () { return false; }); - $('.btn_fill').click(function () { + $('.btn_fill').on('click', function () { const $this = $(this); const $parent = $this.closest('.input_form'); const crewtype = parseInt($parent.data('crewtype')); @@ -74,7 +70,7 @@ $(function () { return false; }); - $('.btn_full').click(function () { + $('.btn_full').on('click', function () { const $this = $(this); const $parent = $this.closest('.input_form'); const crewtype = parseInt($parent.data('crewtype')); @@ -86,7 +82,7 @@ $(function () { return false; }); - $('.submit_btn').click(function () { + $('.submit_btn').on('click', function () { const $this = $(this); const $parent = $this.closest('tr').find('.input_form'); const crewtype = parseInt($parent.data('crewtype'));