diff --git a/css/login.css b/css/login.css index cf1ef0ae..0dc81843 100644 --- a/css/login.css +++ b/css/login.css @@ -127,6 +127,8 @@ input::-webkit-input-placeholder { border-radius: .2rem; } -#running_map { - margin-top: 20px; +#running_map{ + overflow: hidden; + border: none; + width:700px; } \ No newline at end of file diff --git a/hwe/recent_map.php b/hwe/recent_map.php new file mode 100644 index 00000000..2181f6fe --- /dev/null +++ b/hwe/recent_map.php @@ -0,0 +1,57 @@ + + + + + + + + + 최근 지도 + + + + + + + + + + + + + + +
+

+ 현황 +

+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/hwe/ts/map.ts b/hwe/ts/map.ts index 327275a7..c7e2800f 100644 --- a/hwe/ts/map.ts +++ b/hwe/ts/map.ts @@ -1,5 +1,5 @@ import axios from 'axios'; -import jQuery from 'jquery'; +import $ from 'jquery'; import { extend, isNumber } from 'lodash'; import { convColorValue, convertDictById, convertSet } from './common_legacy'; import { InvalidResponse } from './defs'; @@ -110,7 +110,7 @@ function is_touch_device(): boolean { type loadMapOption = { isDetailMap?: boolean, //복잡 지도, 단순 지도 clickableAll?: boolean, //어떤 경우든 클릭을 가능하게 함. 해당 동작의 동작 가능성 여부와는 별도. - selectCallback?: (city: MapCityParsed) => void, //callback을 지정시 clickable과 관계 없이 해당 함수를 실행. + selectCallback?: (city: MapCityParsed) => void, //callback을 지정시 clickable과 관계 없이 해당 함수를 실행. hrefTemplate?: string, //도시가 클릭가능할 경우 지정할 href값. {0}은 도시 id로 변환됨 useCachedMap?: boolean, //맵 캐시를 사용 @@ -124,14 +124,14 @@ type loadMapOption = { targetJson?: string, reqType?: 'get' | 'post', dynamicMapTheme?: boolean, - callback?: (a: unknown, rawObejct: unknown) => void, + callback?: (a: MapCityDrawable, rawObejct: MapRawResult) => void, //기타 보조 값 startYear?: number, } export async function reloadWorldMap(option: loadMapOption, drawTarget = '.world_map'): Promise { - const $world_map = jQuery(drawTarget); + const $world_map = $(drawTarget); if ($world_map.length == 0) { return; @@ -140,7 +140,7 @@ export async function reloadWorldMap(option: loadMapOption, drawTarget = '.world const defaultOption: loadMapOption = { isDetailMap: true, //복잡 지도, 단순 지도 clickableAll: false, //어떤 경우든 클릭을 가능하게 함. 해당 동작의 동작 가능성 여부와는 별도. - selectCallback: undefined, //callback을 지정시 clickable과 관계 없이 해당 함수를 실행. + selectCallback: undefined, //callback을 지정시 clickable과 관계 없이 해당 함수를 실행. hrefTemplate: '#', //도시가 클릭가능할 경우 지정할 href값. {0}은 도시 id로 변환됨 useCachedMap: false, //맵 캐시를 사용 @@ -439,7 +439,7 @@ export async function reloadWorldMap(option: loadMapOption, drawTarget = '.world if(myCity){ $world_map.find(`.city_base_${myCity} .city_filler`).addClass('my_city'); } - + return obj; } @@ -499,7 +499,7 @@ export async function reloadWorldMap(option: loadMapOption, drawTarget = '.world if(myCity){ $world_map.find(`.city_base_${myCity} .city_filler`).addClass('my_city'); } - + return obj; } @@ -729,7 +729,7 @@ export async function reloadWorldMap(option: loadMapOption, drawTarget = '.world const response = await responseP; - const rawObject = response.data; + const rawObject: MapRawResult = response.data; const computedResult = await checkReturnObject(rawObject) .then(setMapBackground) @@ -783,7 +783,7 @@ export async function reloadWorldMap(option: loadMapOption, drawTarget = '.world } window.reloadWorldMap = reloadWorldMap; -$(function () { +$(function ($) { if (is_touch_device()) { $('.map_body .map_toggle_single_tap').show(); } diff --git a/hwe/ts/recent_map.ts b/hwe/ts/recent_map.ts new file mode 100644 index 00000000..94b9623c --- /dev/null +++ b/hwe/ts/recent_map.ts @@ -0,0 +1,30 @@ +import $ from 'jquery'; +import 'bootstrap'; +import { reloadWorldMap } from './map'; + +declare global{ + interface Window{ + fitIframe:()=>void; + } +} + +$(function($){ + void reloadWorldMap({ + targetJson: "j_map_recent.php", + reqType: 'get', + dynamicMapTheme: true, + callback: function(data, rawObject) { + const historyRaw = rawObject as unknown as { + history: string + }; + $('.card-body').html(historyRaw.history); + + if(window.parent !== window){ + setTimeout(()=>{ + window.parent.fitIframe(); + }, 1); + + } + } + }); +}); \ No newline at end of file diff --git a/index.php b/index.php index d93bb8da..6c115cbc 100644 --- a/index.php +++ b/index.php @@ -38,10 +38,6 @@ foreach(ServConfig::getServerList() as $setting){ break; } -if($runningServer){ - $subTemplates = new \League\Plates\Engine(__DIR__.'/'.$runningServer['name'].'/templates'); -} - ?> @@ -51,9 +47,6 @@ if($runningServer){ 삼국지 모의전투 HiDCHe - @@ -61,16 +54,6 @@ if($runningServer){ - - - - - - - - @@ -224,20 +207,9 @@ if($runningServer){ -
-
-
-

- 현황 -

-
- render('map', [ - 'mapTheme' => '' - ])?> -
-
-
-
+
+
+
diff --git a/webpack.config.js b/webpack.config.js index ef3e457d..ac20d404 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,6 +17,7 @@ module.exports = [ install_db: './hwe/ts/install_db.ts', install: './hwe/ts/install.ts', battle_simulator: './hwe/ts/battle_simulator.ts', + recent_map: './hwe/ts/recent_map.ts', //FORM 입력용, frontend 변경후 제거