2020-10-12 14:39:23 +09:00
|
|
|
|
// Write your JavaScript code.
|
|
|
|
|
|
var capResult; //code, msg, obj
|
|
|
|
|
|
var isCaping = false;
|
|
|
|
|
|
var capOK = false;
|
|
|
|
|
|
var capResultObj;
|
|
|
|
|
|
var capResultMsg;
|
|
|
|
|
|
var isAutoMsg = false;
|
|
|
|
|
|
var _callback;
|
|
|
|
|
|
var fileclearid = "";
|
|
|
|
|
|
var rootUrl;
|
|
|
|
|
|
var _audio = new Audio();
|
|
|
|
|
|
var _soundselectorid, _soundiconid, _soundreplayid;
|
|
|
|
|
|
|
|
|
|
|
|
var _uploadeditorimageitem;
|
|
|
|
|
|
var _uploadeditorimagecallback;
|
|
|
|
|
|
var _uploadeditorimagertn;
|
|
|
|
|
|
var _callsounda;
|
|
|
|
|
|
var _ScrollTopId;
|
|
|
|
|
|
var _msgtemptime;
|
|
|
|
|
|
String.prototype.format = function () {
|
|
|
|
|
|
var formatted = this;
|
|
|
|
|
|
for (var i = 0; i < arguments.length; i++) {
|
|
|
|
|
|
var regexp = new RegExp('\\{' + i + '\\}', 'gi');
|
|
|
|
|
|
formatted = formatted.replace(regexp, arguments[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
return formatted;
|
|
|
|
|
|
};
|
|
|
|
|
|
function checkip(strIP) {
|
|
|
|
|
|
var expUrl = /^(1|2)?\d?\d([.](1|2)?\d?\d){3}$/;
|
|
|
|
|
|
return expUrl.test(strIP);
|
|
|
|
|
|
}
|
|
|
|
|
|
function checkpop() {
|
|
|
|
|
|
var cpop = open("", "checkpop", '');
|
|
|
|
|
|
if (cpop == null) {
|
|
|
|
|
|
msg("팝업이 차단되어 있습니다. 차단을 해제해 주세요.");
|
|
|
|
|
|
return false;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
cpop.close();
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function getnumarray(v, s) {
|
|
|
|
|
|
var n = [];
|
|
|
|
|
|
for (var i = 0; i < v.split(s).length; i++) {
|
|
|
|
|
|
n.push(getint(v.split(s)[i]));
|
|
|
|
|
|
}
|
|
|
|
|
|
return n;
|
|
|
|
|
|
}
|
|
|
|
|
|
function getarray(v, s) {
|
|
|
|
|
|
var n = [];
|
|
|
|
|
|
for (var i = 0; i < v.split(s).length; i++) {
|
|
|
|
|
|
n.push(v.split(s)[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
return n;
|
|
|
|
|
|
}
|
|
|
|
|
|
function checkIP(strIP) {
|
|
|
|
|
|
var expUrl = /^(1|2)?\d?\d([.](1|2)?\d?\d){3}$/;
|
|
|
|
|
|
return expUrl.test(strIP);
|
|
|
|
|
|
}
|
|
|
|
|
|
function ullidel(a) {
|
|
|
|
|
|
if ($(a).parents(".selectgroupulbox").find(".withhidedelitem").length > 0) {
|
|
|
|
|
|
$(a).parents(".selectgroupulbox").find(".withhidedelitem").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
if ($(a).parents(".selectgroupulbox").find(".withdelitem").length > 0) {
|
|
|
|
|
|
$(a).parents(".selectgroupulbox").find(".withdelitem").remove();
|
|
|
|
|
|
}
|
|
|
|
|
|
$(a).closest("li").remove();
|
|
|
|
|
|
}
|
|
|
|
|
|
function fillzero(v, padleft, len) {
|
|
|
|
|
|
v = v || "";
|
|
|
|
|
|
var v2 = v.toString();
|
|
|
|
|
|
if (v2.length < len) {
|
|
|
|
|
|
while (v2.length < len) {
|
|
|
|
|
|
v2 = padleft ? ('0' + v2) : (v2 + '0');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return v2;
|
|
|
|
|
|
}
|
|
|
|
|
|
function viewuser(uno, id, useGet) {
|
|
|
|
|
|
id = "viewuser" + uno;
|
|
|
|
|
|
useGet = useGet || false;
|
|
|
|
|
|
id = "cdduv" + (id || "");
|
|
|
|
|
|
if ($("body #frmcdduv").length > 0) {
|
|
|
|
|
|
$("body #frmcdduv").attr("target", id);
|
|
|
|
|
|
$("body #frmcdduv").attr("action", '/CDD/Uv');
|
|
|
|
|
|
$("body #frmcdduv #userno").val(uno);
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$("body").append("<form id=\"frmcdduv\" name=\"frmcdduv\" method=\"post\" action=\"/CDD/Uv\" target=\"" + id + "\"><input type=\"hidden\" name=\"IsFirstOpen\" value=\"true\" /><input type=\"hidden\" id=\"userno\" name=\"UserNo\" value=\"" + uno + "\" /></form>");
|
|
|
|
|
|
}
|
|
|
|
|
|
if (useGet) {
|
|
|
|
|
|
winopen('/CDD/Uv?UserNo='+uno, id, 1015, 600);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
winopen('', id, 1015, 600);
|
|
|
|
|
|
$("#frmcdduv").submit();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function rmsplit(v) {
|
|
|
|
|
|
return (v || "").toString().replace(/:/gi, '').replace(/;/gi, '').replace(/§/gi, '');
|
|
|
|
|
|
}
|
|
|
|
|
|
function msgtemp(m, t) {
|
|
|
|
|
|
$("#msgtemp").remove();
|
|
|
|
|
|
$("body.sitebody").append("<div id=\"msgtemp\" class=\"msgtemp\"><div>" + (m.toString() == "1" ? "저장해야 반영됩니다." : m) + "</div><div class=\"small\">클릭으로 닫기 | 4초후 자동닫힘</div></div>");
|
|
|
|
|
|
$("#msgtemp").css("top", event.pageY-50);
|
|
|
|
|
|
$("#msgtemp").css("left", event.pageX-50);
|
|
|
|
|
|
$("#msgtemp").slideToggle('fast');
|
|
|
|
|
|
clearTimeout(_msgtemptime);
|
|
|
|
|
|
_msgtemptime = setTimeout(function () {
|
|
|
|
|
|
$("#msgtemp").remove();
|
|
|
|
|
|
}, t || 4000);
|
|
|
|
|
|
}
|
|
|
|
|
|
function ismobile(phoneNum) {
|
|
|
|
|
|
var regExp = /(01[016789])([1-9]{1}[0-9]{2,3})([0-9]{4})$/;
|
|
|
|
|
|
var myArray;
|
|
|
|
|
|
if (regExp.test(phoneNum)) {
|
|
|
|
|
|
myArray = regExp.exec(phoneNum);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
regExp = /(01[016789])-([1-9]{1}[0-9]{2,3})-([0-9]{4})$/;
|
|
|
|
|
|
if (regExp.test(phoneNum)) {
|
|
|
|
|
|
myArray = regExp.exec(phoneNum);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function formatmobile(phoneNum) {
|
|
|
|
|
|
phoneNum = phoneNum.replace(/-/gi, '');
|
|
|
|
|
|
if (ismobile(phoneNum)) {
|
|
|
|
|
|
var rtnNum;
|
|
|
|
|
|
var regExp = /(01[016789])([1-9]{1}[0-9]{2,3})([0-9]{4})$/;
|
|
|
|
|
|
var myArray;
|
|
|
|
|
|
if (regExp.test(phoneNum)) {
|
|
|
|
|
|
myArray = regExp.exec(phoneNum); rtnNum = myArray[1] + '-' + myArray[2] + '-' + myArray[3]; return rtnNum;
|
|
|
|
|
|
} else { return phoneNum; }
|
|
|
|
|
|
} else { return phoneNum; }
|
|
|
|
|
|
}
|
|
|
|
|
|
function isphone(phoneNum) {
|
|
|
|
|
|
var regExp = /(02)([0-9]{3,4})([0-9]{4})$/;
|
|
|
|
|
|
var myArray;
|
|
|
|
|
|
if (regExp.test(phoneNum)) {
|
|
|
|
|
|
myArray = regExp.exec(phoneNum);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
regExp = /(0[3-9]{1}[0-9]{1})([0-9]{3,4})([0-9]{4})$/;
|
|
|
|
|
|
if (regExp.test(phoneNum)) {
|
|
|
|
|
|
myArray = regExp.exec(phoneNum);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
regExp = /(02)-([0-9]{3,4})-([0-9]{4})$/;
|
|
|
|
|
|
if (regExp.test(phoneNum)) {
|
|
|
|
|
|
myArray = regExp.exec(phoneNum);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
regExp = /(0[3-9]{1}[0-9]{1})-([0-9]{3,4})-([0-9]{4})$/;
|
|
|
|
|
|
if (regExp.test(phoneNum)) {
|
|
|
|
|
|
myArray = regExp.exec(phoneNum);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
} else { return false; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function formatphone(phoneNum) {
|
|
|
|
|
|
phoneNum = phoneNum.replace(/-/gi, '');
|
|
|
|
|
|
if (isphone(phoneNum)) {
|
|
|
|
|
|
var rtnNum;
|
|
|
|
|
|
var regExp = /(02)([0-9]{3,4})([0-9]{4})$/;
|
|
|
|
|
|
var myArray;
|
|
|
|
|
|
if (regExp.test(phoneNum)) { myArray = regExp.exec(phoneNum); rtnNum = myArray[1] + '-' + myArray[2] + '-' + myArray[3]; return rtnNum; }
|
|
|
|
|
|
else {
|
|
|
|
|
|
regExp = /(0[3-9]{1}[0-9]{1})([0-9]{3,4})([0-9]{4})$/;
|
|
|
|
|
|
if (regExp.test(phoneNum)) {
|
|
|
|
|
|
myArray = regExp.exec(phoneNum); rtnNum = myArray[1] + '-' + myArray[2] + '-' + myArray[3]; return rtnNum;
|
|
|
|
|
|
} else { return phoneNum; }
|
|
|
|
|
|
}
|
|
|
|
|
|
} else { return phoneNum; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function winopen(url, id, _w, _h, _scroll, _resizable, _status, _location, _top, _left) {
|
|
|
|
|
|
_w = _w || 800;
|
|
|
|
|
|
_h = _h || 500;
|
|
|
|
|
|
_scroll = _scroll || "yes";
|
|
|
|
|
|
_resizable = _resizable || "yes";
|
|
|
|
|
|
_status = _status || "yes";
|
|
|
|
|
|
_location = _location || "yes";
|
|
|
|
|
|
_top = _top || 50;
|
|
|
|
|
|
_left = _left || 50;
|
|
|
|
|
|
var wo = "width=" + _w + ", height=" + _h + ", scrollbars=" + _scroll + ", resizable=" + _resizable + ", status=" + _status + ", location=" + _location + ", left=" + _left + ", top=" + _top;
|
|
|
|
|
|
var _jswin = window.open('', id, wo);
|
|
|
|
|
|
if (_jswin == null) {
|
|
|
|
|
|
alert("팝업설정을 해제해주세요.");
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (url != '') {
|
|
|
|
|
|
_jswin.location.href = url;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function showfindbox(bid, fi) {
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
bid = bid || "";
|
|
|
|
|
|
if (bid != "") {
|
|
|
|
|
|
$("#" + bid).slideDown('fast');
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$(".findbox").slideDown('fast');
|
|
|
|
|
|
}
|
|
|
|
|
|
if ((fi || null) != null) {
|
|
|
|
|
|
$(fi).focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function hidefindbox(bid) {
|
|
|
|
|
|
bid = bid || "";
|
|
|
|
|
|
if (bid != "") {
|
|
|
|
|
|
$("#" + bid).slideUp('fast'); $('#bglayer').hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$(".findbox").slideUp('fast'); $('#bglayer').hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function guide(gid) {
|
|
|
|
|
|
gid = gid || "";
|
|
|
|
|
|
msg($("#guidedata" + gid).html());
|
|
|
|
|
|
}
|
|
|
|
|
|
function guide2(gid) {
|
|
|
|
|
|
gid = gid || "";
|
|
|
|
|
|
msg2($("#guidedata" + gid).html());
|
|
|
|
|
|
}
|
|
|
|
|
|
var _binddataid;
|
|
|
|
|
|
function binddata(id, data) {
|
|
|
|
|
|
id = id || _binddataid;
|
|
|
|
|
|
data = data || capResult.obj;
|
|
|
|
|
|
$.each($(data), function (i, d) {
|
|
|
|
|
|
$("#" + id).append("<option value=\"" + d.value + "\">" + d.text + "</option>");
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function getliv(ulid) {
|
|
|
|
|
|
var v = "";
|
|
|
|
|
|
$.each($("#" + ulid + " li"), function (i, d) {
|
|
|
|
|
|
v += "," + $(d).attr("data-no");
|
|
|
|
|
|
});
|
|
|
|
|
|
return v == "" ? v : v.substr(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
function binddatacheck(id, data) {
|
|
|
|
|
|
data = data || "";
|
|
|
|
|
|
if (data == "") {
|
|
|
|
|
|
if (capResult.code == 1000 && capResult.obj != null && capResult.obj.length > 0) {
|
|
|
|
|
|
$.each($(capResult.obj), function (i, d) {
|
|
|
|
|
|
$("#" + id).append("<option value=\"" + d.value + "\">" + d.text + "</option>");
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
$.each($(data), function (i, d) {
|
|
|
|
|
|
$("#" + id).append("<option value=\"" + d.value + "\">" + d.text + "</option>");
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function ispop() {
|
|
|
|
|
|
try {
|
|
|
|
|
|
return parent.ismainlayout == 1 || parent.ispopuplayout == 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (e) { }
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function msgadmin() {
|
|
|
|
|
|
msg("운영자에게 문의해주세요.");
|
|
|
|
|
|
}
|
|
|
|
|
|
function msgdev(is2, isbg) {
|
|
|
|
|
|
is2 = is2 || false;
|
|
|
|
|
|
isbg = isbg || false;
|
|
|
|
|
|
if (is2) {
|
|
|
|
|
|
msg2("개발담당자에게 문의해주세요..");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
msg("개발담당자에게 문의해주세요..");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function msgadmin2(m) {
|
|
|
|
|
|
$("#layermessage2 a.mainokbutton2").unbind("click");
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
bglayer2();
|
|
|
|
|
|
msglayer2(m || "운영자에게 문의해주세요.");
|
|
|
|
|
|
}, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
function nulltozero(v) {
|
|
|
|
|
|
return v == null || v == "" ? 0 : v;
|
|
|
|
|
|
}
|
|
|
|
|
|
function isnull(v) {
|
|
|
|
|
|
return v == null;
|
|
|
|
|
|
}
|
|
|
|
|
|
function nulloremttov(v, dv) {
|
|
|
|
|
|
return v == null || v == "" ? dv : v;
|
|
|
|
|
|
}
|
|
|
|
|
|
function isnulloremt(v) {
|
|
|
|
|
|
return v == null || v == "";
|
|
|
|
|
|
}
|
|
|
|
|
|
function nulltoemt(v) {
|
|
|
|
|
|
return v || "";
|
|
|
|
|
|
}
|
|
|
|
|
|
function getdb(v, norpspliter, nullto) {
|
|
|
|
|
|
nullto = nullto || "";
|
|
|
|
|
|
if (v != 0 || v == "") {
|
|
|
|
|
|
if ((norpspliter || false)) {
|
|
|
|
|
|
return (v || nullto).toString();
|
|
|
|
|
|
}
|
|
|
|
|
|
return (v || nullto).toString().replace(/:/gi, '').replace(/;/gi, '');
|
|
|
|
|
|
}
|
|
|
|
|
|
return "0";
|
|
|
|
|
|
}
|
|
|
|
|
|
function callsound(url, a) {
|
|
|
|
|
|
_callsounda = a;
|
|
|
|
|
|
_audio.src = url;
|
|
|
|
|
|
_audio.play();
|
|
|
|
|
|
$(a).parent().find("a.stop").show(); $(a).hide();
|
|
|
|
|
|
_audio.onended = function () {
|
|
|
|
|
|
$(_callsounda).parent().find("a.play").show(); $(a).hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function stopsound(a) {
|
|
|
|
|
|
_audio.pause();
|
|
|
|
|
|
$(a).parent().find("a.play").show(); $(a).hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
function msgerror(isadmin) {
|
|
|
|
|
|
isadmin = isadmin || false;
|
|
|
|
|
|
msg((isadmin ? "운영자에게":"시스템관리자") + "에게 문의해주세요.");
|
|
|
|
|
|
}
|
|
|
|
|
|
function uploadeditorimage(files, el, fdata, _callback, _url) {
|
|
|
|
|
|
_url = _url || '/aCommon/UploadEditorImageUrl';
|
|
|
|
|
|
_uploadeditorimagecallback = _callback;
|
|
|
|
|
|
_uploadeditorimageitem = el;
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
data: fdata,
|
|
|
|
|
|
type: "POST",
|
|
|
|
|
|
url: _url,
|
|
|
|
|
|
cache: false,
|
|
|
|
|
|
contentType: false,
|
|
|
|
|
|
processData: false,
|
|
|
|
|
|
success: function (result) {
|
|
|
|
|
|
//_uploadeditorimagertn = JSON.parse(result);
|
|
|
|
|
|
_uploadeditorimagertn = result;
|
|
|
|
|
|
eval(_uploadeditorimagecallback.substr(_uploadeditorimagecallback.length - 1, 1) == ")" ? _uploadeditorimagecallback : (_uploadeditorimagecallback + "()"));
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function rcchange(s) {
|
|
|
|
|
|
$("#" + $(s).attr("data-tbodyid")).find("tr").remove();
|
|
|
|
|
|
if ($(s).attr("data-scmethod") != "") {
|
|
|
|
|
|
eval($(s).attr("data-scmethod"));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
|
|
|
|
|
|
/** 로딩이미지 보여주기 */
|
|
|
|
|
|
function showLoadingImage() {
|
|
|
|
|
|
// 이미 존재하는 경우 중복 생성 방지
|
|
|
|
|
|
if (document.getElementById('custom-loading-overlay')) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 로딩 이미지 요소 생성
|
|
|
|
|
|
const loadingDiv = document.createElement('div');
|
|
|
|
|
|
loadingDiv.id = 'custom-loading-overlay';
|
|
|
|
|
|
|
|
|
|
|
|
// 인라인 스타일 대신 클래스 사용을 위한 스타일 추가
|
|
|
|
|
|
const style = document.createElement('style');
|
|
|
|
|
|
style.textContent = `
|
|
|
|
|
|
#custom-loading-overlay {
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
z-index: 9999;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#custom-loading-spinner {
|
|
|
|
|
|
width: 40px;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
border-radius: 100%;
|
|
|
|
|
|
-webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
|
|
|
|
|
|
animation: sk-scaleout 1.0s infinite ease-in-out;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@-webkit-keyframes sk-scaleout {
|
|
|
|
|
|
0% { -webkit-transform: scale(0) }
|
|
|
|
|
|
100% { -webkit-transform: scale(1.0); opacity: 0; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@keyframes sk-scaleout {
|
|
|
|
|
|
0% { transform: scale(0); -webkit-transform: scale(0); }
|
|
|
|
|
|
100% { transform: scale(1.0); -webkit-transform: scale(1.0); opacity: 0; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 애니메이션 미지원 브라우저용 대체 스타일 */
|
|
|
|
|
|
.no-animation #custom-loading-spinner {
|
|
|
|
|
|
background-color: #3498db;
|
|
|
|
|
|
border: 5px solid #f3f3f3;
|
|
|
|
|
|
}
|
|
|
|
|
|
`;
|
|
|
|
|
|
document.head.appendChild(style);
|
|
|
|
|
|
|
|
|
|
|
|
// 브라우저 애니메이션 지원 확인
|
|
|
|
|
|
const supportsAnimation = 'AnimationEvent' in window ||
|
|
|
|
|
|
'WebKitAnimationEvent' in window ||
|
|
|
|
|
|
'MozAnimationEvent' in window ||
|
|
|
|
|
|
'msAnimationEvent' in window ||
|
|
|
|
|
|
'OAnimationEvent' in window;
|
|
|
|
|
|
|
|
|
|
|
|
// 기본 로딩 스피너
|
|
|
|
|
|
const spinnerDiv = document.createElement('div');
|
|
|
|
|
|
spinnerDiv.id = 'custom-loading-spinner';
|
|
|
|
|
|
|
|
|
|
|
|
// 애니메이션을 지원하지 않는 브라우저에는 정적 스타일 적용
|
|
|
|
|
|
if (!supportsAnimation) {
|
|
|
|
|
|
loadingDiv.className = 'no-animation';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
loadingDiv.appendChild(spinnerDiv);
|
|
|
|
|
|
document.body.appendChild(loadingDiv);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** 로딩이미지 제거 */
|
|
|
|
|
|
function hideLoadingImage() {
|
|
|
|
|
|
const loadingDiv = document.getElementById('custom-loading-overlay');
|
|
|
|
|
|
if (loadingDiv) {
|
|
|
|
|
|
// 스타일 요소도 정리
|
|
|
|
|
|
const style = document.querySelector('style[id^="custom-loading-style"]');
|
|
|
|
|
|
if (style) {
|
|
|
|
|
|
document.head.removeChild(style);
|
|
|
|
|
|
}
|
|
|
|
|
|
document.body.removeChild(loadingDiv);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
|
function ajaxing(tf) {
|
|
|
|
|
|
if (!_jsislayer2) {
|
|
|
|
|
|
bglayer(false);
|
|
|
|
|
|
$("#bgprogress").hide();
|
|
|
|
|
|
if (tf == null || tf === true) {
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
$("#bgprogress").show();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
bglayer2(false);
|
|
|
|
|
|
if (tf == null || tf === true) {
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function bglayer(tf, nobging) {
|
|
|
|
|
|
nobging = nobging || false;
|
|
|
|
|
|
if (tf == null || tf === true || (!nobging && _bging)) {
|
|
|
|
|
|
$("#bglayer").show();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$("#bglayer").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function bglayer2(tf) {
|
|
|
|
|
|
if (tf == null || tf === true) {
|
|
|
|
|
|
$("#bglayer2").show();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$("#bglayer2").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function msgok(sd, m, hidemb) {
|
|
|
|
|
|
m = m || "";
|
|
|
|
|
|
hidemb = hidemb || false;
|
|
|
|
|
|
if (hidemb) {
|
|
|
|
|
|
$(".mainokbutton,.mainokbutton2").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
msg((sd == 0 ? "삭제되었습니다." : sd == 1 ? "저장되었습니다." : sd == -1 ? "권한이 없습니다.": sd == 2 ? "변경되었습니다." :"?") + m);
|
|
|
|
|
|
}
|
|
|
|
|
|
function msgok2(sd, m, hidemb) {
|
|
|
|
|
|
m = m || "";
|
|
|
|
|
|
hidemb = hidemb || false;
|
|
|
|
|
|
if (hidemb) {
|
|
|
|
|
|
$(".mainokbutton,.mainokbutton2").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
msg2((sd == 0 ? "삭제되었습니다." : sd == 1 ? "저장되었습니다." : sd == -1 ? "권한이 없습니다." : sd == 2 ? "변경되었습니다." : "?") + m);
|
|
|
|
|
|
}
|
|
|
|
|
|
var _sitejsform;
|
|
|
|
|
|
function rfs(timeout, form) {
|
|
|
|
|
|
timeout = timeout || 0;
|
|
|
|
|
|
_sitejsform = form || "";
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
if (_sitejsform == "") {
|
|
|
|
|
|
location.href = location.href.replace(/#/gi, '');
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$("#" + _sitejsform).submit();
|
|
|
|
|
|
}
|
|
|
|
|
|
}, timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
function getv(id) {
|
|
|
|
|
|
return $.trim($("#" + id).val() || "");
|
|
|
|
|
|
}
|
|
|
|
|
|
function getrv(name) {
|
|
|
|
|
|
return $("input[name='" + name + "']:checked").length < 1 ? "" : $("input[name='" + name + "']:checked").val();
|
|
|
|
|
|
}
|
|
|
|
|
|
function getcheckv(name) {
|
|
|
|
|
|
var rtn = "";
|
|
|
|
|
|
$.each($("input[name='" + name + "']"), function (i, c) {
|
|
|
|
|
|
if ($(c).prop("checked")) {
|
|
|
|
|
|
rtn += "," + $(c).val();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
return rtn == "" ? "" : rtn.substr(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
function getcheck(id, isString) {
|
|
|
|
|
|
isString = isString || false;
|
|
|
|
|
|
if (!isString) {
|
|
|
|
|
|
return $("#" + id).prop("checked") ? 1 : 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
return ($("#" + id).prop("checked") ? 1 : 0).toString();
|
|
|
|
|
|
}
|
|
|
|
|
|
function refreshmenu() {
|
|
|
|
|
|
if (confirm("메뉴권한을 새로 바인딩하시겠습니까?")) {
|
|
|
|
|
|
capp("/acommon/MENURESET", {}, "cbMENURESET");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function cbMENURESET() {
|
|
|
|
|
|
if (capResult.code === 1000) {
|
|
|
|
|
|
location.href = location.href.replace(/#/gi, '');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function golist(t, hideok) {
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
hideok = hideok || false;
|
|
|
|
|
|
if (hideok) {
|
|
|
|
|
|
$("a.mainokbutton").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
t = t || 200;
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
$("#dform").submit();
|
|
|
|
|
|
}, t);
|
|
|
|
|
|
}
|
|
|
|
|
|
function isCapOK() {
|
|
|
|
|
|
return capResult.code == 1000;
|
|
|
|
|
|
}
|
|
|
|
|
|
function clearFile() {
|
|
|
|
|
|
//$("#" + fileclearid).fileinput("cancel");
|
|
|
|
|
|
//$("#" + fileclearid).fileinput("refresh");
|
|
|
|
|
|
//$("#" + fileclearid).fileinput("clear");
|
|
|
|
|
|
$("input.file").fileinput("cancel");
|
|
|
|
|
|
$("input.file").fileinput("refresh");
|
|
|
|
|
|
$("input.file").fileinput("clear");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var _focusitem;
|
|
|
|
|
|
//var _focusitem2;
|
|
|
|
|
|
function msgf(m, f) {
|
|
|
|
|
|
msg(m);
|
|
|
|
|
|
//$("#layermessage a.mainokbutton").unbind("click");
|
|
|
|
|
|
$("#layermessage a.mainokbutton").on("click", function () {
|
|
|
|
|
|
eval(f);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function msgf2(m, f) {
|
|
|
|
|
|
msg2(m);
|
|
|
|
|
|
//$("a.mainokbutton2").unbind("click");
|
|
|
|
|
|
$("a.mainokbutton2").on("click", function () {
|
|
|
|
|
|
eval(f);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function msg(m, t, bging, fi, hidemb, cb) {
|
|
|
|
|
|
hidemb = hidemb || false;
|
|
|
|
|
|
cb = cb || "";
|
|
|
|
|
|
if (hidemb) {
|
|
|
|
|
|
$(".mainokbutton, .mainokbutton2").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
_focusitem = (fi || "") == "" ? $("input:focus, select:focus, textarea:focus") : $(fi);
|
|
|
|
|
|
$("#layermessage a.mainokbutton").unbind("click");
|
|
|
|
|
|
$("#layermessage a.mainokbutton").on("click", function () {
|
|
|
|
|
|
if (cb == "" && _focusitem != "") {
|
|
|
|
|
|
$(_focusitem).focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
eval(cb);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
t = t || 0;
|
|
|
|
|
|
bging = bging || false;
|
|
|
|
|
|
if ($("#layermessage a.mainokbutton").length > 0) {
|
|
|
|
|
|
$("#layermessage a.mainokbutton").focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
msglayer(m, bging);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
var msg2cb;
|
|
|
|
|
|
function msg2(m, t, fi, cb, hidemb) {
|
|
|
|
|
|
msg2cb = cb || "";
|
|
|
|
|
|
hidemb = hidemb || false;
|
|
|
|
|
|
//_focusitem2 = (fi || "") == "" ? $("input:focus, select:focus, textarea:focus") : $(fi);
|
|
|
|
|
|
_focusitem = (fi || "") == "" ? $("input:focus, select:focus, textarea:focus") : $(fi);
|
|
|
|
|
|
if (hidemb) {
|
|
|
|
|
|
$("#layermessage2 a.mainokbutton2").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#layermessage2 a.mainokbutton2").on("click", function () {
|
|
|
|
|
|
$("#layermessage2 a.mainokbutton2").unbind("click");
|
|
|
|
|
|
if (msg2cb == "") {
|
|
|
|
|
|
//$(_focusitem2 || _focusitem).focus();
|
|
|
|
|
|
$(_focusitem).focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
eval(msg2cb);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
t = t || 10;
|
|
|
|
|
|
if ($("#layermessage2 a.mainokbutton2").length > 0) {
|
|
|
|
|
|
$("#layermessage2 a.mainokbutton2").focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
bglayer2();
|
|
|
|
|
|
msglayer2(m);
|
|
|
|
|
|
}, t);
|
|
|
|
|
|
}
|
|
|
|
|
|
var _bging;
|
|
|
|
|
|
function msglayer(msg, bging) {
|
|
|
|
|
|
_bging = bging;
|
|
|
|
|
|
if (msg.indexOf('<') < 0 || msg.indexOf('>') < 0) {
|
|
|
|
|
|
$("#layermessage div.msg").html("- " + msg + " -");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
$("#layermessage div.msg").html(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#bglayer").show();
|
|
|
|
|
|
$("#layermessage").slideToggle("fast");
|
|
|
|
|
|
$("#layermessage a.mainokbutton").focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
function msglayer2(msg) {
|
|
|
|
|
|
if (msg.indexOf('<') < 0) {
|
|
|
|
|
|
$("#layermessage2 div.msg").html("- " + msg + " -");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
$("#layermessage2 div.msg").html(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#bglayer2, #layermessage2").show();
|
|
|
|
|
|
$("#layermessage2 a.mainokbutton2").focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
function hidelayermsg() {
|
|
|
|
|
|
ajaxing(_bging);
|
|
|
|
|
|
$("#layermessage").hide();
|
|
|
|
|
|
if (!_bging) {
|
|
|
|
|
|
$("#bglayer").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$("#bgprogress").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function hidelayermsg2(remainbg) {
|
|
|
|
|
|
remainbg = remainbg || false;
|
|
|
|
|
|
$("#layermessage2").hide();
|
|
|
|
|
|
if (!remainbg) {
|
|
|
|
|
|
$("#bglayer2").hide();
|
|
|
|
|
|
if ($(".findbox:visible").length < 1) {
|
|
|
|
|
|
$("#bglayer").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function prv() {
|
|
|
|
|
|
try {
|
|
|
|
|
|
if (event.preventDefault) {
|
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (ex) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
ffEvent.preventDefault();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (ex2) { var exceptionmsg = ex2; }
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function hidemenu(di) {
|
|
|
|
|
|
var cdi = $(".nav-left ul li[data-id=" + di + "]");
|
|
|
|
|
|
cdi.removeClass("lmenu-opened");
|
|
|
|
|
|
if ($(cdi).hasClass("lmenu-parent")) {
|
|
|
|
|
|
$(cdi).find("span.glyphicon").removeClass("glyphicon-minus-sign").addClass("glyphicon-plus-sign");
|
|
|
|
|
|
}
|
|
|
|
|
|
$.each($(".nav-left ul li[data-pid=" + di + "]"), function (i, r) {
|
|
|
|
|
|
$(r).hide();
|
|
|
|
|
|
if ($(r).hasClass("lmenu-parent")) {
|
|
|
|
|
|
$(r).find("span.glyphicon").removeClass("glyphicon-minus-sign").addClass("glyphicon-plus-sign");
|
|
|
|
|
|
}
|
|
|
|
|
|
if ($(r).hasClass("lmenu-opened")) {
|
|
|
|
|
|
hidemenu($(r).attr("data-id"));
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function showmenu(di) {
|
|
|
|
|
|
var cdi = $(".nav-left ul li[data-id=" + di + "]");
|
|
|
|
|
|
cdi.addClass("lmenu-opened");
|
|
|
|
|
|
if ($(cdi).hasClass("lmenu-parent")) {
|
|
|
|
|
|
$(cdi).find("span.glyphicon").removeClass("glyphicon-plus-sign").addClass("glyphicon-minus-sign");
|
|
|
|
|
|
}
|
|
|
|
|
|
$.each($(".nav-left ul li[data-pid=" + di + "]"), function (i, r) {
|
|
|
|
|
|
$(r).show();
|
|
|
|
|
|
//if ($(r).hasClass("lmenu-parent")) {
|
|
|
|
|
|
// $(r).find("span.glyphicon").removeClass("glyphicon-plus-sign").addClass("glyphicon-minus-sign");
|
|
|
|
|
|
//}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function hideli(ulid, di) {
|
|
|
|
|
|
var cdi = $("ul#" + ulid + " li[data-id=" + di + "]");
|
|
|
|
|
|
cdi.removeClass("opened");
|
|
|
|
|
|
if ($(cdi).hasClass("isparent")) {
|
|
|
|
|
|
$(cdi).find("span.glyphicon").removeClass("glyphicon-minus-sign").addClass("glyphicon-plus-sign");
|
|
|
|
|
|
}
|
|
|
|
|
|
$.each($("ul#" + ulid + " li[data-pid=" + di + "]"), function (i, r) {
|
|
|
|
|
|
$(r).hide();
|
|
|
|
|
|
if ($(r).hasClass("isparent")) {
|
|
|
|
|
|
$(r).find("span.glyphicon").removeClass("glyphicon-minus-sign").addClass("glyphicon-plus-sign");
|
|
|
|
|
|
hideli(ulid, $(r).attr("data-id"));
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function showli(ulid, di) {
|
|
|
|
|
|
var cdi = $("ul#" + ulid + " li[data-id=" + di + "]");
|
|
|
|
|
|
cdi.addClass("opened");
|
|
|
|
|
|
if ($(cdi).hasClass("isparent")) {
|
|
|
|
|
|
$(cdi).find("span.glyphicon").removeClass("glyphicon-plus-sign").addClass("glyphicon-minus-sign");
|
|
|
|
|
|
}
|
|
|
|
|
|
$.each($("ul#" + ulid + " li[data-pid=" + di + "]"), function (i, r) {
|
|
|
|
|
|
$(r).removeClass("hidden");
|
|
|
|
|
|
$(r).show();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function checkInt(id, focus, m) {
|
|
|
|
|
|
m = m || "";
|
|
|
|
|
|
if ($("#" + id).length < 1 || $.trim($("#" + id).val()) == "" || getBytes($.trim($("#" + id).val())) < 1 || getint(val(id)) == 0) {
|
|
|
|
|
|
if ($("#" + (id || focus)).length > 0) {
|
|
|
|
|
|
$("#" + (id || focus)).focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (m != "") {
|
|
|
|
|
|
msg(m);
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function check(id, focus, m, ism2, passzero) {
|
|
|
|
|
|
passzero = passzero || false;
|
|
|
|
|
|
ism2 = ism2 || false;
|
|
|
|
|
|
m = m || "";
|
|
|
|
|
|
if ($("#" + id).length < 1 || $.trim($("#" + id).val()) == "" || (!passzero && $.trim($("#" + id).val()) == "0") || getBytes($.trim($("#" + id).val())) < 1) {
|
|
|
|
|
|
if ($("#" + (focus || id)).length > 0) {
|
|
|
|
|
|
if ($("#" + (focus || id)).hasClass("datepicker-input")) {
|
|
|
|
|
|
$("#" + (focus || id)).next("i").focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$("#" + (focus || id)).focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (m != "") {
|
|
|
|
|
|
if (ism2) {
|
|
|
|
|
|
msg2(m);
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
msg(m);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function checkn(id, focus, m) {
|
|
|
|
|
|
m = m || "";
|
|
|
|
|
|
if ($("#" + id).length < 1 || $.trim($("#" + id).val()) === "" || getBytes($.trim($("#" + id).val())) < 1 || getint(getv(id)) < 1) {
|
|
|
|
|
|
if ($("#" + (id || focus)).length > 0) {
|
|
|
|
|
|
$("#" + (id || focus)).focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (m != "") {
|
|
|
|
|
|
msg(m);
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function checkrv(name, focus, m, ism2) {
|
|
|
|
|
|
ism2 = ism2 || false;
|
|
|
|
|
|
m = m || "";
|
|
|
|
|
|
if ($("input[name='" + name + "']:checked").length < 1) {
|
|
|
|
|
|
$("input[name='" + name + "']").first().focus();
|
|
|
|
|
|
if ((focus || "") != "") {
|
|
|
|
|
|
$("#" + focus).focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (m != "") {
|
|
|
|
|
|
if (ism2) {
|
|
|
|
|
|
msg2(m);
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
msg(m);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function valnull(id) {
|
|
|
|
|
|
if ($("#" + id).length < 1 || $.trim($("#" + id).val()) == "") {
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
return $("#" + id).val();
|
|
|
|
|
|
}
|
|
|
|
|
|
function val(id) {
|
|
|
|
|
|
if ($("#" + id).length < 1) {
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
return $.trim($("#" + id).val());
|
|
|
|
|
|
}
|
|
|
|
|
|
function vals(els, sepa) {
|
|
|
|
|
|
sepa = sepa || "";
|
|
|
|
|
|
var rtn = "";
|
|
|
|
|
|
$.each(els, function (i, r) {
|
|
|
|
|
|
rtn += sepa + ($(r).val() || "");
|
|
|
|
|
|
});
|
|
|
|
|
|
return rtn == "" ? rtn : rtn.substr(sepa.length);
|
|
|
|
|
|
}
|
|
|
|
|
|
function intval(id) {
|
|
|
|
|
|
if ($("#" + id).length < 1) {
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
var v = $.trim($("#" + id).val()).replace(/,/gi, '');
|
|
|
|
|
|
if (isNaN(parseInt(v, 10))) {
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
|
|
|
return parseInt($.trim(v), 10);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (e) { return 0; }
|
|
|
|
|
|
}
|
|
|
|
|
|
function getint(v) {
|
|
|
|
|
|
v = v == null ? 0 : v;
|
|
|
|
|
|
v = $.trim(v.toString());
|
|
|
|
|
|
var isminus = v.length > 0 && v.substr(0, 1) == "-";
|
|
|
|
|
|
v = v.replace(/,/gi, '').replace(/-/gi, '');
|
|
|
|
|
|
if (isNaN(parseInt(v, 10)))
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
if (isminus) {
|
|
|
|
|
|
return -1 * parseInt(v, 10);
|
|
|
|
|
|
}
|
|
|
|
|
|
return parseInt(v, 10);
|
|
|
|
|
|
}
|
|
|
|
|
|
function getDouble(v) {
|
|
|
|
|
|
v = v == null ? 0 : v;
|
|
|
|
|
|
v = v.toString();
|
|
|
|
|
|
v = v.replace(/,/gi, '');
|
|
|
|
|
|
if (isNaN(parseFloat(v)))
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
return parseFloat(v);
|
|
|
|
|
|
}
|
|
|
|
|
|
var capfilecallback;
|
|
|
|
|
|
var _setBG = false;
|
|
|
|
|
|
var _abscaller = false;
|
|
|
|
|
|
var _bgprogressid;
|
|
|
|
|
|
function prg(id) {
|
|
|
|
|
|
_bgprogressid = id;
|
|
|
|
|
|
$("#bglayer" + _bgprogressid + " .progress").show();
|
|
|
|
|
|
}
|
|
|
|
|
|
function prgstop() {
|
|
|
|
|
|
$("#bglayer .progress, #bglayer2 .progress").hide();
|
|
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
function capfile(url, data, callback, noeval, setBG, jsislayer2) {
|
|
|
|
|
|
// 로딩바 표시 추가
|
|
|
|
|
|
showLoadingImage();
|
|
|
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
|
noeval = noeval || false;
|
|
|
|
|
|
_jsislayer2 = jsislayer2 || false;
|
|
|
|
|
|
_setBG = setBG || false;
|
2025-04-03 13:57:19 +09:00
|
|
|
|
// 백그라운드 레이어 표시
|
2020-10-12 14:39:23 +09:00
|
|
|
|
if (_setBG) {
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (_jsislayer2) {
|
|
|
|
|
|
bglayer2();
|
|
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
// iOS 호환성을 위한 처리
|
|
|
|
|
|
// FormData 객체 확인 및 필요시 수정
|
|
|
|
|
|
if (data instanceof FormData) {
|
|
|
|
|
|
// iOS에서 FormData 디버깅을 위한 로그 (개발 중에만 사용)
|
|
|
|
|
|
console.log("FormData 항목 수:", [...data.entries()].length);
|
|
|
|
|
|
}
|
|
|
|
|
|
// 콜백 함수 실행 헬퍼
|
|
|
|
|
|
function executeCallback(result) {
|
|
|
|
|
|
// 로딩바 숨김 추가
|
|
|
|
|
|
hideLoadingImage();
|
|
|
|
|
|
|
|
|
|
|
|
if (_setBG) {
|
|
|
|
|
|
$("#bglayer").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (noeval) {
|
|
|
|
|
|
// 함수 객체로 직접 호출
|
|
|
|
|
|
if (typeof callback === 'function') {
|
|
|
|
|
|
callback(result);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
// 기존 방식 유지 (eval 사용)
|
|
|
|
|
|
// 보안상 권장되지 않지만 기존 코드 호환성 유지
|
|
|
|
|
|
try {
|
|
|
|
|
|
window.capResult = result; // 전역 변수로 결과 저장
|
|
|
|
|
|
if (typeof callback === 'string') {
|
|
|
|
|
|
if (callback.substr(callback.length - 1, 1) == ")") {
|
|
|
|
|
|
eval(callback);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
eval(callback + "()");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.error("콜백 실행 오류:", e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-10-12 14:39:23 +09:00
|
|
|
|
var ajaxRequest = $.ajax({
|
|
|
|
|
|
type: "POST",
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
contentType: false,
|
|
|
|
|
|
processData: false,
|
2025-04-03 13:57:19 +09:00
|
|
|
|
data: data,
|
|
|
|
|
|
timeout: 60000,
|
|
|
|
|
|
xhr: function () {
|
|
|
|
|
|
var xhr = $.ajaxSettings.xhr();
|
|
|
|
|
|
// 업로드 진행 상황 모니터링 (iOS에서 파일 업로드 진행 확인)
|
|
|
|
|
|
if (xhr.upload) {
|
|
|
|
|
|
xhr.upload.addEventListener('progress', function (e) {
|
|
|
|
|
|
if (e.lengthComputable) {
|
|
|
|
|
|
var percent = Math.round((e.loaded / e.total) * 100);
|
|
|
|
|
|
console.log("업로드 진행률: " + percent + "%");
|
|
|
|
|
|
}
|
|
|
|
|
|
}, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
return xhr;
|
|
|
|
|
|
}
|
2020-10-12 14:39:23 +09:00
|
|
|
|
});
|
2025-04-03 13:57:19 +09:00
|
|
|
|
// 에러 처리
|
|
|
|
|
|
ajaxRequest.fail(function (jqXHR, textStatus, errorThrown) {
|
|
|
|
|
|
console.error("Ajax 요청 실패:", textStatus, errorThrown);
|
|
|
|
|
|
// 타임아웃인 경우 별도 처리
|
|
|
|
|
|
if (textStatus === "timeout") {
|
|
|
|
|
|
alert("요청 시간이 초과되었습니다. 다시 시도해 주세요.");
|
|
|
|
|
|
// 로딩바 숨김 추가 (타임아웃 시)
|
|
|
|
|
|
hideLoadingImage();
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
|
|
|
|
|
else {
|
2025-04-03 13:57:19 +09:00
|
|
|
|
// 기존 에러 처리 로직 유지 (하지만 에러 시 다른 처리를 권장)
|
|
|
|
|
|
executeCallback({
|
|
|
|
|
|
code: -1,
|
|
|
|
|
|
message: "요청 처리 중 오류가 발생했습니다",
|
|
|
|
|
|
error: textStatus
|
|
|
|
|
|
});
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
|
|
|
|
|
});
|
2025-04-03 13:57:19 +09:00
|
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
|
ajaxRequest.done(function (data) {
|
2025-04-03 13:57:19 +09:00
|
|
|
|
if (data && data.code == 1000) {
|
|
|
|
|
|
executeCallback(data);
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
|
|
|
|
|
else {
|
2025-04-03 13:57:19 +09:00
|
|
|
|
console.warn("서버 응답 코드가 1000이 아닙니다:", data);
|
|
|
|
|
|
executeCallback(data);
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function capfileform(url, fid, callback, iseval, getpost, autoMsg, noBG, jsislayer2) {
|
|
|
|
|
|
_jsislayer2 = jsislayer2 || false;
|
|
|
|
|
|
if (!isCaping) {
|
2025-04-03 13:57:19 +09:00
|
|
|
|
// 로딩바 표시 추가
|
|
|
|
|
|
showLoadingImage();
|
|
|
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
|
isAutoMsg = autoMsg || false;
|
|
|
|
|
|
_bging = noBG || false;
|
2025-04-03 13:57:19 +09:00
|
|
|
|
if (!_bging) { ajaxing(); }
|
|
|
|
|
|
if (_jsislayer2) { bglayer2(); }
|
2020-10-12 14:39:23 +09:00
|
|
|
|
_callback = callback;
|
|
|
|
|
|
capResult = null;
|
|
|
|
|
|
capOK = false;
|
|
|
|
|
|
isCaping = true;
|
2025-04-03 13:57:19 +09:00
|
|
|
|
// 폼 요소 직접 참조
|
|
|
|
|
|
const form = document.getElementById(fid);
|
|
|
|
|
|
// iOS 호환성을 위한 FormData 생성 방식 개선
|
|
|
|
|
|
let formData;
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 기본 FormData 생성 시도
|
|
|
|
|
|
formData = new FormData(form);
|
|
|
|
|
|
// iOS 호환성 검사 - 파일 입력 필드 확인
|
|
|
|
|
|
const fileInputs = form.querySelectorAll('input[type="file"]');
|
|
|
|
|
|
let hasFiles = false;
|
|
|
|
|
|
fileInputs.forEach(input => {
|
|
|
|
|
|
if (input.files && input.files.length > 0) {
|
|
|
|
|
|
hasFiles = true;
|
|
|
|
|
|
// 파일 입력 필드 값이 제대로 FormData에 들어갔는지 확인
|
|
|
|
|
|
const fieldName = input.name || 'file';
|
|
|
|
|
|
if (!formData.has(fieldName)) {
|
|
|
|
|
|
console.log(`iOS 호환성: 수동으로 ${fieldName} 추가`);
|
|
|
|
|
|
// 수동으로 파일 추가
|
|
|
|
|
|
for (let i = 0; i < input.files.length; i++) {
|
|
|
|
|
|
formData.append(fieldName, input.files[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
// 디버깅용 로그
|
|
|
|
|
|
console.log('FormData 생성 완료:', hasFiles ? '파일 포함' : '파일 없음');
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
console.error('FormData 생성 오류:', error);
|
|
|
|
|
|
// 대체 방식으로 FormData 생성
|
|
|
|
|
|
formData = new FormData();
|
|
|
|
|
|
// 폼 필드 수동 추가
|
|
|
|
|
|
const formElements = form.elements;
|
|
|
|
|
|
for (let i = 0; i < formElements.length; i++) {
|
|
|
|
|
|
const field = formElements[i];
|
|
|
|
|
|
const name = field.name;
|
|
|
|
|
|
if (!name) continue;
|
|
|
|
|
|
if (field.type === 'file') {
|
|
|
|
|
|
for (let j = 0; j < field.files.length; j++) {
|
|
|
|
|
|
formData.append(name, field.files[j]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (field.type !== 'submit' && field.type !== 'button') {
|
|
|
|
|
|
formData.append(name, field.value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 네트워크 요청 타임아웃 설정
|
|
|
|
|
|
const ajaxTimeout = 60000; // 60초
|
2020-10-12 14:39:23 +09:00
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: getpost || "post",
|
|
|
|
|
|
url: url,
|
2025-04-03 13:57:19 +09:00
|
|
|
|
data: formData,
|
2020-10-12 14:39:23 +09:00
|
|
|
|
contentType: false,
|
|
|
|
|
|
processData: false,
|
2025-04-03 13:57:19 +09:00
|
|
|
|
timeout: ajaxTimeout,
|
2020-10-12 14:39:23 +09:00
|
|
|
|
success: function (r) {
|
|
|
|
|
|
isCaping = false;
|
|
|
|
|
|
capResult = r;
|
|
|
|
|
|
setcap();
|
2025-04-03 13:57:19 +09:00
|
|
|
|
// 로딩바 숨김 추가
|
|
|
|
|
|
hideLoadingImage();
|
|
|
|
|
|
},
|
|
|
|
|
|
error: function (e) {
|
2020-10-12 14:39:23 +09:00
|
|
|
|
isCaping = false;
|
2025-04-03 13:57:19 +09:00
|
|
|
|
console.log('Ajax 오류:', e.status, e.statusText);
|
2020-10-12 14:39:23 +09:00
|
|
|
|
console.log(e.responseText);
|
2025-04-03 13:57:19 +09:00
|
|
|
|
if (e.status === 0 && e.statusText === 'timeout') {
|
|
|
|
|
|
alert("요청 시간이 초과되었습니다. 다시 시도해주세요.");
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (_jsislayer2) {
|
|
|
|
|
|
alert("개발담당자에게 문의해주세요");
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
|
|
|
|
|
else {
|
2025-04-03 13:57:19 +09:00
|
|
|
|
alert("개발담당자에게 문의해주세요.");
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
// 로딩바 숨김 추가
|
|
|
|
|
|
hideLoadingImage();
|
|
|
|
|
|
},
|
|
|
|
|
|
complete: function () {
|
2020-10-12 14:39:23 +09:00
|
|
|
|
ajaxing(false);
|
2025-04-03 13:57:19 +09:00
|
|
|
|
// complete에도 로딩바 숨김 추가 (중복 호출 방지를 위해 다른 방법 고려 가능)
|
|
|
|
|
|
hideLoadingImage();
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
2025-04-03 13:57:19 +09:00
|
|
|
|
console.log("다른 작업을 처리중입니다. 잠시후 다시 작업해주세요.");
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//function (xhr, textStatus) {
|
|
|
|
|
|
// Do other operation
|
|
|
|
|
|
//callback()
|
|
|
|
|
|
//});
|
|
|
|
|
|
function cap(url, formid, callback, getpost, autoMsg, noBG, jsislayer2) {
|
|
|
|
|
|
formid = formid || "mform";
|
|
|
|
|
|
_jsislayer2 = jsislayer2 || false;
|
|
|
|
|
|
if (!isCaping) {
|
|
|
|
|
|
isAutoMsg = autoMsg || false;
|
|
|
|
|
|
_bging = noBG || false;
|
|
|
|
|
|
if (!_bging) {
|
|
|
|
|
|
prg('');
|
|
|
|
|
|
ajaxing();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (_jsislayer2) {
|
|
|
|
|
|
prg('2');
|
|
|
|
|
|
bglayer2();
|
|
|
|
|
|
}
|
|
|
|
|
|
_callback = callback;
|
|
|
|
|
|
capResult = null;
|
|
|
|
|
|
capOK = false;
|
|
|
|
|
|
isCaping = true;
|
|
|
|
|
|
clearComma();
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: getpost || "post",
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
data: $("#" + formid).serialize(),
|
|
|
|
|
|
success: function (r) {
|
|
|
|
|
|
isCaping = false;
|
|
|
|
|
|
capResult = r;
|
|
|
|
|
|
setcap();
|
|
|
|
|
|
}, error: function (e) {
|
|
|
|
|
|
isCaping = false;
|
|
|
|
|
|
console.log(e.responseText);
|
|
|
|
|
|
if (_jsislayer2) {
|
|
|
|
|
|
msg2("개발담당자에게 문의해주세요.....");
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
msg("개발담당자에게 문의해주세요.....");
|
|
|
|
|
|
}
|
|
|
|
|
|
}, complete: function () {
|
|
|
|
|
|
prgstop();
|
|
|
|
|
|
ajaxing(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
alert("다른 작업을 처리중입니다. 잠시후 다시 작업해주세요.");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var _jsislayer2 = false;
|
2025-04-03 13:57:19 +09:00
|
|
|
|
function capp(url, p, callback, getpost, autoMsg, noBG, jsislayer2, hideBG, noerror, sync) {
|
2020-10-12 14:39:23 +09:00
|
|
|
|
_jsislayer2 = jsislayer2 || false;
|
2025-04-03 13:57:19 +09:00
|
|
|
|
_noerror = noerror || false;
|
|
|
|
|
|
_hideBG = hideBG || false;
|
|
|
|
|
|
|
|
|
|
|
|
// 동기식 요청은 권장되지 않지만, 기존 코드 호환성을 위해 유지
|
|
|
|
|
|
// 단, 경고 메시지 출력
|
|
|
|
|
|
_async = !(sync || false);
|
|
|
|
|
|
if (sync) {
|
|
|
|
|
|
console.warn("동기식 Ajax 요청은 권장되지 않으며 iOS에서 문제를 일으킬 수 있습니다.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
|
if (!isCaping) {
|
|
|
|
|
|
isAutoMsg = autoMsg || false;
|
|
|
|
|
|
_bging = noBG || false;
|
2025-04-03 13:57:19 +09:00
|
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
|
if (!_bging) {
|
|
|
|
|
|
ajaxing();
|
|
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
|
if (_jsislayer2) {
|
|
|
|
|
|
bglayer2();
|
|
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
|
_callback = callback;
|
|
|
|
|
|
capResult = null;
|
|
|
|
|
|
capOK = false;
|
|
|
|
|
|
isCaping = true;
|
2025-04-03 13:57:19 +09:00
|
|
|
|
|
|
|
|
|
|
// 기존 함수 호출 유지, 존재 확인 후 실행
|
|
|
|
|
|
if (typeof clearComma === 'function') {
|
|
|
|
|
|
try {
|
|
|
|
|
|
clearComma();
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.error("clearComma 함수 실행 오류:", e);
|
|
|
|
|
|
}
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
|
|
|
|
|
|
// Ajax 요청 설정
|
|
|
|
|
|
const ajaxSettings = {
|
2020-10-12 14:39:23 +09:00
|
|
|
|
type: getpost || "post",
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
data: p,
|
2025-04-03 13:57:19 +09:00
|
|
|
|
async: _async,
|
|
|
|
|
|
timeout: _async ? 30000 : undefined, // 비동기 요청만 타임아웃 설정
|
2020-10-12 14:39:23 +09:00
|
|
|
|
success: function (r) {
|
|
|
|
|
|
isCaping = false;
|
|
|
|
|
|
capResult = r;
|
2025-04-03 13:57:19 +09:00
|
|
|
|
// iOS 호환성을 위한 추가 처리
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
setcap();
|
|
|
|
|
|
}, 0);
|
|
|
|
|
|
},
|
|
|
|
|
|
error: function (xhr, status, error) {
|
2020-10-12 14:39:23 +09:00
|
|
|
|
isCaping = false;
|
2025-04-03 13:57:19 +09:00
|
|
|
|
console.log("Ajax 오류:", status, error);
|
|
|
|
|
|
|
|
|
|
|
|
if (xhr.responseText) {
|
|
|
|
|
|
console.log("응답 내용:", xhr.responseText);
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
|
|
|
|
|
|
// 타임아웃 오류 별도 처리
|
|
|
|
|
|
if (status === "timeout") {
|
|
|
|
|
|
if (_jsislayer2) {
|
|
|
|
|
|
alert("요청 시간이 초과되었습니다. 다시 시도해 주세요.");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
alert("요청 시간이 초과되었습니다. 다시 시도해 주세요.");
|
|
|
|
|
|
}
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
else if (!_noerror) {
|
|
|
|
|
|
if (_jsislayer2) {
|
|
|
|
|
|
alert("잠시 후 다시 요청해주세요.");
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
alert("잠시 후 다시 요청해주세요.");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
complete: function () {
|
|
|
|
|
|
// iOS에서의 지연 문제 방지를 위한 setTimeout 사용
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
ajaxing(false);
|
|
|
|
|
|
}, 0);
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// iOS 특정 버전에서의 캐시 문제 방지
|
|
|
|
|
|
if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) {
|
|
|
|
|
|
ajaxSettings.cache = false;
|
|
|
|
|
|
|
|
|
|
|
|
// URL에 타임스탬프 추가하여 캐시 방지
|
|
|
|
|
|
const timestamp = new Date().getTime();
|
|
|
|
|
|
ajaxSettings.url = ajaxSettings.url +
|
|
|
|
|
|
(ajaxSettings.url.indexOf('?') >= 0 ? '&' : '?') +
|
|
|
|
|
|
'_t=' + timestamp;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax(ajaxSettings);
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
2025-04-03 13:57:19 +09:00
|
|
|
|
else if (!_noerror) {
|
|
|
|
|
|
console.log("다른 작업을 처리중입니다. 잠시후 다시 작업해주세요.");
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function showOK() {
|
|
|
|
|
|
$("#topmessage").hide().slideDown(300);
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
$("#topmessage").slideUp(300);
|
|
|
|
|
|
}, 1500);
|
|
|
|
|
|
}
|
|
|
|
|
|
function setcap() {
|
|
|
|
|
|
if (capResult.code === 1000) {
|
|
|
|
|
|
capOK = true;
|
|
|
|
|
|
capResultObj = capResult.obj;
|
|
|
|
|
|
capResultMsg = capResult.msg;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (capResult.code == 9991) {
|
|
|
|
|
|
if (ispop()) {
|
|
|
|
|
|
parent.location.href = capResult.obj + '?istimeout=true';
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ((parent.ismainlayout || 0) == 1) {
|
|
|
|
|
|
parent.location.href = capResult.obj + '?istimeout=true';
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (opener != null) {
|
|
|
|
|
|
parent.location.href = capResult.obj + '?istimeout=true';
|
|
|
|
|
|
self.close();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
msg("인증시간이 초과되어 로그아웃되었습니다.");
|
|
|
|
|
|
location.href = capResult.obj + '?istimeout=true';
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
if (isAutoMsg) {
|
|
|
|
|
|
switch (capResult.code) {
|
|
|
|
|
|
case 1000:
|
|
|
|
|
|
showOK();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 9999:
|
|
|
|
|
|
msg("서버접속이 원활하지 않습니다 <" + capResult.code + ": " + capResult.msg + ">");
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 9998:
|
|
|
|
|
|
msg("권한이 없는 요청입니다. <" + capResult.code + ": " + capResult.msg + ">");
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 9997:
|
|
|
|
|
|
msg("권한(로그인)이 없는 요청입니다. <" + capResult.code + ": " + capResult.msg + ">");
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 9996:
|
|
|
|
|
|
msg("검색된 데이터가 없습니다. <" + capResult.code + ": " + capResult.msg + ">");
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 9995:
|
|
|
|
|
|
msg("적용된 데이터가 없습니다. <" + capResult.code + ": " + capResult.msg + ">");
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
console.log(capResult.code);
|
|
|
|
|
|
console.log(capResult.msg);
|
|
|
|
|
|
console.log(capResult.obj);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
capResultMsg = capResult.code + ": " + capResult.msg;
|
|
|
|
|
|
}
|
|
|
|
|
|
_callback = _callback || "";
|
|
|
|
|
|
if (_callback != "") {
|
|
|
|
|
|
eval(_callback.indexOf(")") > -1 ? _callback : (_callback + "()"));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function isempty(v) {
|
|
|
|
|
|
return $.trim((v || "")) === "";
|
|
|
|
|
|
}
|
|
|
|
|
|
function focus(id) {
|
|
|
|
|
|
$("#" + id).focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
function submit(fid, t, remainpage) {
|
|
|
|
|
|
remainpage = remainpage || false;
|
|
|
|
|
|
if (!remainpage) {
|
|
|
|
|
|
$("#pagenum").val(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
submitform(fid, t);
|
|
|
|
|
|
}
|
|
|
|
|
|
function submitform(fid, t) {
|
|
|
|
|
|
t = t || 0;
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
$("#" + (fid || "mform")).submit();
|
|
|
|
|
|
}, t);
|
|
|
|
|
|
}
|
|
|
|
|
|
function timesubmit(fid, t) {
|
|
|
|
|
|
t = t || 500;
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
$("#" + (fid || "mform")).submit();
|
|
|
|
|
|
}, t);
|
|
|
|
|
|
}
|
|
|
|
|
|
function timesubmitauto(fid, t) {
|
|
|
|
|
|
t = t || 500;
|
|
|
|
|
|
$("a.mainokbutton,a.mainokbutton2").hide();
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
$("#" + (fid || "mform")).submit();
|
|
|
|
|
|
}, t);
|
|
|
|
|
|
}
|
|
|
|
|
|
function oksubmit(fid) {
|
|
|
|
|
|
$("a.mainokbutton").unbind();
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
$("a.mainokbutton").on("click", function () {
|
|
|
|
|
|
$("#" + (fid || "mform")).submit();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function timeclosechild(t) {
|
|
|
|
|
|
t = t || 500;
|
|
|
|
|
|
phdphd
|
|
|
|
|
|
}
|
|
|
|
|
|
function setrv(name, val) {
|
|
|
|
|
|
$("input[name='" + name + "'][value='" + val + "']").prop("checked", true);
|
|
|
|
|
|
}
|
|
|
|
|
|
function setv(id, val) {
|
|
|
|
|
|
$("#" + id).val(val);
|
|
|
|
|
|
}
|
|
|
|
|
|
function sett(id, text) {
|
|
|
|
|
|
$("#" + id).text(text);
|
|
|
|
|
|
}
|
|
|
|
|
|
function clearradio(name) {
|
|
|
|
|
|
$("input[name='" + name + "']:checked").prop("checked", false);
|
|
|
|
|
|
}
|
|
|
|
|
|
function clearall() {
|
|
|
|
|
|
$(".clearitem").val("");
|
|
|
|
|
|
$.each($(".clearbox input[type=text], .clearbox input[type=hidden]"), function (i, r) {
|
|
|
|
|
|
$(r).val($(r).attr("data-default") || "");
|
|
|
|
|
|
if (($(r).attr("data-bind") || "") != "") {
|
|
|
|
|
|
$("input[name='" + $(r).attr("data-bind") + "'][value='" + $(r).val() + "']").prop("checked", true);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function radioed(r) {
|
|
|
|
|
|
var rn = $(r).attr("data-rname") || "";
|
|
|
|
|
|
if (rn != "") {
|
|
|
|
|
|
$("#" + rn).val($(r).val());
|
|
|
|
|
|
}
|
|
|
|
|
|
if ($(r).parents(".radiocolor").length > 0) {
|
|
|
|
|
|
$(r).closest(".radiobox").find("span").css("color", "#2760ad");
|
|
|
|
|
|
$(r).parent().css("color", "red");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function findCode(p) {
|
|
|
|
|
|
//검색구분:검색항목:검색항목값:선택결과함수명 > 검색구분은 대분자로
|
|
|
|
|
|
$("#findlayercaption").text(p.split(':')[4]);
|
|
|
|
|
|
$("#findlayerlist").html("");
|
|
|
|
|
|
capp("/ZAXCommonNone/FindCode/", { p: p }, "cbfindcode");
|
|
|
|
|
|
}
|
|
|
|
|
|
function cbfindcode() {
|
|
|
|
|
|
$("#findlayercap").html(capResult.obj.header);
|
|
|
|
|
|
$("#findlayerlist").html(capResult.obj.data);
|
|
|
|
|
|
$("#findlayerbglayer, #findlayer").show();
|
|
|
|
|
|
}
|
|
|
|
|
|
function hideFindCode() {
|
|
|
|
|
|
$("#findlayerbglayer, #findlayer").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
function gopage(pi, a) {
|
|
|
|
|
|
$("#pagenum").val(pi);
|
|
|
|
|
|
submitform();
|
|
|
|
|
|
}
|
|
|
|
|
|
function setemail(id, s) {
|
|
|
|
|
|
$("#" + id).attr("readonly", "readonly");
|
|
|
|
|
|
$("#" + id).addClass("readinput");
|
|
|
|
|
|
if ($(s).val() == $(s).attr("data-manual")) {
|
|
|
|
|
|
$("#" + id).val("");
|
|
|
|
|
|
$("#" + id).removeAttr("readonly").focus();
|
|
|
|
|
|
$("#" + id).removeClass("readinput");
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$("#" + id).val($(s).find("option:selected").text().trim());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function isExist(id) {
|
|
|
|
|
|
return $("#" + id).length > 0 ? true : false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function len(val) {
|
|
|
|
|
|
return $.trim(val).length;
|
|
|
|
|
|
}
|
|
|
|
|
|
function isData(id) {
|
|
|
|
|
|
return val(id) == "" ? false : true;
|
|
|
|
|
|
}
|
|
|
|
|
|
function ispassword(v) {
|
2024-01-05 08:47:23 +09:00
|
|
|
|
var r = /^(?=.*[a-zA-Z])(?=.*[!@#$%^&~*+=-])(?=.*[0-9]).{8,20}$/;
|
|
|
|
|
|
return r.test(v);
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
2021-11-29 15:11:55 +09:00
|
|
|
|
|
2024-01-05 08:47:23 +09:00
|
|
|
|
function isRepeatedString(str) {
|
|
|
|
|
|
// 반복 문자열 검증
|
|
|
|
|
|
const len = str.length;
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 1; i < len; i++) {
|
|
|
|
|
|
if (len % i === 0) {
|
|
|
|
|
|
const pattern = str.slice(0, i).repeat(len / i);
|
|
|
|
|
|
if (pattern === str) {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-29 15:11:55 +09:00
|
|
|
|
function ispass(v) {
|
|
|
|
|
|
var r = /^(?=.*[a-zA-Z])(?=.*[!@#$%^&~*+=-])(?=.*[0-9]).{8,20}$/;
|
|
|
|
|
|
return r.test(v);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
|
function isemail(v) {
|
|
|
|
|
|
//이메일 검사
|
|
|
|
|
|
var regExp = /^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,3}$/i;
|
|
|
|
|
|
if (regExp.test(v)) {
|
|
|
|
|
|
return true;
|
2024-06-24 12:45:12 +09:00
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function isemail2(v) {
|
|
|
|
|
|
//이메일 검사
|
|
|
|
|
|
var regExp = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
|
|
|
|
if (regExp.test(v)) {
|
|
|
|
|
|
return true;
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function checkid(v) {
|
|
|
|
|
|
var idReg = /^[a-z]+[a-z0-9]{5,15}$/g;
|
|
|
|
|
|
if (!idReg.test(v)) {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function same(v, v2) {
|
|
|
|
|
|
return v == v2 ? true : false;
|
|
|
|
|
|
}
|
|
|
|
|
|
function ipdupcheck(id, auth, callBack) {
|
|
|
|
|
|
capp('/ZaxCommonNone/SWREdXBDaGVjaw', { id: id, auth: auth }, callBack, "post", true, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
function changeschoolgrade(s) {
|
|
|
|
|
|
if ($("select.classgrade").length > 0) {
|
|
|
|
|
|
var sv = $("select.classgrade option:selected").val() || "XXX";
|
|
|
|
|
|
$("select.classgrade option.deletable").remove();
|
|
|
|
|
|
for (var i = 1; i <= getint($(s).find("option:selected").attr("data-classgrade") || "0"); i++) {
|
|
|
|
|
|
$("select.classgrade").append("<option class=\"deletable\" value=\"" + i + "\">" + i + "</option>");
|
|
|
|
|
|
}
|
|
|
|
|
|
if ($("select.classgrade option[value='" + sv + "']").length > 0) {
|
|
|
|
|
|
$("select.classgrade").val(sv);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
setClassGradeView(s);
|
|
|
|
|
|
}
|
|
|
|
|
|
function setClassGradeView(s) {
|
|
|
|
|
|
$(".hideschoolname, .hideclassgrade").show();
|
|
|
|
|
|
if (($(s).find("option:selected").val() || '0') == '0') {
|
|
|
|
|
|
$(".hideschoolname, .hideclassgrade").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
switch (getint($(s).find("option:selected").attr("data-classgrade") || -9)) {
|
|
|
|
|
|
case -9:
|
|
|
|
|
|
$(".hideschoolname").hide();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
$(".hideclassgrade").hide();
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function makejsonfile(v) {
|
|
|
|
|
|
if (v == null || v == "") {
|
|
|
|
|
|
return [];
|
|
|
|
|
|
}
|
|
|
|
|
|
var rtn = [];
|
|
|
|
|
|
$.each(v.split(';'), function (i, r) {
|
|
|
|
|
|
rtn.push({ fgno: r.split(':')[0], fno: r.split(':')[1], fname: r.split(':')[2], key: r.split(':')[1], caption: r.split(':')[3] });
|
|
|
|
|
|
});
|
|
|
|
|
|
return rtn;
|
|
|
|
|
|
}
|
|
|
|
|
|
function makejsonfileUpload(v) {
|
|
|
|
|
|
if (v == null || v == "") {
|
|
|
|
|
|
return [];
|
|
|
|
|
|
}
|
|
|
|
|
|
var rtn = [];
|
|
|
|
|
|
if (v.split(':').length == 2) {
|
|
|
|
|
|
$.each(v.split(';'), function (i, r) {
|
|
|
|
|
|
rtn.push({ fgno: r.split(':')[0], fdname: r.split(':')[1], fseq: 1, __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val(), AXAUTH: $("#AXAUTH").val() });
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (v.split(':').length == 3) {
|
|
|
|
|
|
$.each(v.split(';'), function (i, r) {
|
|
|
|
|
|
rtn.push({ fgno: r.split(':')[0], fdname: r.split(':')[1], fseq: 2, FGKey: r.split(':')[2], __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val(), AXAUTH: $("#AXAUTH").val() });
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
return rtn[0];
|
|
|
|
|
|
}
|
|
|
|
|
|
function makejsonkey(v, sp, fgno, isSingleFile) {
|
|
|
|
|
|
if (v == null || v == "") {
|
|
|
|
|
|
return [];
|
|
|
|
|
|
}
|
|
|
|
|
|
var rtn = [];
|
|
|
|
|
|
$.each(v.split(sp), function (i, r) {
|
|
|
|
|
|
rtn.push({ key: r, fgno: fgno || 0, isSingleFile: isSingleFile || 0 });
|
|
|
|
|
|
});
|
|
|
|
|
|
return rtn;
|
|
|
|
|
|
}
|
|
|
|
|
|
function getJson(v) {
|
|
|
|
|
|
var rtn = [];
|
|
|
|
|
|
if (v == null || v == "") {
|
|
|
|
|
|
return rtn;
|
|
|
|
|
|
}
|
|
|
|
|
|
$.each(v.split(';'), function (i, r) {
|
|
|
|
|
|
rtn.push(r);
|
|
|
|
|
|
});
|
|
|
|
|
|
return rtn;
|
|
|
|
|
|
}
|
|
|
|
|
|
function newfileitem(id, name, idx, mutiple) {
|
|
|
|
|
|
mutiple = mutiple || "";
|
|
|
|
|
|
return "<div class=\"file-loading\">"
|
|
|
|
|
|
+ " <input id=\"" + id + "\" data-fgno=\"0\" name=\"" + name + "\" type=\"file\" data-idx=\"" + idx + "\" " + mutiple + " class=\"file\" data-overwrite-initial=\"false\" data-min-file-count=\"0\" data-show-upload=\"false\" data-show-viewdetail=\"true\" data-msg-placeholder=\"파일을 선택하세요.\" data-show-preview=\"true\" />"
|
|
|
|
|
|
+ "</div>";
|
|
|
|
|
|
}
|
|
|
|
|
|
function fileset(id, exts, filetype, uploadExtraData, fnuploaded) {
|
|
|
|
|
|
$("#" + id).fileinput({
|
|
|
|
|
|
theme: 'fa',
|
|
|
|
|
|
uploadUrl: '/ZAXCommon/UploadFiles', // you must set a valid URL here else you will get an error
|
|
|
|
|
|
uploadExtraData: uploadExtraData,
|
|
|
|
|
|
allowedFileExtensions: getJson(exts),//['jpg', 'png', 'gif'],
|
|
|
|
|
|
overwriteInitial: false,
|
|
|
|
|
|
maxFileSize: 1000,
|
|
|
|
|
|
maxFilesNum: 10,
|
|
|
|
|
|
minFileCount: 2,
|
|
|
|
|
|
maxFileCount: 5,
|
|
|
|
|
|
initialPreviewAsData: true, // identify if you are sending preview data only and not the raw markup
|
|
|
|
|
|
ajaxDeleteSettings: { method: "DELETE" },
|
|
|
|
|
|
allowedFileTypes: getJson(filetype),
|
|
|
|
|
|
slugCallback: function (filename) {
|
|
|
|
|
|
return filename.replace('(', '_').replace(']', '_');
|
|
|
|
|
|
},
|
|
|
|
|
|
fileActionSettings: {
|
|
|
|
|
|
showUpload: false,
|
|
|
|
|
|
removeClass: 'btn btn-default btn-xs btn-danger',
|
|
|
|
|
|
zoomClass: 'btn btn-default btn-xs btn-primary',
|
|
|
|
|
|
showCaption: false,
|
|
|
|
|
|
showDrag: false,
|
|
|
|
|
|
},
|
|
|
|
|
|
//removeIcon: '',
|
|
|
|
|
|
removeClass: 'btn btn-default btn-danger',
|
|
|
|
|
|
//browseIcon: '',
|
|
|
|
|
|
//removeClass: 'btn btn-default btn-danger',
|
|
|
|
|
|
autoReplace: true,
|
|
|
|
|
|
}).on('fileuploaded', eval(fnuploaded));
|
|
|
|
|
|
}
|
|
|
|
|
|
function removeTag(v) {
|
|
|
|
|
|
if (v == undefined || v == null) {
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
return v.replace(/<p>/gi, '').replace(/<br>/gi, '').replace(/<\/p>/gi, '').replace(/<br\/>/gi, '').replace(/<br \/>/gi, '').replace(/ /gi, '').replace(/<b>/gi, '').replace(/<\/b>/gi, '');
|
|
|
|
|
|
}
|
|
|
|
|
|
function editorSubmit(gi) {
|
|
|
|
|
|
gi = gi == undefined || gi == null ? 1 : gi;
|
|
|
|
|
|
var id;
|
|
|
|
|
|
$.each($(".editorarea"), function (i, r) {
|
|
|
|
|
|
if (gi == 2) {
|
|
|
|
|
|
//<embed src='http://localhost:81/Files/Contents/ADELEColdShoulder.mp4' />
|
|
|
|
|
|
id = $(r).attr("id");
|
|
|
|
|
|
try {
|
|
|
|
|
|
$("#" + id).text(oEditors.getById[id].getRawContents());
|
|
|
|
|
|
$("#" + id).val(escape(oEditors.getById[id].getRawContents()));
|
|
|
|
|
|
} catch (e) { consol.clear(); console.log(e); }
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
id = $(r).attr("id");
|
|
|
|
|
|
if (oEditors.getById[id] != undefined) {
|
|
|
|
|
|
oEditors.getById[id].exec("UPDATE_CONTENTS_FIELD", []); // 에디터의 내용이 textarea에 적용됩니다.
|
|
|
|
|
|
try {
|
|
|
|
|
|
$("#" + id).text($("#" + id).val());
|
|
|
|
|
|
$("#" + id).val(escape($("#" + id).val()));
|
|
|
|
|
|
} catch (e) { logerror(e) }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function logerror(e) {
|
|
|
|
|
|
console.clear();
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
function getBytes(v, nocrtrim) {
|
|
|
|
|
|
nocrtrim = nocrtrim == undefined || nocrtrim == null ? false : nocrtrim;
|
|
|
|
|
|
if (v == null) {
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
v = $.trim(v);
|
|
|
|
|
|
if (!nocrtrim) {
|
|
|
|
|
|
v = v.replace(/[\r\n]/gi, '').replace(/[\n]/gi, '');
|
|
|
|
|
|
}
|
|
|
|
|
|
var stringByteLength = 0;
|
|
|
|
|
|
stringByteLength = (function (s, b, i, c) {
|
|
|
|
|
|
for (b = i = 0; c = s.charCodeAt(i++); b += c >> 11 ? 2 : c >> 7 ? 2 : 1);
|
|
|
|
|
|
return b
|
|
|
|
|
|
})(v);
|
|
|
|
|
|
return stringByteLength;
|
|
|
|
|
|
}
|
|
|
|
|
|
function changecheck(c) {
|
|
|
|
|
|
var id = $(c).attr("data-hiden-id") || "";
|
|
|
|
|
|
if ($("#" + id).length > 0 && $(c).attr("data-value-type") == "int") {
|
|
|
|
|
|
if ($(c).prop("checked")) {
|
|
|
|
|
|
$("#" + id).val(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$("#" + id).val(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function fnEmpty() {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
function framelayer(a) {
|
|
|
|
|
|
$("#findframe").attr("src", a);
|
|
|
|
|
|
$("#findframe").on("load", function () {
|
|
|
|
|
|
showframelayer();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function showframelayer() {
|
|
|
|
|
|
$("#findlayerframe, #findlayerbglayer").show();
|
|
|
|
|
|
}
|
|
|
|
|
|
function closeframepop() {
|
|
|
|
|
|
parent.callcloseframepop();
|
|
|
|
|
|
}
|
|
|
|
|
|
function callcloseframepop() {
|
|
|
|
|
|
$("#findframe").attr("src", "");
|
|
|
|
|
|
$("#findframe").on("load", function () {
|
|
|
|
|
|
hideframelayer();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function hideframelayer() {
|
|
|
|
|
|
$("#findlayerframe, #findlayerbglayer").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
function showramemainlayer(url) {
|
|
|
|
|
|
//$("#mainlayerframe")[0].contentWindow.document.open();
|
|
|
|
|
|
//$("#mainlayerframe")[0].contentWindow.document.write("<html><body>로딩중입니다. 잠시만기다려주세요.</body></html>");
|
|
|
|
|
|
//$("#mainlayerframe")[0].contentWindow.document.close();
|
|
|
|
|
|
$("#mainlayerframe").attr("src", url);
|
|
|
|
|
|
$("#mainlayerframe, #findlayerbglayer").show();
|
|
|
|
|
|
}
|
|
|
|
|
|
function hideframemainlayer() {
|
|
|
|
|
|
$("#mainlayerframe, #findlayerbglayer").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
function checkall(tid, c) {
|
|
|
|
|
|
$("#" + tid + " tr.data td input.autocheck").prop("checked", $(c).prop("checked"));
|
|
|
|
|
|
}
|
|
|
|
|
|
function playsound(selectorid, iconid, replayid, fnend) {
|
|
|
|
|
|
fnend = fnend || false;
|
|
|
|
|
|
_soundselectorid = selectorid;
|
|
|
|
|
|
_soundiconid = iconid;
|
|
|
|
|
|
_soundreplayid = replayid;
|
|
|
|
|
|
if ((_soundselectorid || "") != "" && val(_soundselectorid) != "") {
|
|
|
|
|
|
try {
|
|
|
|
|
|
if ($("#" + _soundiconid).hasClass("glyphicon-headphones")) {
|
|
|
|
|
|
_audio.src = rootUrl + $("#" + _soundselectorid).val();
|
|
|
|
|
|
_audio.play();
|
|
|
|
|
|
_audio.onerror = function () {
|
|
|
|
|
|
$("#" + _soundiconid).removeClass("glyphicon-headphones").removeClass("glyphicon-pause").removeClass("glyphicon-play").addClass("glyphicon-headphones");
|
|
|
|
|
|
$("#" + _soundreplayid).hide();
|
|
|
|
|
|
msg("알 수 없는 음원입니다.");
|
|
|
|
|
|
};
|
|
|
|
|
|
if (fnend) {
|
|
|
|
|
|
_audio.onended = function () {
|
|
|
|
|
|
$("#" + _soundiconid).addClass("glyphicon-headphones").removeClass("glyphicon-pause").removeClass("glyphicon-play").removeClass("glyphicon-play");
|
|
|
|
|
|
$("#" + _soundreplayid).hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#" + _soundiconid).removeClass("glyphicon-headphones").removeClass("glyphicon-pause").removeClass("glyphicon-play").addClass("glyphicon-pause");
|
|
|
|
|
|
$("#" + _soundreplayid).show();
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ($("#" + _soundiconid).hasClass("glyphicon-pause")) {
|
|
|
|
|
|
_audio.pause();
|
|
|
|
|
|
$("#" + _soundiconid).removeClass("glyphicon-headphones").removeClass("glyphicon-pause").removeClass("glyphicon-play").addClass("glyphicon-play");
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ($("#" + _soundiconid).hasClass("glyphicon-play")) {
|
|
|
|
|
|
_audio.play();
|
|
|
|
|
|
$("#" + _soundiconid).removeClass("glyphicon-headphones").removeClass("glyphicon-pause").removeClass("glyphicon-play").addClass("glyphicon-pause");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (ex) {
|
|
|
|
|
|
$("#" + _soundiconid).removeClass("glyphicon-headphones").removeClass("glyphicon-pause").removeClass("glyphicon-play").addClass("glyphicon-headphones");
|
|
|
|
|
|
$("#" + _soundreplayid).hide();
|
|
|
|
|
|
msg("알 수 없는 음원입니다.");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function replaysound() {
|
|
|
|
|
|
_audio.currentTime = 0;
|
|
|
|
|
|
$("#" + _soundiconid).removeClass("glyphicon-headphones").removeClass("glyphicon-pause").removeClass("glyphicon-play").addClass("glyphicon-pause");
|
|
|
|
|
|
_audio.play();
|
|
|
|
|
|
}
|
|
|
|
|
|
function soundchange(iconid) {
|
|
|
|
|
|
$("#" + _soundiconid).removeClass("glyphicon-headphones").removeClass("glyphicon-pause").removeClass("glyphicon-play").addClass("glyphicon-headphones");
|
|
|
|
|
|
$("#" + _soundreplayid).hide();
|
|
|
|
|
|
_audio.pause();
|
|
|
|
|
|
}
|
|
|
|
|
|
function maingetfile() {
|
|
|
|
|
|
$("#mainuploadfile").click();
|
|
|
|
|
|
}
|
|
|
|
|
|
function mainchangefile(fi) {
|
|
|
|
|
|
$("#mainuploadlabel").val($(fi).val());
|
|
|
|
|
|
}
|
|
|
|
|
|
var mainfileexts = "";
|
|
|
|
|
|
var mainfileeurl = "";
|
|
|
|
|
|
var mainfilecallback = "";
|
|
|
|
|
|
var mainoverupload = false;
|
|
|
|
|
|
function mainSendFile() {
|
|
|
|
|
|
if (mainoverupload) {
|
|
|
|
|
|
msg("계약된 업로드용량을 초과하였습니다. 관리자에게 문의해주세요.", 0, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ($("#mainuploadfile").val() == "") {
|
|
|
|
|
|
msg("파일을 선택하세요.", 0, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
var thumbext = $("#mainuploadfile").val();
|
|
|
|
|
|
thumbext = thumbext.slice(thumbext.indexOf(".") + 1).toLowerCase();
|
|
|
|
|
|
if (mainfileexts.indexOf(thumbext) < 0) {
|
|
|
|
|
|
msg(mainfileexts + " 확장자만 가능합니다.", 0, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
var formData = new FormData();
|
|
|
|
|
|
formData.append("uploadfile", $("#mainuploadfile")[0].files[0]);
|
|
|
|
|
|
capfile(mainfileeurl, formData, mainfilecallback);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function mainFileClose() {
|
|
|
|
|
|
$("#bglayer, #uploadbox").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
function openMainFileUpload(exts, uri, cb) {
|
|
|
|
|
|
$("#mainuploadfile, #mainuploadlabel").val("");
|
|
|
|
|
|
mainfileexts = "png,jpg,gif";
|
|
|
|
|
|
mainfileeurl = "/ZAXCommon/UploadMainFile?fd=Editor";
|
|
|
|
|
|
mainfilecallback = "pushImage2";
|
|
|
|
|
|
$("#bglayer, #uploadbox").show();
|
|
|
|
|
|
}
|
|
|
|
|
|
function dateAdd(sDate, v, t) {
|
|
|
|
|
|
var yy = parseInt(sDate.substr(0, 4), 10);
|
|
|
|
|
|
var mm = parseInt(sDate.substr(5, 2), 10);
|
|
|
|
|
|
var dd = parseInt(sDate.substr(8), 10);
|
|
|
|
|
|
if (t == "d") {
|
|
|
|
|
|
d = new Date(yy, mm - 1, dd + v);
|
|
|
|
|
|
} else if (t == "m") {
|
|
|
|
|
|
d = new Date(yy, mm - 1 + v, dd);
|
|
|
|
|
|
} else if (t == "y") {
|
|
|
|
|
|
d = new Date(yy + v, mm - 1, dd);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
d = new Date(yy, mm - 1, dd + v);
|
|
|
|
|
|
}
|
|
|
|
|
|
yy = d.getFullYear();
|
|
|
|
|
|
mm = d.getMonth() + 1; mm = (mm < 10) ? '0' + mm : mm;
|
|
|
|
|
|
dd = d.getDate(); dd = (dd < 10) ? '0' + dd : dd;
|
|
|
|
|
|
return '' + yy + '-' + mm + '-' + dd;
|
|
|
|
|
|
}
|
|
|
|
|
|
function autoResize(i) {
|
|
|
|
|
|
//var iframeHeight = (i).contentWindow.document.body.scrollHeight;
|
|
|
|
|
|
//(i).height = iframeHeight + 20;
|
|
|
|
|
|
//$(i).removeAttr("height");
|
|
|
|
|
|
i.style.height = i.contentWindow.document.body.offsetHeight + 'px';
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
autoResize(i)
|
|
|
|
|
|
}, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
function mainupload(a) {
|
|
|
|
|
|
if ($(a).closest("#mainuploadbox").find("input.fileitem").val() != "") {
|
|
|
|
|
|
var data = new FormData();
|
|
|
|
|
|
var files = $(a).closest("#mainuploadbox").find("input.fileitem").get(0).files;
|
|
|
|
|
|
if (files.length > 0) {
|
|
|
|
|
|
data.append("upFile", files[0]);
|
|
|
|
|
|
mainuploadok(data);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function showmainupload(tf) {
|
|
|
|
|
|
if (tf) {
|
|
|
|
|
|
$("#mainuploadbox #mainuploadfile, #mainuploadbox .fileuploadlabel").val("");
|
|
|
|
|
|
bglayer();
|
|
|
|
|
|
$("#mainuploadbox").slideDown();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$("#mainuploadbox").slideUp();
|
|
|
|
|
|
$("#bglayer").hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function clearComma() {
|
|
|
|
|
|
$.each($("input.int, input.double"), function (i, c) {
|
|
|
|
|
|
$(c).val($(c).val().replace(/,/gi, ''));
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function bindCommaAll(fid) {
|
|
|
|
|
|
fid = fid || "";
|
|
|
|
|
|
$.each($((fid == "" ? "" : ("#" + fid + " ")) + "input.int, " + (fid == "" ? "" : ("#" + fid + " ")) + "input.double"), function (i, ci) {
|
|
|
|
|
|
if (!$(ci).hasClass("nocomma")) {
|
|
|
|
|
|
var fv = $(ci).val().replace(/,/gi, '');
|
|
|
|
|
|
var fv2 = "";
|
|
|
|
|
|
if (fv.indexOf('.') > -1) {
|
|
|
|
|
|
if (fv.split('.')[0].length > 3) {
|
|
|
|
|
|
for (var fvi = fv.split('.')[0].length - 1; fvi > -1; fvi--) {
|
|
|
|
|
|
fv2 = fv.split('.')[0].substr(fvi, 1) + (fv2 != "" && (fv2.replace(/,/gi, '').length % 3) < 1 ? "," : "") + fv2;
|
|
|
|
|
|
}
|
|
|
|
|
|
$(focusoutobj).val(fv2 + "." + fv.split('.')[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (fv.length > 3) {
|
|
|
|
|
|
for (var fvi = fv.length - 1; fvi > -1; fvi--) {
|
|
|
|
|
|
fv2 = fv.substr(fvi, 1) + (fv2 != "" && (fv2.replace(/,/gi, '').length % 3) < 1 ? "," : "") + fv2;
|
|
|
|
|
|
}
|
|
|
|
|
|
$(ci).val(fv2);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function bindComma(ci) {
|
|
|
|
|
|
var fv = $(ci).val().replace(/,/gi, '');
|
|
|
|
|
|
var fv2 = "";
|
|
|
|
|
|
if (fv.indexOf('.') > -1) {
|
|
|
|
|
|
if (fv.split('.')[0].length > 3) {
|
|
|
|
|
|
for (var fvi = fv.split('.')[0].length - 1; fvi > -1; fvi--) {
|
|
|
|
|
|
fv2 = fv.split('.')[0].substr(fvi, 1) + (fv2 != "" && (fv2.replace(/,/gi, '').length % 3) < 1 ? ($(ci).hasClass("nocomma")?"": ",") : "") + fv2;
|
|
|
|
|
|
}
|
|
|
|
|
|
$(focusoutobj).val(fv2 + "." + fv.split('.')[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (fv.length > 3) {
|
|
|
|
|
|
for (var fvi = fv.length - 1; fvi > -1; fvi--) {
|
|
|
|
|
|
fv2 = fv.substr(fvi, 1) + (fv2 != "" && (fv2.replace(/,/gi, '').length % 3) < 1 ? ($(ci).hasClass("nocomma") ? "" : ",") : "") + fv2;
|
|
|
|
|
|
}
|
|
|
|
|
|
$(ci).val(fv2);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function bindComma2(fv, fi) {
|
|
|
|
|
|
fi = fi || focusoutobj;
|
|
|
|
|
|
fv = fv.replace(/,/gi, '');
|
|
|
|
|
|
var fv2 = "";
|
|
|
|
|
|
if (fv.indexOf('.') > -1) {
|
|
|
|
|
|
if (fv.split('.')[0].length > 3) {
|
|
|
|
|
|
for (var fvi = fv.split('.')[0].length - 1; fvi > -1; fvi--) {
|
|
|
|
|
|
fv2 = fv.split('.')[0].substr(fvi, 1) + (fv2 != "" && (fv2.replace(/,/gi, '').length % 3) < 1 ? "," : "") + fv2;
|
|
|
|
|
|
}
|
|
|
|
|
|
$(focusoutobj).val(fv2 + "." + fv.split('.')[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (fv.length > 3) {
|
|
|
|
|
|
for (var fvi = fv.length - 1; fvi > -1; fvi--) {
|
|
|
|
|
|
fv2 = fv.substr(fvi, 1) + (fv2 != "" && (fv2.replace(/,/gi, '').length % 3) < 1 ? "," : "") + fv2;
|
|
|
|
|
|
}
|
|
|
|
|
|
$(focusoutobj).val(fv2);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function bindComma3(v) {
|
|
|
|
|
|
var fv = v.toString().replace(/,/gi, '');
|
|
|
|
|
|
var fv2 = "";
|
|
|
|
|
|
if (fv.indexOf('.') > -1) {
|
|
|
|
|
|
if (fv.split('.')[0].length > 3) {
|
|
|
|
|
|
for (var fvi = fv.split('.')[0].length - 1; fvi > -1; fvi--) {
|
|
|
|
|
|
fv2 = fv.split('.')[0].substr(fvi, 1) + (fv2 != "" && (fv2.replace(/,/gi, '').length % 3) < 1 ? "," : "") + fv2;
|
|
|
|
|
|
}
|
|
|
|
|
|
fv = fv2 + "." + fv.split('.')[1];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (fv.length > 3) {
|
|
|
|
|
|
for (var fvi2 = fv.length - 1; fvi2 > -1; fvi2--) {
|
|
|
|
|
|
fv2 = fv.substr(fvi2, 1) + (fv2 != "" && (fv2.replace(/,/gi, '').length % 3) < 1 ? "," : "") + fv2;
|
|
|
|
|
|
}
|
|
|
|
|
|
fv = fv2;
|
|
|
|
|
|
}
|
|
|
|
|
|
return fv;
|
|
|
|
|
|
}
|
|
|
|
|
|
function goparent(prefesh, t) {
|
|
|
|
|
|
t = t || 0;
|
|
|
|
|
|
prefesh = prefesh || false;
|
|
|
|
|
|
if (prefesh) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
if (typeof (parent.pagerefresh) == "function") {
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
parent.pagerefresh();
|
|
|
|
|
|
}, t);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
parent.submit();
|
|
|
|
|
|
}, t);
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (e) { console.log(e); }
|
|
|
|
|
|
} else {
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
parent.hideframemainlayer();
|
|
|
|
|
|
}, t);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function cbeditorupload() {
|
|
|
|
|
|
if (_uploadeditorimagertn.code == 1000) {
|
|
|
|
|
|
$(_uploadeditorimageitem).summernote('editor.insertImage', _uploadeditorimagertn.obj.uri);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var focusoutobj;
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
//$("").on("click", hideFindCode);
|
|
|
|
|
|
$("input.readinput").attr("readonly", "readonly");
|
|
|
|
|
|
$(".int").css("imeMode", "disabled");
|
|
|
|
|
|
$("body").on("keydown", "input.int, input.double", function (e) {
|
|
|
|
|
|
if ((e.keyCode < 8 || e.keyCode > 9) && (e.keyCode < 48 || e.keyCode > 57) && (e.keyCode < 96 && e.keyCode > 105)) { Prevent(); }
|
|
|
|
|
|
}).on("keyup", "input.int, input.double, input.mobile", function (e) {
|
|
|
|
|
|
//if ($(this).val() !== null && $(this).val() !== '' && e.keyCode !== 9 && (e.keyCode < 37 && e.keyCode > 40)) {
|
|
|
|
|
|
// $(this).val($(this).val().replace(/[^0-9]/g, ''));
|
|
|
|
|
|
//}
|
|
|
|
|
|
if ($(this).val() !== null && $(this).val() !== '' && e.keyCode != 8 && e.keyCode != 109 && e.keyCode != 189 && e.keyCode != 46 && e.keyCode != 110 && e.keyCode != 109 && e.keycode != 189 && e.keyCode != 13
|
|
|
|
|
|
&& !(e.keyCode > 47 && e.keyCode < 58) && !(e.keyCode > 95 && e.keyCode < 106)) {
|
|
|
|
|
|
$(this).val($(this).val().replace(/[^,0-9.]/g, ''));
|
|
|
|
|
|
if ($(this).hasClass("int") && isNaN(parseInt($(this).val(), 10))) {
|
|
|
|
|
|
if ($(this).attr("data-zero") != null || $(this).hasClass("datazero")) {
|
|
|
|
|
|
$(this).val("");
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$(this).val(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ($(this).hasClass("double") && isNaN(parseFloat($(this).val()))) {
|
|
|
|
|
|
if ($(this).attr("data-zero") != null) {
|
|
|
|
|
|
$(this).val("");
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$(this).val(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (e.keyCode != 8 && e.keyCode != 46) {
|
|
|
|
|
|
var v = $(this).val().replace(/,/, '');
|
|
|
|
|
|
if (!$(this).hasClass("nocomma") && !$(this).hasClass("mobile") && v.indexOf('.') < 0 && v.length > 3) {
|
|
|
|
|
|
$(this).val(bindComma3(v));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}).on("change", "input.int, .email, .mobile, .double, .mobilefmt, .telnofmt", function () {
|
|
|
|
|
|
if ($(this).hasClass("email")) {
|
|
|
|
|
|
$("#" + $(this).attr("data-bind")).val(vals($(this).parent().find(".emaildata" + $(this).attr("data-bind")), '@'));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ($(this).hasClass("mobile")) {
|
|
|
|
|
|
$("#" + $(this).attr("data-bind")).val(vals($(this).parent().find(".mobiledata" + $(this).attr("data-bind"))));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ($(this).hasClass("mobilefmt")) {
|
|
|
|
|
|
$(this).val(formatmobile($(this).val()));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ($(this).hasClass("telnofmt")) {
|
|
|
|
|
|
$(this).val(formatphone($(this).val()));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ($(this).hasClass("int") && isNaN(parseInt($(this).val(), 10))) {
|
|
|
|
|
|
if ($(this).attr("data-zero") != null) {
|
|
|
|
|
|
$(this).val("");
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$(this).val(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ($(this).hasClass("double") && isNaN(parseFloat($(this).val()))) {
|
|
|
|
|
|
if ($(this).attr("data-zero") != null) {
|
|
|
|
|
|
$(this).val("");
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$(this).val(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}).on("click", "input.int, input.double", function () {
|
|
|
|
|
|
$(this)[0].select();
|
|
|
|
|
|
}).on("focus", "input.int, input.double", function () {
|
|
|
|
|
|
//$(this).val($(this).val().replace(/,/gi, ''));
|
|
|
|
|
|
}).on("focusout", "input.datepicker-input", function () {
|
|
|
|
|
|
var v = $(this).val().replace(/[^0-9]/g, '');
|
|
|
|
|
|
if (v.length != 8) {
|
|
|
|
|
|
$(this).val("");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
$(this).val(v.substr(0, 4) + "-" + v.substr(4, 2) + "-" + v.substr(6));
|
|
|
|
|
|
}
|
|
|
|
|
|
}).on("focusout", "input.int, input.double", function () {
|
|
|
|
|
|
focusoutobj = $(this);
|
|
|
|
|
|
if (!$(this).hasClass("nocomma")) {
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
var fv = $.trim($(focusoutobj).val());
|
|
|
|
|
|
bindComma2(fv);
|
|
|
|
|
|
}, 10);
|
|
|
|
|
|
}
|
|
|
|
|
|
}).on("click", ".fileuploadbutton", function () {
|
|
|
|
|
|
$(this).closest(".filebox").find("input.fileitem").click();
|
|
|
|
|
|
}).on("click", "a.newlink", function () {
|
|
|
|
|
|
var aurl = $("#" + $(this).attr("data-urlid")).val();
|
|
|
|
|
|
if (aurl != "") {
|
|
|
|
|
|
window.open("http://" + aurl);
|
|
|
|
|
|
}
|
|
|
|
|
|
}).on("click", "div#msgtemp", function () {
|
|
|
|
|
|
$(this).hide();
|
|
|
|
|
|
}).on("click", ".closethisbox", function () {
|
|
|
|
|
|
if (($(this).attr("data-click") || "") != "") {
|
|
|
|
|
|
eval($(this).attr("data-click"));
|
|
|
|
|
|
}
|
2024-10-02 10:02:41 +09:00
|
|
|
|
$(this).closest('.findbox').slideUp('fast', function () {
|
|
|
|
|
|
$('#bglayer').hide();
|
|
|
|
|
|
});
|
2020-10-12 14:39:23 +09:00
|
|
|
|
}).on("change", ".filebox input.fileitem", function () {
|
|
|
|
|
|
var _ext = $(this).attr("data-ext").toUpperCase();
|
|
|
|
|
|
if ($(this).val() != "" && _ext != "*" && _ext != "") {
|
|
|
|
|
|
var _extf = $(this).val().split('.')[$(this).val().split('.').length - 1].toUpperCase();
|
|
|
|
|
|
if (_ext.indexOf("|" + _extf + "|") < 0) {
|
|
|
|
|
|
alert("올바른 파일이 아닙니다.");
|
|
|
|
|
|
$(this).val("");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
$(this).closest(".filebox").find(".fileuploadlabel").val($(this).val());
|
|
|
|
|
|
}).on("keydown", ".findbox input.search", function (e) {
|
|
|
|
|
|
if (e.keyCode == 13) {
|
|
|
|
|
|
$(this).parent().find("a.btn-find").click();
|
|
|
|
|
|
}
|
|
|
|
|
|
}).on("keydown", ".devsearch input.esitem", function (e) {
|
|
|
|
|
|
if (e.keyCode == 13) {
|
|
|
|
|
|
$(this).parents("form").submit();
|
|
|
|
|
|
}
|
|
|
|
|
|
}).on("keydown", "input.isIp", function (e) {
|
|
|
|
|
|
if ((e.keyCode < 8 || e.keyCode > 9) && (e.keyCode < 48 || e.keyCode > 57) && (e.keyCode < 96 && e.keyCode > 105) && e.keyCode !== 46) { Prevent(); }
|
|
|
|
|
|
}).on("click", "td.breakword", function (e) {
|
|
|
|
|
|
if ($(this).hasClass("breakwordok")) {
|
|
|
|
|
|
$(this).removeClass("breakwordok");
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$(this).addClass("breakwordok");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$("body").on("keydown", "input[type=text], input[type=password]", function (e) {
|
|
|
|
|
|
if (e.keyCode == 13) {
|
|
|
|
|
|
var index = $('input[type=text], input[type=password]').index(this) + 1;
|
|
|
|
|
|
$('input[type=text], input[type=password]').eq(index).focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$("body").on("focus", "input[type=text]", function () {
|
|
|
|
|
|
$(this).attr("autocomplete", "off");
|
|
|
|
|
|
if (!$(this).hasClass("readinput")) {
|
|
|
|
|
|
$(this)[0].select();
|
|
|
|
|
|
}
|
|
|
|
|
|
}).on("keydown", function (e) {
|
|
|
|
|
|
if (e.keyCode == 113) {
|
|
|
|
|
|
$(".draggable").draggable();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$(document).on("click", "a", function (e) {
|
|
|
|
|
|
if ($(this).attr("href") == "#") {
|
|
|
|
|
|
prv();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$(document).on("click", "tr.data", function () {
|
|
|
|
|
|
$(this).parent().find("tr.data").removeClass("focus");
|
|
|
|
|
|
$(this).addClass("focus");
|
|
|
|
|
|
}).on("click", "tbody.data tr", function () {
|
|
|
|
|
|
$(this).closest("tbody").find("tr").removeClass("active");
|
|
|
|
|
|
$(this).addClass("active");
|
|
|
|
|
|
}).on("change", ".searchbox input, .searchbox select", function () {
|
|
|
|
|
|
if ($(this).attr("name") != 'excelfile') {
|
|
|
|
|
|
$("table#" + $(this).parents(".searchbox").attr("data-clearid")).find("tr.data").remove();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$(document).on("change", ".datetime, .autobind", function () {
|
|
|
|
|
|
if ($(this).hasClass("datetime")) {
|
|
|
|
|
|
$(this).parent().find("input[name='" + $(this).attr("data-groupname") + "']").val($(this).val());
|
|
|
|
|
|
}
|
|
|
|
|
|
else if ($(this).hasClass("autobind")) {
|
|
|
|
|
|
var v = $("#" + $(this).attr("data-autobind")).val();
|
|
|
|
|
|
var cv = $(this).val();
|
|
|
|
|
|
if ($(this).prop("checked") && ("," + v + ",").indexOf("," + cv + ",") < 0) {
|
|
|
|
|
|
$("#" + $(this).attr("data-autobind")).val(v == "" ? cv : (v += "," + cv));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (!$(this).prop("checked") && ("," + v + ",").indexOf("," + cv + ",") > -1) {
|
|
|
|
|
|
var nv = "";
|
|
|
|
|
|
$.each($(v.split(',')), function (i, d) {
|
|
|
|
|
|
if (cv != d) {
|
|
|
|
|
|
nv += "," + d;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#" + $(this).attr("data-autobind")).val(nv == "" ? "" : nv.substr(1));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$("input.readtext").prop("readonly", true);
|
|
|
|
|
|
$(".devsearch input, .devsearch select").on("change", function () {
|
|
|
|
|
|
var rf = $(this).closest(".devsearch").attr("data-cleartbody") || "";
|
|
|
|
|
|
if (rf != "") {
|
|
|
|
|
|
$.each(rf.split(';'), function (i, t) {
|
|
|
|
|
|
$("#" + t + " tr").remove();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#pagenum").val(1);
|
|
|
|
|
|
});
|
|
|
|
|
|
$(".searchtext").on("keydown", function () {
|
|
|
|
|
|
$("#pagenum").val(1);
|
|
|
|
|
|
});
|
|
|
|
|
|
$("body").on("change", "input[type=file]", function (e) {
|
|
|
|
|
|
var _maxupsize = ($(this).attr("data-max") || "") == "" ? maxupsize : getint(($(this).attr("data-max") || ""));
|
|
|
|
|
|
if ($(this).val() != "") {
|
|
|
|
|
|
if (($(this)[0].files || "?") != "?") {
|
|
|
|
|
|
if ($(this)[0].files.length > 0 && $(this)[0].files[0].size > _maxupsize) {
|
|
|
|
|
|
$(this).val("");
|
|
|
|
|
|
alert("최대업로드용량은 " + _maxupsize + " Byte 입니다.");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
bindCommaAll();
|
|
|
|
|
|
$(".ff").focus();
|
|
|
|
|
|
});
|