Files
core/hwe/ts/common_deprecated.ts
T
Hide_D 97dfb02ab6 js2ts: dipcenter(WIP)
- summernote 이식
- summernote/imageFip plugin 이식
2021-08-29 01:39:03 +09:00

42 lines
1.5 KiB
TypeScript

import { activateFlip, isBrightColor, getIconPath, errUnknown, errUnknownToast, quickReject, initTooltip } from "./common_legacy";
import { mb_strwidth } from "./util/mb_strwidth";
import { TemplateEngine } from "./util/TemplateEngine";
import { escapeHtml } from "./legacy/escapeHtml";
import { nl2br } from "./util/nl2br";
import jQuery from "jquery";
import { exportWindow } from "./util/exportWindow";
exportWindow(jQuery, '$');
exportWindow(jQuery, 'jQuery');
jQuery(function ($) {
initTooltip();
activateFlip();
const customCSS = localStorage.getItem('sam_customCSS');
if (customCSS) {
const $style = $('<style type="text/css"></style>');
$style.text(customCSS);
$style.appendTo($('head'));
}
});
/**
* {0}, {1}, {2}형태로 포맷해주는 함수
*/
exportWindow(function(this:string, ...args:(string|number)[]){
return this.replace(/{(\d+)}/g, function (match, number) {
return (typeof args[number] != 'undefined') ? args[number].toString() : match;
});
}, 'format', String.prototype);
exportWindow(escapeHtml, 'escapeHtml');
exportWindow(mb_strwidth, 'mb_strwidth');
exportWindow(isBrightColor, 'isBrightColor');
exportWindow(TemplateEngine, 'TemplateEngine');
exportWindow(getIconPath, 'getIconPath');
exportWindow(activateFlip, 'activateFlip');
exportWindow(errUnknown, 'errUnknown');
exportWindow(errUnknownToast, 'errUnknownToast');
exportWindow(quickReject, 'quickReject');
exportWindow(nl2br, 'nl2br');
exportWindow(initTooltip, 'initTooltip');