From 4ea2b963fa3d7152f7cb718b844023d9bcf5530c Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 30 Aug 2021 01:43:01 +0900 Subject: [PATCH] js2ts: hallOfFame --- hwe/a_hallOfFame.php | 4 +--- hwe/js/hallOfFame.js | 10 ---------- hwe/ts/common_legacy.ts | 1 - hwe/ts/hallOfFame.ts | 26 ++++++++++++++++++++++++++ webpack.config.cjs | 1 + 5 files changed, 28 insertions(+), 14 deletions(-) delete mode 100644 hwe/js/hallOfFame.js create mode 100644 hwe/ts/hallOfFame.ts diff --git a/hwe/a_hallOfFame.php b/hwe/a_hallOfFame.php index 3c2659ea..2dce7828 100644 --- a/hwe/a_hallOfFame.php +++ b/hwe/a_hallOfFame.php @@ -52,9 +52,7 @@ else{ - - - + diff --git a/hwe/js/hallOfFame.js b/hwe/js/hallOfFame.js deleted file mode 100644 index 9a2c165e..00000000 --- a/hwe/js/hallOfFame.js +++ /dev/null @@ -1,10 +0,0 @@ -jQuery(function($){ - $('#by_scenario').change(function(){ - var $this = $(this); - var scenarioIdx = $this.val(); - var seasonIdx = $(this).find('option:selected').data('season'); - - - $.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx, seasonIdx:seasonIdx}, 'get'); - }) -}); \ No newline at end of file diff --git a/hwe/ts/common_legacy.ts b/hwe/ts/common_legacy.ts index 8b626815..13ae6830 100644 --- a/hwe/ts/common_legacy.ts +++ b/hwe/ts/common_legacy.ts @@ -199,7 +199,6 @@ export function initTooltip($obj?: JQuery): void { } else if (!$obj.hasClass('obj_tooltip')) { $obj = $obj.find('.obj_tooltip'); } - console.log($obj); $obj.each(function () { const $target = $(this); diff --git a/hwe/ts/hallOfFame.ts b/hwe/ts/hallOfFame.ts new file mode 100644 index 00000000..07839a02 --- /dev/null +++ b/hwe/ts/hallOfFame.ts @@ -0,0 +1,26 @@ +import $ from 'jquery'; +import { stringifyUrl } from 'query-string'; +import { initTooltip } from './common_legacy'; +import Popper from 'popper.js'; +exportWindow(Popper, 'Popper'); +import 'bootstrap'; +import { exportWindow } from './util/exportWindow'; + +$(function ($) { + $('#by_scenario').on('change', function (e) { + e.preventDefault(); + + const $this = $(this); + const scenarioIdx = $this.val(); + const seasonIdx = $(this).find('option:selected').data('season'); + + document.location.href = stringifyUrl({ + url: 'a_hallOfFame.php', + query: { + scenarioIdx: scenarioIdx, seasonIdx: seasonIdx + } + }); + }) + + initTooltip(); +}); \ No newline at end of file diff --git a/webpack.config.cjs b/webpack.config.cjs index 070547ef..0c60b222 100644 --- a/webpack.config.cjs +++ b/webpack.config.cjs @@ -37,6 +37,7 @@ module.exports = (env, argv) => { dipcenter: '@/dipcenter.ts', diplomacy: '@/diplomacy.ts', currentCity: '@/currentCity.ts', + hallOfFame: '@/hallOfFame.ts', //FORM 입력용, frontend 변경후 제거