From 111a81766e5c35efd5706e327e43b1a63434b941 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 11 Dec 2021 03:21:47 +0900 Subject: [PATCH] =?UTF-8?q?misc:=20bootstrap4=20toast=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/common_deprecated.ts | 4 +--- hwe/ts/common_legacy.ts | 20 +------------------- hwe/ts/main.ts | 11 +++++++++-- 3 files changed, 11 insertions(+), 24 deletions(-) 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');