// 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("
"); } 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("/gi, '').replace(/
/gi, '').replace(/<\/p>/gi, '').replace(/
/gi, '').replace(/
/gi, '').replace(/ /gi, '').replace(//gi, '').replace(/<\/b>/gi, '');
}
function editorSubmit(gi) {
gi = gi == undefined || gi == null ? 1 : gi;
var id;
$.each($(".editorarea"), function (i, r) {
if (gi == 2) {
//
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("로딩중입니다. 잠시만기다려주세요.");
//$("#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);
}
}
/* Post방식으로 동적폼을 생성하여 Submit
* parameter :
* url : action URL
* parameters : JSON Object
* target : 대상페이지 형태 (생략가능, '_blank', '_self')
* Exec :
* var p = {};
* p.userid = 'kim09';
* p.hakbunID = 'S000000001';
*
* postSubmit('/home/index', p);
* */
function postSubmit(url, parameters, target) {
if (typeof (parameters) === 'string') {
parameters = queryToJSON(parameters);
}
else if (parameters === undefined || parameters === null) {
parameters = {};
}
// _hiddenPostForm 이 존재하면 제거
var existingForm = document.getElementById('__hiddenPostForm');
if (existingForm) {
existingForm.remove();
}
// 새로운 form 요소 생성
var form = document.createElement('form');
form.id = '__hiddenPostForm';
form.action = url;
form.method = 'post';
form.target = (target === null || target === undefined) ? '_self' : target;
// parameters 처리
if (parameters !== null) {
for (var key in parameters) {
if (parameters.hasOwnProperty(key)) {
var input = document.createElement('input');
input.type = 'hidden';
input.value = parameters[key];
input.name = key;
input.id = key;
form.appendChild(input);
}
}
}
// form을 body에 추가
document.body.appendChild(form);
// form 제출
form.submit();
}
/* GetQuery 문자열을 JSON으로 변환
* parameter :
* query : URL의 쿼리스트링 (studentcode=S123456&id=kim01&grade=4)
* Exec :
* queryToJSON('studentcode=S123456&id=kim01&grade=4')
* Return :
* {studentcode: "S123456", id: "kim01", grade: "4"}
* */
function queryToJSON(query) {
// URL에서 '?' 제거
query = query.replace('?', '');
// '&'로 분리하여 키-값 쌍 배열 생성
var keyValueParts = query.split('&');
var jsonResult = {};
// 각 키-값 쌍에 대해 반복 처리
for (var i = 0; i < keyValueParts.length; i++) {
// '='로 나누어 키와 값을 분리
var keyValue = keyValueParts[i].split('=');
var key = keyValue[0];
var value = keyValue.length > 1 ? decodeURIComponent(keyValue[1]) : ''; // 값이 없으면 빈 문자열로 처리
// 결과 객체에 키-값 추가
jsonResult[key] = value;
}
return jsonResult;
}
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"));
}
$(this).closest('.findbox').slideUp('fast', function () {
$('#bglayer').hide();
});
}).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();
});