\
- | \
+ | \
<%korName%>섭 \
\
\
diff --git a/hwe/ts/hallOfFame.ts b/hwe/ts/hallOfFame.ts
index 7c487bd1..eb6fefd8 100644
--- a/hwe/ts/hallOfFame.ts
+++ b/hwe/ts/hallOfFame.ts
@@ -1,6 +1,6 @@
import $ from 'jquery';
import { stringifyUrl } from 'query-string';
-import { initTooltip } from '@/common_legacy';
+import { initTooltip } from "@/legacy/initTooltip";
import 'bootstrap';
$(function ($) {
diff --git a/hwe/ts/legacy/activateFlip.ts b/hwe/ts/legacy/activateFlip.ts
new file mode 100644
index 00000000..93821e37
--- /dev/null
+++ b/hwe/ts/legacy/activateFlip.ts
@@ -0,0 +1,42 @@
+import $ from "jquery";
+
+export function activateFlip($obj?: JQuery): void {
+ let $result: JQuery;
+ if ($obj === undefined) {
+ $result = $('img[data-flip]');
+ } else {
+ $result = $obj.find('img[data-flip]');
+ }
+
+ $result.each(function () {
+ activeFlipItem($(this));
+ });
+
+}
+
+
+export function activeFlipItem($img: JQuery): void {
+ const imageList = [];
+ imageList.push($img.attr('src'));
+ $.each($img.data('flip').split(','), function (idx, value) {
+ value = $.trim(value);
+ if (!value) {
+ return true;
+ }
+ imageList.push(value);
+ });
+ if (imageList.length <= 1) {
+ return;
+ }
+ $img.data('computed_flip_array', imageList);
+ $img.data('computed_flip_idx', 0);
+
+ $img.click(function () {
+ const arr = $img.data('computed_flip_array');
+ let idx = $img.data('computed_flip_idx');
+ idx = (idx + 1) % (arr.length);
+ $img.attr('src', arr[idx]);
+ $img.data('computed_flip_idx', idx);
+ });
+ $img.css('cursor', 'pointer');
+}
diff --git a/hwe/ts/legacy/initTooltip.ts b/hwe/ts/legacy/initTooltip.ts
new file mode 100644
index 00000000..81f73c7e
--- /dev/null
+++ b/hwe/ts/legacy/initTooltip.ts
@@ -0,0 +1,46 @@
+import Tooltip from "bootstrap/js/dist/tooltip";
+//HACK: 이유는 잘 모르겠지만 bootstrap-vue3에서 bootstrap 호출하는 것과 충돌하여 우회 중
+import $ from "jquery";
+import { trim } from "lodash";
+
+export function initTooltip($obj?: JQuery): void {
+ if ($obj === undefined) {
+ $obj = $('.obj_tooltip');
+ } else if (!$obj.hasClass('obj_tooltip')) {
+ $obj = $obj.find('.obj_tooltip');
+ }
+
+ $obj.each(function () {
+ const $target = $(this);
+
+ if ($target.data('installHandler')) {
+ return;
+ }
+ $target.data('installHandler', true);
+
+ $target.on('mouseover', function () {
+ const $objTooltip = $(this);
+ if ($objTooltip.data('setObjTooltip')) {
+ return;
+ }
+
+ let tooltipClassText = $objTooltip.data('tooltip-class');
+ if (!tooltipClassText) {
+ tooltipClassText = '';
+ }
+ const template = ``;
+
+ const oTooltip = new Tooltip(this, {
+ title: function () {
+ return trim(this.querySelector('.tooltiptext')?.innerHTML);
+ },
+ template: template,
+ html: true
+ });
+ oTooltip.show();
+
+ $objTooltip.data('setObjTooltip', true);
+ });
+ });
+
+}
diff --git a/hwe/ts/legacy/main.ts b/hwe/ts/legacy/main.ts
index f1d6424e..e3a5782f 100644
--- a/hwe/ts/legacy/main.ts
+++ b/hwe/ts/legacy/main.ts
@@ -1,29 +1,43 @@
-import $ from 'jquery';
-import { activateFlip, initTooltip } from '@/common_legacy';
+import jQuery from 'jquery';
+import { activateFlip } from "@/legacy/activateFlip";
+import { unwrap } from '@util/unwrap';
+import { htmlReady } from '@util/htmlReady';
+import { initTooltip } from './initTooltip';
+import { exportWindow } from '@/util/exportWindow';
+
import '@/msg.ts';
import '@/map.ts';
-import '@scss/main.scss';
-import { unwrap } from '@util/unwrap';
-import { htmlReady } from '@util/htmlReady';
+exportWindow(jQuery, '$');
+
htmlReady(() => {
- $('.refreshPage').click(function () {
+ document.querySelector('.refreshPage')?.addEventListener('click', function () {
document.location.reload();
return false;
});
- $('.open-window').on('click', function (e) {
+ document.querySelector('.open-window')?.addEventListener('click', function (e) {
e.preventDefault();
- let target = $(e.target as HTMLAnchorElement);
- while (target.attr('href') === undefined) {
- target = target.parent('a');
- if (target.length == 0) {
+ let target: HTMLElement | null = e.target as HTMLElement;
+ while (target !== null) {
+ target = target.parentElement;
+ if (target === null) {
return;
}
+ if (target.tagName != 'a') {
+ continue;
+ }
+ if ((target as HTMLAnchorElement).href !== undefined) {
+ break;
+ }
}
- const href = target.attr('href');
- window.open(href);
+
+ if (!target) {
+ return;
+ }
+
+ window.open((target as HTMLAnchorElement).href);
});
activateFlip();
diff --git a/hwe/ts/select_general_from_pool.ts b/hwe/ts/select_general_from_pool.ts
index 54a9058a..f194fd4c 100644
--- a/hwe/ts/select_general_from_pool.ts
+++ b/hwe/ts/select_general_from_pool.ts
@@ -2,7 +2,7 @@ import $ from 'jquery';
import axios from 'axios';
import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest';
import { InvalidResponse } from '@/defs';
-import { initTooltip } from '@/common_legacy';
+import { initTooltip } from "@/legacy/initTooltip";
import { getIconPath } from "@util/getIconPath";
import { convertFormData } from '@util/convertFormData';
import { unwrap_any } from '@util/unwrap_any';
@@ -64,7 +64,7 @@ const templateGeneralCard = '\
';
const templateSpecial =
- '<%text%>\
+ '<%text%>\
\
<%info%>\
\
diff --git a/hwe/ts/select_npc.ts b/hwe/ts/select_npc.ts
index e124806f..092eca73 100644
--- a/hwe/ts/select_npc.ts
+++ b/hwe/ts/select_npc.ts
@@ -104,7 +104,7 @@ const templateGeneralCard =
';
const templateSpecial =
- '<%text%>\
+ '<%text%>\
\
<%info%>\
\
diff --git a/hwe/ts/v_main.ts b/hwe/ts/v_main.ts
index 07325edb..8a8aed66 100644
--- a/hwe/ts/v_main.ts
+++ b/hwe/ts/v_main.ts
@@ -1,8 +1,6 @@
-
import $ from 'jquery';
exportWindow(scrollHardTo, 'scrollHardTo');
-exportWindow($, '$');
import { exportWindow } from '@util/exportWindow';
import { scrollHardTo } from '@util/scrollHardTo';
@@ -15,6 +13,8 @@ import Multiselect from 'vue-multiselect';
import "@/legacy/main";
import { auto500px } from './util/auto500px';
+import '@scss/main.scss';
+
setAxiosXMLHttpRequest();
createApp(ReservedCommand).use(BootstrapVue3).component('v-multiselect', Multiselect).mount('#reservedCommandList');
diff --git a/package.json b/package.json
index 97a318d0..d1b8245b 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,7 @@
"async-validator": "^4.0.7",
"axios": "^0.24.0",
"bootstrap": "^5.1.3",
+ "bootstrap-vue-3": "^0.1.0",
"core-js": "^3.19.3",
"date-fns": "^2.27.0",
"downloadjs": "^1.4.7",
@@ -58,7 +59,6 @@
"@vue/eslint-config-typescript": "^9.1.0",
"babel-plugin-lodash": "^3.3.4",
"babel-preset-modern-browsers": "^15.0.2",
- "bootstrap-vue-3": "^0.1.0",
"bootswatch": "^5.1.3",
"clean-terminal-webpack-plugin": "^3.0.0",
"css-loader": "^6.5.1",
|