diff --git a/hwe/sammo/Command/General/che_건국.php b/hwe/sammo/Command/General/che_건국.php index 7e1f18bc..5c55cd7c 100644 --- a/hwe/sammo/Command/General/che_건국.php +++ b/hwe/sammo/Command/General/che_건국.php @@ -199,7 +199,7 @@ class che_건국 extends Command\GeneralCommand public function getJSPlugins(): array { return [ - 'dist_js/colorSelect.js' + 'colorSelect' ]; } diff --git a/hwe/sammo/Command/General/che_징병.php b/hwe/sammo/Command/General/che_징병.php index 517d1a38..7d37c28f 100644 --- a/hwe/sammo/Command/General/che_징병.php +++ b/hwe/sammo/Command/General/che_징병.php @@ -234,7 +234,7 @@ class che_징병 extends Command\GeneralCommand public function getJSPlugins(): array { return [ - 'dist_js/recruitCrewForm.js' + 'recruitCrewForm' ]; } diff --git a/hwe/sammo/Command/Nation/che_국기변경.php b/hwe/sammo/Command/Nation/che_국기변경.php index b025e731..b10e905c 100644 --- a/hwe/sammo/Command/Nation/che_국기변경.php +++ b/hwe/sammo/Command/Nation/che_국기변경.php @@ -154,7 +154,7 @@ class che_국기변경 extends Command\NationCommand public function getJSPlugins(): array { return [ - 'dist_js/colorSelect.js' + 'colorSelect' ]; } diff --git a/hwe/sammo/Command/Nation/che_국호변경.php b/hwe/sammo/Command/Nation/che_국호변경.php index 2d0d58c8..436607e7 100644 --- a/hwe/sammo/Command/Nation/che_국호변경.php +++ b/hwe/sammo/Command/Nation/che_국호변경.php @@ -160,7 +160,7 @@ class che_국호변경 extends Command\NationCommand public function getJSPlugins(): array { return [ - 'dist_js/colorSelect.js' + 'colorSelect' ]; } diff --git a/hwe/ts/colorSelect.ts b/hwe/ts/colorSelect.ts index 80f19263..31daa772 100644 --- a/hwe/ts/colorSelect.ts +++ b/hwe/ts/colorSelect.ts @@ -1,6 +1,4 @@ -import $ from 'jquery'; - -export function loadPlugin(): void{ +export function colorSelect(): void{ function changeNationColorPlate(){ const $this = $('#colorType'); const $option = $this.find('option:selected'); @@ -13,8 +11,4 @@ export function loadPlugin(): void{ changeNationColorPlate(); }); changeNationColorPlate(); -} - -$(function(){ - loadPlugin(); -}); \ No newline at end of file +} \ No newline at end of file diff --git a/hwe/ts/processing.ts b/hwe/ts/processing.ts index c096cffd..a5b557d3 100644 --- a/hwe/ts/processing.ts +++ b/hwe/ts/processing.ts @@ -14,6 +14,8 @@ import { DataFormat, IdTextPair, OptionData } from 'select2'; import { unwrap } from "./util/unwrap"; import { defaultSelectCityByMap } from './defaultSelectCityByMap'; import { defaultSelectNationByMap } from './defaultSelectNationByMap'; +import { colorSelect } from './colorSelect'; +import { recruitCrewForm } from './recruitCrewForm'; declare const isChiefTurn: boolean; declare const jsPlugins: string[]; @@ -286,6 +288,8 @@ $(function ($) { const pluginMap:Recordvoid> = { 'defaultSelectCityByMap': defaultSelectCityByMap, 'defaultSelectNationByMap': defaultSelectNationByMap, + 'colorSelect': colorSelect, + 'recruitCrewForm': recruitCrewForm, }; for (const jsPlugin of jsPlugins) { if (jsPlugin in pluginMap) { diff --git a/hwe/ts/recruitCrewForm.ts b/hwe/ts/recruitCrewForm.ts index d59ba3a9..fa0bce94 100644 --- a/hwe/ts/recruitCrewForm.ts +++ b/hwe/ts/recruitCrewForm.ts @@ -1,4 +1,3 @@ -import $ from 'jquery'; import { unwrap_any } from './util/unwrap_any'; @@ -21,7 +20,7 @@ function calc(id: number) { $cost.val(Math.round(cost)); } -$(function () { +export function recruitCrewForm(): void { const $formAmount = $('#amount'); const $formCrewtype = $('#crewType'); $('.form_double').on('keyup change', function (e) { @@ -101,4 +100,4 @@ $(function () { } }); $('.show_default_false').hide(); -}); \ No newline at end of file +} \ No newline at end of file diff --git a/webpack.config.cjs b/webpack.config.cjs index 0c60b222..9ef2bc0d 100644 --- a/webpack.config.cjs +++ b/webpack.config.cjs @@ -38,13 +38,6 @@ module.exports = (env, argv) => { diplomacy: '@/diplomacy.ts', currentCity: '@/currentCity.ts', hallOfFame: '@/hallOfFame.ts', - - - //FORM 입력용, frontend 변경후 제거 - defaultSelectCityByMap: '@/defaultSelectCityByMap.ts', - defaultSelectNationByMap: '@/defaultSelectNationByMap.ts', - colorSelect: '@/colorSelect.ts', - recruitCrewForm: '@/recruitCrewForm.ts' }, output: { filename: '[name].js',