143 lines
5.9 KiB
HTML
143 lines
5.9 KiB
HTML
<!DOCTYPE HTML>
|
|
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
|
|
<head th:fragment="header">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<!-- <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" /> -->
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<!-- Font Awesome -->
|
|
<link rel="stylesheet" type="text/css" href="/fontawesome-free-5.0.13/web-fonts-with-css/css/fontawesome-all.min.css" th:href="@{/fontawesome-free-5.0.13/web-fonts-with-css/css/fontawesome-all.min.css}" />
|
|
|
|
<!-- Bootstrap 4 -->
|
|
<link rel="stylesheet" type="text/css" href="/bootstrap-4.0.0-dist/css/bootstrap.min.css" th:href="@{/bootstrap-4.0.0-dist/css/bootstrap.min.css}"/>
|
|
|
|
<!-- Override Bootstrap 4 -->
|
|
<link rel="stylesheet" type="text/css" href="/css/boostrap4/override/colors.css" th:href="@{/css/boostrap4/override/colors.css}" />
|
|
<link rel="stylesheet" type="text/css" href="/css/boostrap4/override/font.css" th:href="@{/css/boostrap4/override/font.css}" />
|
|
|
|
<!-- -->
|
|
<link rel="stylesheet" type="text/css" href="/css/boostrap4/override/bs-common.css" th:href="@{/css/boostrap4/override/bs-common.css}" />
|
|
<link rel="stylesheet" type="text/css" href="/css/common.css" th:href="@{/css/common.css}" />
|
|
|
|
<!-- jQuery -->
|
|
<script src="/js/jquery/jquery-3.3.1.min.js" th:src="@{/js/jquery/jquery-3.3.1.min.js}"></script>
|
|
|
|
<!-- jQuery Cookie-->
|
|
<script src="/js/jquery/jquery.cookie.js" th:src="@{/js/jquery/jquery.cookie.js}" ></script>
|
|
<!-- Bootstrap 4 -->
|
|
<script src="/bootstrap-4.0.0-dist/js/bootstrap.bundle.min.js" th:src="@{/bootstrap-4.0.0-dist/js/bootstrap.bundle.min.js}"></script>
|
|
<script src="/js/common/util.js" th:src="@{/js/common/util.js}" ></script>
|
|
|
|
</head>
|
|
<body class="bg-light body">
|
|
<div th:replace="fragments/header :: header"></div>
|
|
<div id="wrapper">
|
|
|
|
<!-- Content Wrapper. Contains page content -->
|
|
<div class="content-wrapper" layout:fragment="content">
|
|
<!-- Content Header (Page header) -->
|
|
<section class="content-header">
|
|
|
|
</section>
|
|
|
|
<!-- Main content -->
|
|
<section class="content">
|
|
|
|
<!-- Your Page Content Here -->
|
|
|
|
</section>
|
|
<!-- /.content -->
|
|
</div>
|
|
<!-- /.content-wrapper -->
|
|
|
|
</div>
|
|
<!-- ./wrapper -->
|
|
|
|
|
|
<script type="text/javascript">
|
|
/*<![CDATA[*/
|
|
$(document).ready(function() {
|
|
//locale - select
|
|
$('select#locale').on('change', function(e) {
|
|
var v = $(this).val();
|
|
if(typeof window.localStorage === 'object' && typeof window.localStorage.setItem === 'function') {
|
|
window.localStorage.setItem('lang', v);
|
|
}
|
|
location.href = location.pathname + '?lang=' + v;
|
|
});
|
|
|
|
(function(){ //JS Anonymous Function: param 'lang'
|
|
if($('form.form-signin > div[role="alert"]').length > 0) {
|
|
return false;
|
|
}
|
|
|
|
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
|
|
Array.prototype.indexOf||(Array.prototype.indexOf=function(r,t){var n;if(null==this)throw new TypeError('"Array.prototype.indexOf" won\'t support!');var e=Object(this),i=e.length>>>0;if(0===i)return-1;var o=0|t;if(o>=i)return-1;for(n=Math.max(o>=0?o:i-Math.abs(o),0);n<i;){if(n in e&&e[n]===r)return n;n++}return-1});
|
|
|
|
//Suppose 'window.location.href' and 'window.location.pathname' are supported!
|
|
if(typeof window.location.href !== 'string' || typeof window.location.pathname !== 'string' || window.location.pathname.indexOf('?') != -1) {
|
|
var notSupportedMsg = '\'window.location.href\' or \'window.location.pathname\' is not supported!';
|
|
if(typeof console.error === 'function') {
|
|
console.error( notSupportedMsg );
|
|
} else {
|
|
alert( notSupportedMsg );
|
|
}
|
|
return false;
|
|
}
|
|
|
|
//https://stackoverflow.com/questions/5237725/take-a-url-variable-with-regex
|
|
var paramValue = function(k, l) {var n=new RegExp('[?&]'+k+'=([^&#]*)').exec(l||window.location.href);return null==n?null:decodeURI(n[1])||0};
|
|
|
|
var getLang = function() {
|
|
var l = 'ko'; //default 'ko' -->> default 값 변경 ,, 아래 return 코드 참조..
|
|
//window.localStorage: PERSISTS even when the browser is closed and reopened.
|
|
//https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
|
|
if(typeof window.localStorage === 'object' && window.localStorage.length > 0 && typeof window.localStorage.getItem('lang') === 'string') {
|
|
l = window.localStorage.getItem('lang');
|
|
} else {
|
|
//userlang (lang of Browser)
|
|
l = navigator.userLanguage || navigator.language || navigator.languages[0] || l;
|
|
if(l.indexOf('-') > 0 && typeof l.substring === 'function') {
|
|
l = l.substring(0, l.indexOf('-'));
|
|
}
|
|
}
|
|
|
|
//일본어는 'ja'가 맞는 거였는데, 'jp'로 구현해 놓은것에서 수정 최소화 한다는 이유로, 일본어는 당분간 'jp'로 강제로 요청하게 설정
|
|
if(l == 'ja') l = 'jp';
|
|
//2019.06.03: '영어', '일본어', '한국어'가 아니면, default: '영어'!!
|
|
return (l != 'en')&&(l != 'ja' && l != 'jp')&&(l != 'ko')&&(l = 'en')||l;
|
|
}; //end of getLang
|
|
|
|
if(typeof paramValue('lang') !== 'string') {
|
|
//REDIRECT with 'lang'.
|
|
//BE CAREFUL with endless LOOP!!
|
|
window.document.location.href = window.location.pathname + '?lang=' + getLang();
|
|
return false;
|
|
} else if ($('div#navFragment nav .nav-item a').length > 0) {
|
|
$('div#navFragment nav .nav-item a').off('click.href');
|
|
$('div#navFragment nav .nav-item a').on('click.href', function(e) {
|
|
e.preventDefault();
|
|
|
|
var link = $(this).attr('href');
|
|
if(typeof link === 'string' && link.length > 0 && link !== '#') {
|
|
var thisLangValue = paramValue( 'lang', link );
|
|
if(typeof thisLangValue !== 'string') {
|
|
link += '?lang=' + getLang();
|
|
}
|
|
//REDIRECT with 'lang'.
|
|
//BE CAREFUL with endless LOOP!!
|
|
window.document.location.href = link;
|
|
return false;
|
|
}
|
|
|
|
return false; //for href EVENT
|
|
});
|
|
}
|
|
})(); //trigger 'lang'
|
|
}); //document.ready
|
|
/*]]>*/
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|