Merge branch 'main' of http://211.119.124.110:3000/xit-app/adds-fo.git into main
commit
4df015aae3
@ -0,0 +1,80 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||||
|
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||||
|
<form id="change-password">
|
||||||
|
<div class="row g-3">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-sm-4 col-form-label text-sm-end required" for="currentPassword">현재 비밀번호</label>
|
||||||
|
<div class="col-sm-8"><input name="currentPassword" type="password" required class="form-control" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-sm-4 col-form-label text-sm-end required" for="password">새 비밀번호</label>
|
||||||
|
<div class="col-sm-8"><input name="password" type="password" required class="form-control" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-sm-4 col-form-label text-sm-end required" for="confirmPassword">비밀번호 확인</label>
|
||||||
|
<div class="col-sm-8"><input name="confirmPassword" type="password" required class="form-control" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
function changePassword() {
|
||||||
|
if (!$("#change-password input").validInputs())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
let passwords = document.querySelectorAll("#change-password input[type='password']");
|
||||||
|
if (passwords[0].value == passwords[1].value) {
|
||||||
|
dialog.alert("현재 비밀번호와 새 비밀번호가 같습니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (passwords[1].value != passwords[2].value) {
|
||||||
|
dialog.alert("새 비밀번호와 비밀번호 확인이 다릅니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return currentUserControl.changePassword({
|
||||||
|
userIDs: "${currentUser.id}",
|
||||||
|
currentPassword: passwords[0].value,
|
||||||
|
password: passwords[1].value
|
||||||
|
})
|
||||||
|
.then(resp => {
|
||||||
|
if (!resp.saved) {
|
||||||
|
dialog.alert("현재 비밀번호가 잘못됐습니다.");
|
||||||
|
} else {
|
||||||
|
dialog.alert({
|
||||||
|
content: "비밀번호가 변경됐습니다.<br />다시 로그인하시기 바랍니다.",
|
||||||
|
onClose: () => logout(false)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$("#change-password input").onEnterPress(() => changePassword());
|
||||||
|
});
|
||||||
|
<%--
|
||||||
|
function savePassword(){
|
||||||
|
ajax.post({
|
||||||
|
url : wctx.url("/user/changePassword.do"),
|
||||||
|
data : {
|
||||||
|
userID : MY_INFO.id,
|
||||||
|
password : $("#change-password input[name='password']").val()
|
||||||
|
},
|
||||||
|
success : (resp) => {
|
||||||
|
if(resp.saved){
|
||||||
|
dialog.alert("비밀번호 변경에 성공하였습니다.");
|
||||||
|
dialog.close("changePasswordDialog");
|
||||||
|
} else {
|
||||||
|
dialog.alert("비밀번호 변경에 실패하였습니다.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
--%>
|
||||||
|
//# sourceURL=password.jsp
|
||||||
|
</script>
|
@ -1,49 +1,48 @@
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* 그리드 내부 이미지 첨부
|
* 그리드 내부 이미지 첨부
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
function fnMakeGridImageViewer(tdEls, fileInputElName){
|
function fnMakeGridImageViewer(tdEl, fileInputElName){
|
||||||
|
|
||||||
for(let tdEl of tdEls){
|
|
||||||
|
|
||||||
let fileInputEl = document.createElement("input");
|
|
||||||
fileInputEl.name = fileInputElName;
|
|
||||||
fileInputEl.type = "file";
|
|
||||||
fileInputEl.setAttribute("hidden","hidden");
|
|
||||||
fileInputEl.setAttribute("accept","image/*")
|
|
||||||
tdEl.appendChild(fileInputEl);
|
|
||||||
|
|
||||||
let uploadButtonEl = document.createElement("button");
|
let fileInputEl = document.createElement("input");
|
||||||
uploadButtonEl.type = "button";
|
fileInputEl.name = fileInputElName;
|
||||||
uploadButtonEl.classList.add("btn","btn-primary","w-px-50", "mx-1");
|
fileInputEl.type = "file";
|
||||||
uploadButtonEl.textContent = "등록";
|
fileInputEl.setAttribute("hidden","hidden");
|
||||||
tdEl.appendChild(uploadButtonEl);
|
fileInputEl.setAttribute("accept","image/*")
|
||||||
|
tdEl.appendChild(fileInputEl);
|
||||||
let viewButtonEl = document.createElement("button");
|
|
||||||
viewButtonEl.type = "button";
|
let uploadButtonEl = document.createElement("button");
|
||||||
viewButtonEl.classList.add("btn","btn-primary","w-px-50", "mx-1");
|
uploadButtonEl.type = "button";
|
||||||
viewButtonEl.setAttribute("hidden","hidden");
|
uploadButtonEl.classList.add("btn","btn-primary","w-px-50", "mx-1");
|
||||||
viewButtonEl.textContent = "보기";
|
uploadButtonEl.textContent = "등록";
|
||||||
tdEl.appendChild(viewButtonEl);
|
tdEl.appendChild(uploadButtonEl);
|
||||||
|
|
||||||
$(fileInputEl).on("change", function(){
|
let viewButtonEl = document.createElement("button");
|
||||||
if(this.files != null && this.files.length > 0){
|
viewButtonEl.type = "button";
|
||||||
$(uploadButtonEl).text("수정");
|
viewButtonEl.classList.add("btn","btn-primary","w-px-50", "mx-1");
|
||||||
$(viewButtonEl).removeAttr("hidden");
|
viewButtonEl.setAttribute("hidden","hidden");
|
||||||
} else {
|
viewButtonEl.textContent = "보기";
|
||||||
$(uploadButtonEl).text("등록");
|
tdEl.appendChild(viewButtonEl);
|
||||||
$(viewButtonEl).attr("hidden","hidden");
|
|
||||||
}
|
$(fileInputEl).on("change", function(){
|
||||||
});
|
if(this.files != null && this.files.length > 0){
|
||||||
|
$(uploadButtonEl).text("수정");
|
||||||
|
$(viewButtonEl).removeAttr("hidden");
|
||||||
|
} else {
|
||||||
|
$(uploadButtonEl).text("등록");
|
||||||
|
$(viewButtonEl).attr("hidden","hidden");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(uploadButtonEl).on("click", function(){
|
||||||
|
$(fileInputEl).click();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(viewButtonEl).on("click", function(){
|
||||||
|
|
||||||
$(uploadButtonEl).on("click", function(){
|
let viewUrl = (window.URL || window.webkitURL).createObjectURL(fileInputEl.files[0]);
|
||||||
$(fileInputEl).click();
|
|
||||||
});
|
|
||||||
|
|
||||||
$(viewButtonEl).on("click", function(){
|
window.open(viewUrl, "이미지", "width=500, height=500");
|
||||||
window.open((window.URL || window.webkitURL).createObjectURL(fileInputEl.files[0])
|
});
|
||||||
, "이미지"
|
|
||||||
, "width=500, height=500");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue