diff --git a/hwe/ts/common_deprecated.ts b/hwe/ts/common_deprecated.ts index a24273e5..f9ba81d6 100644 --- a/hwe/ts/common_deprecated.ts +++ b/hwe/ts/common_deprecated.ts @@ -1,5 +1,5 @@ import { exportWindow } from "@util/exportWindow"; -import { activateFlip, errUnknown, errUnknownToast, quickReject, initTooltip } from "@/common_legacy"; +import { activateFlip, errUnknown, initTooltip } from "@/common_legacy"; import { isBrightColor } from "@util/isBrightColor"; import { getIconPath } from "@util/getIconPath"; import { mb_strwidth } from "@util/mb_strwidth"; @@ -41,7 +41,5 @@ exportWindow(TemplateEngine, 'TemplateEngine'); exportWindow(getIconPath, 'getIconPath'); exportWindow(activateFlip, 'activateFlip'); exportWindow(errUnknown, 'errUnknown'); -exportWindow(errUnknownToast, 'errUnknownToast'); -exportWindow(quickReject, 'quickReject'); exportWindow(nl2br, 'nl2br'); exportWindow(initTooltip, 'initTooltip'); \ No newline at end of file diff --git a/hwe/ts/common_legacy.ts b/hwe/ts/common_legacy.ts index 0a200a16..780a7f13 100644 --- a/hwe/ts/common_legacy.ts +++ b/hwe/ts/common_legacy.ts @@ -1,5 +1,5 @@ import $ from "jquery"; -import { Tooltip } from "bootstrap"; +import { Tooltip } from "bootstrap"; import { trim } from "lodash"; /** @@ -127,24 +127,6 @@ export function errUnknown(): void { alert('작업을 실패했습니다.'); } -export function errUnknownToast(): void { - $.toast({ - title: '에러!', - content: '작업을 실패했습니다.', - type: 'danger', - delay: 5000 - }); -} - -export function quickReject(errMsg: string): JQuery.Promise { - if (errMsg === undefined) { - errMsg = '작업을 실패했습니다.'; - } - const deferred = $.Deferred(); - void deferred.reject(errMsg); - return deferred.promise(); -} - /* function br2nl (text) { return text.replace(/<\s*\/?br\s*[\/]?>/gi, '\n'); diff --git a/hwe/ts/main.ts b/hwe/ts/main.ts index f3468123..973f307d 100644 --- a/hwe/ts/main.ts +++ b/hwe/ts/main.ts @@ -15,7 +15,7 @@ import { unwrap } from '@util/unwrap'; import { auto500px } from '@util/auto500px'; import { htmlReady } from '@util/htmlReady'; -$(function ($) { +htmlReady(() => { $('.refreshPage').click(function () { document.location.reload(); return false; @@ -36,6 +36,13 @@ $(function ($) { activateFlip(); initTooltip(); + + const customCSS = localStorage.getItem('sam_customCSS'); + if (customCSS) { + const $style = $(''); + $style.text(customCSS); + $style.appendTo($('head')); + } }); (() => { @@ -47,7 +54,7 @@ $(function ($) { let nationMsgHeight: number | undefined = undefined; function init() { - if(finInit){ + if (finInit) { return false; } const _nationMsgBox = document.getElementById('nation-msg-box');