<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<div class="spinner-border spinner-border-lg text-primary wait" role="status">
  <span class="visually-hidden">Loading...</span>
</div>
<!-- Helpers -->
<script src="<c:url value="/resources/3rd-party/sneat/js/helpers.js"/>"></script>

<!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
<!--? Template customizer: To hide customizer set displayCustomizer value false in config.js.  -->
<%-- <script src="<c:url value="/resources/3rd-party/sneat/js/template-customizer.js"/>"></script> --%>
<%--? Config:  Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file.  -->
<script src="../../assets/js/config.js"></script--%>
<script src="<c:url value='/resources/3rd-party/sneat/js/config.js'/>"></script>

<!-- Core JS -->
<!-- build:js assets/vendor/js/core.js -->
<script src="<c:url value="/resources/3rd-party/sneat/libs/jquery/jquery.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/popper/popper.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/js/bootstrap.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/hammer/hammer.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/i18n/i18n.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/js/menu.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/jstree/jstree.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/jstree/jstree-support.js"/>"></script>
<script src="<c:url value='/resources/3rd-party/sneat/libs/chartjs/chartjs.js'/>"></script>
<script src="<c:url value="/resources/lib/fims/framework/jquery-ui/1.13.2/jquery-ui.js?${ver}"/>"></script>

<!-- base -->
<script src="<c:url value="/resources/js/base/base.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/base-fims.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/dataset.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/upload-support.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/code.js"/>?${ver}"></script>
<script src="<c:url value="/resources/js/base/code-support.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/menu.js"/>?${ver}"></script>
<script src="<c:url value="/resources/js/base/menu-support.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/menu-support-fims.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/actionGroup.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/user.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/authority.js?${ver}"/>"></script>

<!-- vaildation 관련 유틸 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/cmmUtil.js?${ver}"/>"></script>
<!-- 날짜 관련 유틸 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/cmmDateUtil.js?${ver}"/>"></script>
<!-- 업무별 기능 유틸 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/taskUtil.js?${ver}"/>"></script>
<!-- 데이트픽커 -->
<script src="<c:url value="/resources/lib/fims/framework/datepicker/datepicker.js?${ver}"/>"></script>
<!-- 초기화 유틸 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/initAfterPageLoad.js?${ver}"/>"></script>
<!-- 검색 유틸 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/searchUtil.js?${ver}"/>"></script>
<!-- 단축키 설정 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/shortcutKey.js?${ver}"/>"></script>

<!-- endbuild -->
<c:set var="functions" scope="request">
wctx.path = "${pageContext.request.contextPath}";
wctx.version = "${ver}";
wctx.trace = ${!production};
wctx.csrf = {
	header:"${_csrf.headerName}",
	token:"${_csrf.token}"
};
dialog.title = "XIT Base";

<c:if test="${currentUser.authenticated}">
function logout() {
	dialog.alert({
		content:"로그아웃 하시겠습니까?",
		onOK:function(){
			var form = $("<form action=\"<c:url value='/logout.do'/>\", method=\"POST\">");
			$("<input name=\"${_csrf.parameterName}\" value=\"${_csrf.token}\" type=\"hidden\">").appendTo(form);
			form.appendTo("body").submit();
		}
	});
}</c:if>

<c:if test="${currentUser.hasAuthorities('ROLE_ADMIN')}">
async function selectURL(multiple) {
	return new Promise(function(resolve, reject) {
		ajax.get({
			url:wctx.url("/urls.do"),
			data:{multiple:multiple},
			success: resp => {
				dialog.open({
					title:"URL 선택",
					content:resp,
					getData:() => getSelectedURL(),
					onOK:selected => {
						resolve(selected);
					}
				});
			}
		});
	});
}
</c:if>

</c:set>
