84 lines
2.3 KiB
HTML
84 lines
2.3 KiB
HTML
<!doctype html>
|
|
<html lang="ko" style="height: 100%">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>웹한글 기안기 브리지</title>
|
|
<style>
|
|
html,
|
|
body,
|
|
#hwpctrl {
|
|
width: 100%;
|
|
height: 100%;
|
|
margin: 0;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
border: 0;
|
|
}
|
|
|
|
#hwpctrl_frame {
|
|
width: 100% !important;
|
|
height: 100% !important;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="hwpctrl"></div>
|
|
<script type="text/javascript">
|
|
(function () {
|
|
// baseurl: 부모(HangulGiangi)가 NEXT_PUBLIC_WEBHYP_CTRL_URL 값으로 전달.
|
|
// 없으면 same-origin 프록시 경로(/webhwpctrl/ → next.config rewrites)를 사용한다.
|
|
var params = new URLSearchParams(window.location.search);
|
|
var baseUrl = params.get("baseurl") || new URL("./", window.location.href).href;
|
|
if (baseUrl.charAt(baseUrl.length - 1) !== "/") {
|
|
baseUrl += "/";
|
|
}
|
|
|
|
var scripts = [
|
|
"js/hwpctrlapp/utils/util.js",
|
|
"js/hwpctrlapp/hwpCtrlApp.js",
|
|
"js/webhwpctrl.js",
|
|
];
|
|
|
|
function loadScript(index) {
|
|
if (index >= scripts.length) {
|
|
init();
|
|
return;
|
|
}
|
|
var script = document.createElement("script");
|
|
script.type = "text/javascript";
|
|
script.src = baseUrl + scripts[index];
|
|
script.onload = function () {
|
|
loadScript(index + 1);
|
|
};
|
|
script.onerror = function () {
|
|
console.error("웹한글 기안기 스크립트 로드 실패: " + script.src);
|
|
};
|
|
document.head.appendChild(script);
|
|
}
|
|
|
|
function init() {
|
|
var HwpCtrl = BuildWebHwpCtrl(
|
|
"hwpctrl",
|
|
baseUrl,
|
|
function () {
|
|
try {
|
|
window.parent.postMessage({ type: "hangulgiangi-ready" }, "*");
|
|
} catch (e) {
|
|
console.warn(e);
|
|
}
|
|
},
|
|
2,
|
|
);
|
|
|
|
// 부모(HangulGiangi)가 contentWindow.HwpCtrl 로 접근
|
|
window.HwpCtrl = HwpCtrl;
|
|
}
|
|
|
|
loadScript(0);
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|