2024/01/16 table caption script 추가
This commit is contained in:
parent
b20d9fc5ea
commit
7ecdaded3f
@ -1,19 +1,21 @@
|
||||
$(window).on("load",function () {
|
||||
$(window).on("load", function () {
|
||||
|
||||
//체크박스,라디오버튼 disabled 시 스크린리더가 건너뛰기때문에 태그 추가하여 읽게 만듦 20220503
|
||||
$("input[type='checkbox'],input[type='radio']").each(function(){
|
||||
$("input[type='checkbox'],input[type='radio']").each(function () {
|
||||
var chxDisabled = $(this).prop("disabled");
|
||||
if (chxDisabled == true){
|
||||
if (chxDisabled == true) {
|
||||
var chxLabel = $(this).next("label").text();
|
||||
var chxChecked = $(this).prop("checked");
|
||||
if(chxChecked == true){
|
||||
$(this).next("label").after("<span class='chx_label'>"+chxLabel+' 체크됨'+"</span>");
|
||||
} else {$(this).next("label").after("<span class='chx_label'>"+chxLabel+"</span>");}
|
||||
if (chxChecked == true) {
|
||||
$(this).next("label").after("<span class='chx_label'>" + chxLabel + ' 체크됨' + "</span>");
|
||||
} else {
|
||||
$(this).next("label").after("<span class='chx_label'>" + chxLabel + "</span>");
|
||||
}
|
||||
} else {}
|
||||
});
|
||||
|
||||
$(".duet-date__toggle").attr("title","달력 열림");
|
||||
});
|
||||
$(".duet-date__toggle").attr("title", "달력 열림");
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
@ -55,10 +57,10 @@ $(document).ready(function () {
|
||||
timeInput();
|
||||
|
||||
$('.yearSelect').yearselect({
|
||||
start : 1970,
|
||||
end : 2050,
|
||||
start: 1970,
|
||||
end: 2050,
|
||||
selected: new Date().getFullYear(),
|
||||
order:'desc'
|
||||
order: 'desc'
|
||||
});
|
||||
|
||||
|
||||
@ -66,19 +68,19 @@ $(document).ready(function () {
|
||||
birthSelectBoxDraw();
|
||||
|
||||
|
||||
$('.popup_wrap input[type="text"], .popup_wrap input[type="number"], .popup_wrap input[type="tel"]').keydown(function(){
|
||||
if(event.keyCode === 13){
|
||||
$('.popup_wrap input[type="text"], .popup_wrap input[type="number"], .popup_wrap input[type="tel"]').keydown(function () {
|
||||
if (event.keyCode === 13) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$(".tab_li.on .tab_button").attr("title","선택됨");
|
||||
$(".tab_li.on .tab_button").attr("title", "선택됨");
|
||||
|
||||
// tab 클릭시
|
||||
$('.tab_button').on('click',function(){
|
||||
$('.tab_button').on('click', function () {
|
||||
var tabNum = $(this).closest(".tab_li").index();
|
||||
$(this).closest(".tab_li").addClass("on").siblings(".tab_li").removeClass("on");
|
||||
$(this).attr("title","선택됨");
|
||||
$(this).attr("title", "선택됨");
|
||||
$('.tab_content').eq(tabNum).addClass("on").siblings('.tab_content').removeClass('on');
|
||||
$(this).closest(".tab_li").siblings(".tab_li").find(".tab_button").removeAttr("title");
|
||||
});
|
||||
@ -86,73 +88,74 @@ $(document).ready(function () {
|
||||
|
||||
})
|
||||
|
||||
function birthSelectBoxDraw(){
|
||||
function birthSelectBoxDraw() {
|
||||
$('.birthYear').yearselect({
|
||||
start : 1900,
|
||||
end : new Date().getFullYear(),
|
||||
start: 1900,
|
||||
end: new Date().getFullYear(),
|
||||
emptyOption: true,
|
||||
emptyText: '선택',
|
||||
selected:'',
|
||||
order:'desc'
|
||||
selected: '',
|
||||
order: 'desc'
|
||||
})
|
||||
// 년도를 바꾼다면 일자를 다시 선택하기
|
||||
$('.birthYear').change(function(){
|
||||
if($(this).next().next().next().next('select.birthDay')){
|
||||
if(Number($(this).next().next().next().next('select.birthDay').val()) > 28){
|
||||
$('.birthYear').change(function () {
|
||||
if ($(this).next().next().next().next('select.birthDay')) {
|
||||
if (Number($(this).next().next().next().next('select.birthDay').val()) > 28) {
|
||||
dayDraw($(this).next().next().next().next('select.birthDay'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.each($(".birthMonth"), function(idx, elm){
|
||||
$.each($(".birthMonth"), function (idx, elm) {
|
||||
var selectValue = $(this).attr('selectValue');
|
||||
$(this).append($('<option>').text('선택').val(''));
|
||||
for(var i=0; i < 12; i ++){
|
||||
for (var i = 0; i < 12; i++) {
|
||||
var option = $('<option/>');
|
||||
var month = i+1;
|
||||
month = month < 10 ? '0'+month : month;
|
||||
var month = i + 1;
|
||||
month = month < 10 ? '0' + month : month;
|
||||
option.val(month);
|
||||
option.text(month+'월');
|
||||
option.text(month + '월');
|
||||
$(this).append(option);
|
||||
}
|
||||
|
||||
if(isNotEmpty(selectValue)){
|
||||
if (isNotEmpty(selectValue)) {
|
||||
$(this).val(selectValue);
|
||||
}
|
||||
|
||||
// 일자가 존재한다면..
|
||||
if($(this).next().next('select.birthDay')){
|
||||
$(this).change(function(){
|
||||
if ($(this).next().next('select.birthDay')) {
|
||||
$(this).change(function () {
|
||||
dayDraw($(this).next().next('select.birthDay'));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$.each($(".birthDay"), function(idx, value){
|
||||
$.each($(".birthDay"), function (idx, value) {
|
||||
dayDraw($(this));
|
||||
});
|
||||
}
|
||||
function dayDraw(obj){
|
||||
|
||||
function dayDraw(obj) {
|
||||
var selectValue = $(obj).attr('selectValue');
|
||||
var selectMonth = $(obj).prev().prev('select.birthMonth').val();
|
||||
var selectYear = $(obj).prev().prev().prev().prev('select.birthYear').val();
|
||||
var lastDay = '';
|
||||
if(isNotEmpty(selectMonth) && isNotEmpty(selectYear)){
|
||||
if (isNotEmpty(selectMonth) && isNotEmpty(selectYear)) {
|
||||
lastDay = new Date(selectYear, selectMonth, 0).getDate();
|
||||
}
|
||||
$(obj).children('option').remove();
|
||||
$(obj).append($('<option>').text('선택').val(''));
|
||||
if(isNotEmpty(lastDay)){
|
||||
for(var i=0; i < lastDay; i ++){
|
||||
if (isNotEmpty(lastDay)) {
|
||||
for (var i = 0; i < lastDay; i++) {
|
||||
var option = $('<option/>');
|
||||
var day = i+1;
|
||||
day = day < 10 ? '0'+day : day;
|
||||
var day = i + 1;
|
||||
day = day < 10 ? '0' + day : day;
|
||||
|
||||
option.val(day);
|
||||
option.text(day+'일');
|
||||
option.text(day + '일');
|
||||
$(obj).append(option);
|
||||
}
|
||||
if(isNotEmpty(selectValue)){
|
||||
if (isNotEmpty(selectValue)) {
|
||||
$(obj).val(selectValue);
|
||||
}
|
||||
}
|
||||
@ -257,13 +260,12 @@ function dayDraw(obj){
|
||||
}*/
|
||||
|
||||
// 예약 시간 설정 추가
|
||||
function date_mask(objValue){
|
||||
function date_mask(objValue) {
|
||||
var v = objValue;
|
||||
if (v.match(/^\d{2}$/) !== null) {
|
||||
if(event.keyCode == "8"){
|
||||
if (event.keyCode == "8") {
|
||||
// 백스페이스 키를 누를 때 '-' 안생기게
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
v = v + ':';
|
||||
}
|
||||
}
|
||||
@ -271,8 +273,9 @@ function date_mask(objValue){
|
||||
|
||||
}
|
||||
|
||||
var timeInputHouBak=0,
|
||||
timeInputMinBak=0;
|
||||
var timeInputHouBak = 0,
|
||||
timeInputMinBak = 0;
|
||||
|
||||
function timeInput() {
|
||||
|
||||
/*$('.table_time_wrap .time_wrap').find(".time").change(function(){
|
||||
@ -381,7 +384,7 @@ function timeInput() {
|
||||
});*/
|
||||
|
||||
/* time layer 작업영역 */
|
||||
$('.table_time_wrap .time_wrap .time_layer').find(".ampm_select,.hours_select,.min_select").change(function(){
|
||||
$('.table_time_wrap .time_wrap .time_layer').find(".ampm_select,.hours_select,.min_select").change(function () {
|
||||
var td = $(this).closest('td');
|
||||
var len = td.find(".time_wrap").length;
|
||||
var timeWarp = $(this).closest('.time_wrap');
|
||||
@ -398,9 +401,9 @@ function timeInput() {
|
||||
var time = '';
|
||||
var minute = '';
|
||||
|
||||
if(len > 1){
|
||||
if(idx == 1){
|
||||
otherObj = td.find('.time_wrap:eq('+0+')');
|
||||
if (len > 1) {
|
||||
if (idx == 1) {
|
||||
otherObj = td.find('.time_wrap:eq(' + 0 + ')');
|
||||
otherHouTxt = otherObj.find(".hours_select option:selected").val();
|
||||
otherMinTxt = otherObj.find(".min_select option:selected").val();
|
||||
diffStartTime = otherHouTxt + otherMinTxt;
|
||||
@ -410,8 +413,8 @@ function timeInput() {
|
||||
time = houTxt - otherHouTxt;
|
||||
minute = minTxt - otherMinTxt;
|
||||
|
||||
}else{
|
||||
otherObj = td.find('.time_wrap:eq('+1+')');
|
||||
} else {
|
||||
otherObj = td.find('.time_wrap:eq(' + 1 + ')');
|
||||
otherHouTxt = otherObj.find(".hours_select option:selected").val();
|
||||
otherMinTxt = otherObj.find(".min_select option:selected").val();
|
||||
diffEndTime = otherHouTxt + otherMinTxt;
|
||||
@ -419,17 +422,17 @@ function timeInput() {
|
||||
time = otherHouTxt - houTxt;
|
||||
minute = otherMinTxt - minTxt;
|
||||
}
|
||||
if(diffStartTime.indexOf('선택') == -1 && diffEndTime.indexOf('선택') == -1){
|
||||
if (diffStartTime.indexOf('선택') == -1 && diffEndTime.indexOf('선택') == -1) {
|
||||
|
||||
if(diffStartTime > diffEndTime){
|
||||
if (diffStartTime > diffEndTime) {
|
||||
flag = false;
|
||||
alert(msg);
|
||||
timeWarp.find('.time').val('');
|
||||
}else{
|
||||
var lrnTm = (time*60)+minute;
|
||||
} else {
|
||||
var lrnTm = (time * 60) + minute;
|
||||
var scholDivCd = $("input[name=scholDivCd]:checked").val();
|
||||
|
||||
if(isNotEmpty(scholDivCd)){
|
||||
if (isNotEmpty(scholDivCd)) {
|
||||
|
||||
/*
|
||||
// 초등, 특수 , 기타
|
||||
@ -457,23 +460,23 @@ function timeInput() {
|
||||
td.find('.input_time').val('0');
|
||||
timeWarp.find('.time').val('');
|
||||
*/
|
||||
}else{
|
||||
if(lrnTm < VeConstants.ADULT_TM_60){
|
||||
alert('성인교육 최소시간 '+VeConstants.ADULT_TM_60+'분 이상이여야합니다.');
|
||||
} else {
|
||||
if (lrnTm < VeConstants.ADULT_TM_60) {
|
||||
alert('성인교육 최소시간 ' + VeConstants.ADULT_TM_60 + '분 이상이여야합니다.');
|
||||
$(this).focus();
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
if(flag){
|
||||
if (flag) {
|
||||
td.find('.input_time').val(lrnTm);
|
||||
}else{
|
||||
} else {
|
||||
timeWarp.find('.time').val('');
|
||||
td.find('.input_time').val('0');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(flag){
|
||||
if (flag) {
|
||||
timeWarp.find('.time').val(houTxt + ":" + minTxt);
|
||||
}
|
||||
|
||||
@ -530,7 +533,7 @@ function timeLayerUtil() {
|
||||
//교육신청 교육차시 정보 교육추가 버튼 클릭 시 tr추가
|
||||
function addEduClass1() {
|
||||
var eduTable = $(".tb_type02>table").find(">tbody");
|
||||
var trHtml="";
|
||||
var trHtml = "";
|
||||
|
||||
console.log(eduTable);
|
||||
|
||||
@ -564,19 +567,25 @@ function addEduClass1() {
|
||||
|
||||
//교육신청 교육차시 정보 교육추가 버튼 클릭 시 tr추가
|
||||
function addEduClassCopy(target) {
|
||||
var parent = $("."+target);
|
||||
var parent = $("." + target);
|
||||
var tr = parent.find("tbody > tr:first");
|
||||
var len = 0;
|
||||
|
||||
|
||||
|
||||
if(tr.length == 0){
|
||||
if (tr.length == 0) {
|
||||
alert('오류가 발생하였습니다. 관리자에게 문의해주세요.');
|
||||
return false;
|
||||
}
|
||||
var cloneObj = tr.clone(true);
|
||||
cloneObj.find("input[name=eduHopeDt]").closest("th,td").empty().append($('<div/>').addClass('calendar_wrap').append(
|
||||
$('<input/>').addClass('calendar').css({'width' : '80%'}).attr({'size' : '8', 'type' : 'text', 'name' : 'eduHopeDt'})
|
||||
$('<input/>').addClass('calendar').css({
|
||||
'width': '80%'
|
||||
}).attr({
|
||||
'size': '8',
|
||||
'type': 'text',
|
||||
'name': 'eduHopeDt'
|
||||
})
|
||||
));
|
||||
/* 청소년 */
|
||||
cloneObj.find('.ampm_select,.hours_select,.min_select').off("change");
|
||||
@ -587,9 +596,9 @@ function addEduClassCopy(target) {
|
||||
cloneObj.find('input[name=prsnl]').val('');
|
||||
cloneObj.find('input[name=lrnTm]').val('');
|
||||
|
||||
if(target == 'addClassRowClsrm'){
|
||||
if (target == 'addClassRowClsrm') {
|
||||
len = parent.find('tbody > tr').not('.calendar_wrap tr').length;
|
||||
cloneObj.find(">td:first").text(len+1);
|
||||
cloneObj.find(">td:first").text(len + 1);
|
||||
}
|
||||
/* 운영신청서 */
|
||||
cloneObj.find('input[name=lrnSbjct]').val('');
|
||||
@ -615,14 +624,14 @@ function addEduClassCopy(target) {
|
||||
|
||||
//교육신청 교육차시 정보 교육추가 버튼 클릭 시 tr추가
|
||||
function addEduClassCopyTngr(target) {
|
||||
var parent = $("."+target);
|
||||
var parent = $("." + target);
|
||||
var tr = parent.find("tbody > tr:first");
|
||||
var len = 0;
|
||||
var chkIdx = tr.find("select[name=divCd] option:selected").index()
|
||||
|
||||
|
||||
|
||||
if(tr.length == 0){
|
||||
if (tr.length == 0) {
|
||||
alert('오류가 발생하였습니다. 관리자에게 문의해주세요.');
|
||||
return false;
|
||||
}
|
||||
@ -637,29 +646,29 @@ function addEduClassCopyTngr(target) {
|
||||
cloneObj.find('.ampm_select,.hours_select,.min_select').off("change");
|
||||
cloneObj.find('input[name=strtTm]').val('');
|
||||
cloneObj.find('input[name=endTm]').val('');
|
||||
cloneObj.find('select[name=divCd] option:eq('+chkIdx+')').prop('selected', true);
|
||||
cloneObj.find('select[name=divCd] option:eq(' + chkIdx + ')').prop('selected', true);
|
||||
cloneObj.find('input[name=trgt]').val('');
|
||||
cloneObj.find('input[name=prsnl]').val('');
|
||||
cloneObj.find('input[name=lrnTm]').val('');
|
||||
|
||||
var index = parent.find("tbody > tr").not('.calendar_wrap tr').length;
|
||||
index = index +1;
|
||||
cloneObj.find('label[for=sel1]').attr('for', 'sel'+index);
|
||||
cloneObj.find('select[name=divCd]').attr('id', 'sel'+index);
|
||||
index = index + 1;
|
||||
cloneObj.find('label[for=sel1]').attr('for', 'sel' + index);
|
||||
cloneObj.find('select[name=divCd]').attr('id', 'sel' + index);
|
||||
|
||||
cloneObj.find('label[for=target]').attr('for', 'target'+index);
|
||||
cloneObj.find('#target').attr('id', 'target'+index);
|
||||
cloneObj.find('label[for=target]').attr('for', 'target' + index);
|
||||
cloneObj.find('#target').attr('id', 'target' + index);
|
||||
|
||||
cloneObj.find('label[for=personnel]').attr('for', 'personnel'+index);
|
||||
cloneObj.find('#personnel').attr('id', 'personnel'+index);
|
||||
cloneObj.find('label[for=personnel]').attr('for', 'personnel' + index);
|
||||
cloneObj.find('#personnel').attr('id', 'personnel' + index);
|
||||
|
||||
var duetdateleng = $("duet-date-picker").length+1;
|
||||
var duetdateleng = $("duet-date-picker").length + 1;
|
||||
|
||||
cloneObj.find(".calendar_th").append('<div class="calendar_wrap"><duet-date-picker identifier="date" class="startDate'+duetdateleng+'" name="eduHopeDt'+duetdateleng+'"></duet-date-picker></div>');
|
||||
cloneObj.find(".calendar_th").append('<div class="calendar_wrap"><duet-date-picker identifier="date" class="startDate' + duetdateleng + '" name="eduHopeDt' + duetdateleng + '"></duet-date-picker></div>');
|
||||
|
||||
if(target == 'addClassRowClsrm'){
|
||||
if (target == 'addClassRowClsrm') {
|
||||
len = parent.find('tbody > tr').not('.calendar_wrap tr').length;
|
||||
cloneObj.find(">td:first").text(len+1);
|
||||
cloneObj.find(">td:first").text(len + 1);
|
||||
}
|
||||
|
||||
/* 운영신청서 */
|
||||
@ -685,8 +694,8 @@ function addEduClassCopyTngr(target) {
|
||||
|
||||
var startDate = [];
|
||||
// 날짜 형식 YYYY.MM.DD 바꾸기
|
||||
for (var i = 2; i<=duetdateleng; i++){
|
||||
startDate[i] = document.querySelector(".startDate"+duetdateleng);
|
||||
for (var i = 2; i <= duetdateleng; i++) {
|
||||
startDate[i] = document.querySelector(".startDate" + duetdateleng);
|
||||
|
||||
var DATE_FORMAT = /^(\d{1,2})\.(\d{1,2})\.(\d{4})$/;
|
||||
|
||||
@ -746,8 +755,8 @@ function addEduClassCopyTngr(target) {
|
||||
}
|
||||
|
||||
startDate[i].addEventListener("duetOpen", function (e) {
|
||||
$(this).find(".duet-date__prev").attr("onclick","calendarPrev(this);");
|
||||
$(this).find(".duet-date__next").attr("onclick","calendarNext(this);");
|
||||
$(this).find(".duet-date__prev").attr("onclick", "calendarPrev(this);");
|
||||
$(this).find(".duet-date__next").attr("onclick", "calendarNext(this);");
|
||||
});
|
||||
|
||||
startDate[i].addEventListener("duetClose", function (e) {
|
||||
@ -755,35 +764,35 @@ function addEduClassCopyTngr(target) {
|
||||
startDtVal = e.target.value;
|
||||
startSub = startDtVal.replace(/\-/g, '');
|
||||
var startDate_name = $(this).attr("name");
|
||||
$(".startDate").each(function(idx,itm){
|
||||
$(".startDate").each(function (idx, itm) {
|
||||
$(this).find(".duet-date__input").attr("id", startDate_name);
|
||||
$(this).find(".duet-date__input").attr("name", startDate_name);
|
||||
console.log('startDate_name : ', startDate_name);
|
||||
$(this).find(".duet-date__input").attr("value", startSub);
|
||||
$(this).find(".duet-date__input").next().attr("name", startDate_name+"_submit");
|
||||
$(this).find(".duet-date__input").next().attr("name", startDate_name + "_submit");
|
||||
$(this).find(".duet-date__input").next().attr("value", startSub);
|
||||
});
|
||||
});
|
||||
|
||||
setTimeout(function(){
|
||||
// $(".duet-date__input").each(function(idx,itm){
|
||||
// $(itm).attr("name","eduHopeDt"+idx);
|
||||
// $(itm).attr("id","eduHopeDt"+idx);
|
||||
// $(itm).attr("title","교육희망일을 YYYY.MM.DD 형식으로 입력해주세요");
|
||||
// idx+=1;
|
||||
// });
|
||||
$("duet-date-picker .duet-date__input").attr("title","교육희망일을 YYYY.MM.DD 형식으로 입력해주세요");
|
||||
$("duet-date-picker .duet-date__input").each(function(idx,itm){
|
||||
$(itm).attr("name","eduHopeDt"+idx);
|
||||
$(itm).attr("id","eduHopeDt"+idx);
|
||||
setTimeout(function () {
|
||||
// $(".duet-date__input").each(function(idx,itm){
|
||||
// $(itm).attr("name","eduHopeDt"+idx);
|
||||
// $(itm).attr("id","eduHopeDt"+idx);
|
||||
// $(itm).attr("title","교육희망일을 YYYY.MM.DD 형식으로 입력해주세요");
|
||||
// idx+=1;
|
||||
// });
|
||||
$("duet-date-picker .duet-date__input").attr("title", "교육희망일을 YYYY.MM.DD 형식으로 입력해주세요");
|
||||
$("duet-date-picker .duet-date__input").each(function (idx, itm) {
|
||||
$(itm).attr("name", "eduHopeDt" + idx);
|
||||
$(itm).attr("id", "eduHopeDt" + idx);
|
||||
|
||||
idx+=1;
|
||||
idx += 1;
|
||||
});
|
||||
$("duet-date-picker .duet-date__input").attr('onkeydown','this.value=dateSetting(this.value);');
|
||||
$("duet-date-picker .duet-date__input").attr('onkeydown', 'this.value=dateSetting(this.value);');
|
||||
|
||||
|
||||
|
||||
},100);
|
||||
}, 100);
|
||||
|
||||
startDate[i].addEventListener("duetFocus", function (e) {
|
||||
calendarSetting();
|
||||
@ -792,93 +801,91 @@ function addEduClassCopyTngr(target) {
|
||||
calendarinputset();
|
||||
|
||||
|
||||
setTimeout(function(){
|
||||
$("duet-date-picker .duet-date__input").each(function(idx,itm){
|
||||
setTimeout(function () {
|
||||
$("duet-date-picker .duet-date__input").each(function (idx, itm) {
|
||||
//이벤트 추가 2023-12-08
|
||||
if ($(itm).attr('onblur')=="undefined" || $(itm).attr('onblur')==null){
|
||||
$(itm).attr('onblur','_fncEduHopeDt('+idx+');');
|
||||
if ($(itm).attr('onblur') == "undefined" || $(itm).attr('onblur') == null) {
|
||||
$(itm).attr('onblur', '_fncEduHopeDt(' + idx + ');');
|
||||
//alert("inin");
|
||||
}else{
|
||||
} else {
|
||||
//alert("outout");
|
||||
}
|
||||
|
||||
idx+=1;
|
||||
idx += 1;
|
||||
});
|
||||
|
||||
//이벤트 추가 2023-12-08
|
||||
$("duet-date-picker .duet-date__dialog").each(function(idx,itm){
|
||||
$("duet-date-picker .duet-date__dialog").each(function (idx, itm) {
|
||||
|
||||
if ($(itm).attr('onclick')=="undefined" || $(itm).attr('onclick')==null){
|
||||
$(itm).attr('onclick','_fncEduHopeDt('+idx+');');
|
||||
if ($(itm).attr('onclick') == "undefined" || $(itm).attr('onclick') == null) {
|
||||
$(itm).attr('onclick', '_fncEduHopeDt(' + idx + ');');
|
||||
//alert("inin");
|
||||
}else{
|
||||
} else {
|
||||
//alert("outout");
|
||||
}
|
||||
|
||||
|
||||
|
||||
idx+=1;
|
||||
idx += 1;
|
||||
|
||||
});
|
||||
|
||||
|
||||
},100);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function calendarPrev(itm){
|
||||
function calendarPrev(itm) {
|
||||
var monthText = $(itm).closest(".duet-date__dialog-content").find(".duet-date__select--month").val();
|
||||
var yearText = $(itm).closest(".duet-date__dialog-content").find(".duet-date__select--year").val();
|
||||
$(".duet-date__select--month").attr("title","달 선택");
|
||||
$(".duet-date__select--year").attr("title","년도 선택");
|
||||
$(".duet-date__select--month").attr("title", "달 선택");
|
||||
$(".duet-date__select--year").attr("title", "년도 선택");
|
||||
monthText = Number(monthText) + 1;
|
||||
monthText = monthText+"월";
|
||||
yearText = yearText+"년 ";
|
||||
monthText = monthText + "월";
|
||||
yearText = yearText + "년 ";
|
||||
$(itm).closest(".duet-date__dialog-content").find(".duet-date__table caption").remove();
|
||||
$(itm).closest(".duet-date__dialog-content").find(".duet-date__table").prepend("<caption>"+yearText+ monthText+" 달력입니다.</caption>");
|
||||
$(itm).closest(".duet-date__dialog-content").find(".duet-date__table").prepend("<caption>" + yearText + monthText + " 달력입니다.</caption>");
|
||||
}
|
||||
|
||||
function calendarNext(itm){
|
||||
function calendarNext(itm) {
|
||||
var monthText = $(itm).closest(".duet-date__dialog-content").find(".duet-date__select--month").val();
|
||||
var yearText = $(itm).closest(".duet-date__dialog-content").find(".duet-date__select--year").val();
|
||||
$(".duet-date__select--month").attr("title","달 선택");
|
||||
$(".duet-date__select--year").attr("title","년도 선택");
|
||||
$(".duet-date__select--month").attr("title", "달 선택");
|
||||
$(".duet-date__select--year").attr("title", "년도 선택");
|
||||
monthText = Number(monthText) + 1;
|
||||
monthText = monthText+"월";
|
||||
yearText = yearText+"년 ";
|
||||
monthText = monthText + "월";
|
||||
yearText = yearText + "년 ";
|
||||
$(itm).closest(".duet-date__dialog-content").find(".duet-date__table caption").remove();
|
||||
$(itm).closest(".duet-date__dialog-content").find(".duet-date__table").prepend("<caption>"+yearText+ monthText+" 달력입니다.</caption>");
|
||||
$(itm).closest(".duet-date__dialog-content").find(".duet-date__table").prepend("<caption>" + yearText + monthText + " 달력입니다.</caption>");
|
||||
}
|
||||
|
||||
|
||||
function calendarinputset(){
|
||||
$('.calendar_wrap').each(function(){
|
||||
$(this).find('.duet-date__input').attr('onkeydown','this.value=dateSetting(this.value);');
|
||||
function calendarinputset() {
|
||||
$('.calendar_wrap').each(function () {
|
||||
$(this).find('.duet-date__input').attr('onkeydown', 'this.value=dateSetting(this.value);');
|
||||
});
|
||||
}
|
||||
|
||||
function dateSetting(objValue) {
|
||||
var v = objValue.replace("..", ".");
|
||||
if (v.match(/^\d{4}$/) !== null) {
|
||||
if(event.keyCode == "8"){
|
||||
if (event.keyCode == "8") {
|
||||
// 백스페이스 키를 누를 때 '.' 안생기게
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
v = v + '.';
|
||||
}
|
||||
} else if (v.match(/^\d{4}\.\d{2}$/) !== null) {
|
||||
if(event.keyCode == "8"){
|
||||
if (event.keyCode == "8") {
|
||||
// 백스페이스 키를 누를 때 '.' 안생기게
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
v = v + '.';
|
||||
}
|
||||
}
|
||||
|
||||
// '-' 막기
|
||||
if(event.keyCode == "189" || event.keyCode == "109"){
|
||||
if (event.keyCode == "189" || event.keyCode == "109") {
|
||||
event.preventDefault();
|
||||
return v;
|
||||
}else{}
|
||||
} else {}
|
||||
|
||||
return v;
|
||||
}
|
||||
@ -890,19 +897,19 @@ function tableDel(item) {
|
||||
var len = obj.length;
|
||||
var limit = objTb.attr('rowLimit');
|
||||
|
||||
if(limit == undefined){
|
||||
if (limit == undefined) {
|
||||
limit = 1;
|
||||
}
|
||||
if(len == limit){
|
||||
alert('최소 '+limit+'차시 이상 가능합니다.');
|
||||
if (len == limit) {
|
||||
alert('최소 ' + limit + '차시 이상 가능합니다.');
|
||||
return false;
|
||||
}else{
|
||||
} else {
|
||||
$(item).closest("tr").remove();
|
||||
var num = objTb.attr('num');
|
||||
if(num != undefined){
|
||||
var newObj = $('.'+selector+' > tbody').find('>tr');
|
||||
$.each(newObj ,function(idx){
|
||||
$(this).find('td:eq('+num+')').text(idx+1);
|
||||
if (num != undefined) {
|
||||
var newObj = $('.' + selector + ' > tbody').find('>tr');
|
||||
$.each(newObj, function (idx) {
|
||||
$(this).find('td:eq(' + num + ')').text(idx + 1);
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -912,169 +919,169 @@ function tableDel(item) {
|
||||
|
||||
|
||||
//강의지역 체크 리스트
|
||||
$(function(){
|
||||
$('.river_area .city input[type=checkbox]').on('change',function(){
|
||||
var len=$('.river_area .city input[name=areaCd]:checked').length;
|
||||
var total=Number($('.river_area .total').text());
|
||||
$(function () {
|
||||
$('.river_area .city input[type=checkbox]').on('change', function () {
|
||||
var len = $('.river_area .city input[name=areaCd]:checked').length;
|
||||
var total = Number($('.river_area .total').text());
|
||||
|
||||
if($(this).hasClass('county_all') && !$(this).is(':checked')){
|
||||
var allLen=Number($(this).siblings('ul').find('li').length);
|
||||
total=total-allLen;
|
||||
}else{
|
||||
if(total>len){
|
||||
total=total-1;
|
||||
}else{
|
||||
total=len;
|
||||
if ($(this).hasClass('county_all') && !$(this).is(':checked')) {
|
||||
var allLen = Number($(this).siblings('ul').find('li').length);
|
||||
total = total - allLen;
|
||||
} else {
|
||||
if (total > len) {
|
||||
total = total - 1;
|
||||
} else {
|
||||
total = len;
|
||||
}
|
||||
}
|
||||
|
||||
if($(this).attr('id')=='cityAll' && !$(this).is(':checked')){
|
||||
total=0;
|
||||
if ($(this).attr('id') == 'cityAll' && !$(this).is(':checked')) {
|
||||
total = 0;
|
||||
}
|
||||
$('.river_area .total').html(total);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function countyView(a){
|
||||
var target=$(a);
|
||||
if(target.hasClass('active')){
|
||||
function countyView(a) {
|
||||
var target = $(a);
|
||||
if (target.hasClass('active')) {
|
||||
target.removeClass('active').siblings('ul').removeClass('active');
|
||||
target.attr('title','하위지역 열기');
|
||||
}else{
|
||||
target.attr('title', '하위지역 열기');
|
||||
} else {
|
||||
target.addClass('active').siblings('ul').addClass('active');
|
||||
target.attr('title','하위지역 닫기')
|
||||
}
|
||||
target.attr('title', '하위지역 닫기')
|
||||
}
|
||||
}
|
||||
|
||||
function cityChkAll(a){
|
||||
var target=$(a);
|
||||
if(target.is(':checked')){
|
||||
$('.city input[type=checkbox]').prop('checked',true);
|
||||
function cityChkAll(a) {
|
||||
var target = $(a);
|
||||
if (target.is(':checked')) {
|
||||
$('.city input[type=checkbox]').prop('checked', true);
|
||||
$('.area_list .area').remove();
|
||||
for(var i=0;i<$('.city .list').length-1;i++){
|
||||
var target=$('.city .list').eq(i+1);
|
||||
var area=$('.river_area .area_list');
|
||||
var len=target.find('ul li').length;
|
||||
var txt=target.find('.county').text();
|
||||
var d=target.find('.county').attr('data');
|
||||
area.append('<li class="area area'+d+'" data="'+d+'">· '+txt+' <span>'+len+'</span>개 지역</li>');
|
||||
for (var i = 0; i < $('.city .list').length - 1; i++) {
|
||||
var target = $('.city .list').eq(i + 1);
|
||||
var area = $('.river_area .area_list');
|
||||
var len = target.find('ul li').length;
|
||||
var txt = target.find('.county').text();
|
||||
var d = target.find('.county').attr('data');
|
||||
area.append('<li class="area area' + d + '" data="' + d + '">· ' + txt + ' <span>' + len + '</span>개 지역</li>');
|
||||
}
|
||||
}else{
|
||||
$('.city input[type=checkbox]').prop('checked',false);
|
||||
} else {
|
||||
$('.city input[type=checkbox]').prop('checked', false);
|
||||
$('.area_list .area').remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function countyAll(a){
|
||||
var target=$(a);
|
||||
var area=$('.river_area .area_list');
|
||||
var len=target.siblings('ul').find('input[type=checkbox]').length;
|
||||
var chkLen=target.siblings('ul').find('input[type=checkbox]:checked').length;
|
||||
var allLen=$('.city input[name=countyAll]').length;
|
||||
var allChkLen=$('.city input[name=countyAll]:checked').length;
|
||||
var txt=target.siblings('.county').text();
|
||||
var d=target.siblings('.county').attr('data');
|
||||
function countyAll(a) {
|
||||
var target = $(a);
|
||||
var area = $('.river_area .area_list');
|
||||
var len = target.siblings('ul').find('input[type=checkbox]').length;
|
||||
var chkLen = target.siblings('ul').find('input[type=checkbox]:checked').length;
|
||||
var allLen = $('.city input[name=countyAll]').length;
|
||||
var allChkLen = $('.city input[name=countyAll]:checked').length;
|
||||
var txt = target.siblings('.county').text();
|
||||
var d = target.siblings('.county').attr('data');
|
||||
|
||||
if(target.is(':checked')){
|
||||
target.siblings('ul').find('input[type=checkbox]').prop('checked',true);
|
||||
if (target.is(':checked')) {
|
||||
target.siblings('ul').find('input[type=checkbox]').prop('checked', true);
|
||||
console.log(target.siblings('ul').find('input[type=checkbox]'));
|
||||
}else{
|
||||
target.siblings('ul').find('input[type=checkbox]').prop('checked',false);
|
||||
$('.city input[name=cityAll]').prop('checked',false);
|
||||
} else {
|
||||
target.siblings('ul').find('input[type=checkbox]').prop('checked', false);
|
||||
$('.city input[name=cityAll]').prop('checked', false);
|
||||
}
|
||||
|
||||
if(allLen==allChkLen){
|
||||
$('.city input[name=cityAll]').prop('checked',true);
|
||||
if (allLen == allChkLen) {
|
||||
$('.city input[name=cityAll]').prop('checked', true);
|
||||
}
|
||||
|
||||
if(target.is(':checked')){
|
||||
if(chkLen==0){
|
||||
area.append('<li class="area area'+d+'" data="'+d+'">· '+txt+' <span>'+len+'</span>개 지역</li>');
|
||||
}else{
|
||||
area.find('.area'+d+' span').text(len);
|
||||
if (target.is(':checked')) {
|
||||
if (chkLen == 0) {
|
||||
area.append('<li class="area area' + d + '" data="' + d + '">· ' + txt + ' <span>' + len + '</span>개 지역</li>');
|
||||
} else {
|
||||
area.find('.area' + d + ' span').text(len);
|
||||
}
|
||||
}else{
|
||||
area.find('.area'+d).remove();
|
||||
} else {
|
||||
area.find('.area' + d).remove();
|
||||
}
|
||||
}
|
||||
|
||||
//input의 name, id와 onclick 이벤트 이름이 countyAll로 동일해서 다른 이름의 같은 이벤트 추가
|
||||
function countyOneDepthAll(a) {
|
||||
var target = $(a);
|
||||
var area = $('.river_area .area_list');
|
||||
var len = target.siblings('ul').find('input[type=checkbox]').length;
|
||||
var chkLen = target.siblings('ul').find('input[type=checkbox]:checked').length;
|
||||
var allLen = $('.city input[name=countyAll]').length;
|
||||
var allChkLen = $('.city input[name=countyAll]:checked').length;
|
||||
var txt = target.siblings('.county').text();
|
||||
var d = target.siblings('.county').attr('data');
|
||||
|
||||
if (target.is(':checked')) {
|
||||
target.siblings('ul').find('input[type=checkbox]').prop('checked', true);
|
||||
} else {
|
||||
target.siblings('ul').find('input[type=checkbox]').prop('checked', false);
|
||||
$('.city input[name=cityAll]').prop('checked', false);
|
||||
}
|
||||
|
||||
//input의 name, id와 onclick 이벤트 이름이 countyAll로 동일해서 다른 이름의 같은 이벤트 추가
|
||||
function countyOneDepthAll(a){
|
||||
var target=$(a);
|
||||
var area=$('.river_area .area_list');
|
||||
var len=target.siblings('ul').find('input[type=checkbox]').length;
|
||||
var chkLen=target.siblings('ul').find('input[type=checkbox]:checked').length;
|
||||
var allLen=$('.city input[name=countyAll]').length;
|
||||
var allChkLen=$('.city input[name=countyAll]:checked').length;
|
||||
var txt=target.siblings('.county').text();
|
||||
var d=target.siblings('.county').attr('data');
|
||||
|
||||
if(target.is(':checked')){
|
||||
target.siblings('ul').find('input[type=checkbox]').prop('checked',true);
|
||||
}else{
|
||||
target.siblings('ul').find('input[type=checkbox]').prop('checked',false);
|
||||
$('.city input[name=cityAll]').prop('checked',false);
|
||||
if (allLen == allChkLen) {
|
||||
$('.city input[name=cityAll]').prop('checked', true);
|
||||
}
|
||||
|
||||
if(allLen==allChkLen){
|
||||
$('.city input[name=cityAll]').prop('checked',true);
|
||||
if (target.is(':checked')) {
|
||||
if (chkLen == 0) {
|
||||
area.append('<li class="area area' + d + '" data="' + d + '">· ' + txt + ' <span>' + len + '</span>개 지역</li>');
|
||||
} else {
|
||||
area.find('.area' + d + ' span').text(len);
|
||||
}
|
||||
} else {
|
||||
area.find('.area' + d).remove();
|
||||
}
|
||||
}
|
||||
|
||||
function countyChk(a) {
|
||||
var target = $(a);
|
||||
var list = target.closest('.list');
|
||||
var area = $('.river_area .area_list');
|
||||
var len = target.closest('ul').find('input[type=checkbox]').length;
|
||||
var chkLen = target.closest('ul').find('input[type=checkbox]:checked').length;
|
||||
var allLen = $('.city input[name=areaCd]').length;
|
||||
var allChkLen = $('.city input[name=areaCd]:checked').length;
|
||||
var txt = list.find('.county').text();
|
||||
var d = list.find('.county').attr('data');
|
||||
|
||||
if (len == chkLen) {
|
||||
list.find('input[name=countyAll]').prop('checked', true);
|
||||
} else {
|
||||
list.find('input[name=countyAll]').prop('checked', false);
|
||||
}
|
||||
|
||||
if(target.is(':checked')){
|
||||
if(chkLen==0){
|
||||
area.append('<li class="area area'+d+'" data="'+d+'">· '+txt+' <span>'+len+'</span>개 지역</li>');
|
||||
}else{
|
||||
area.find('.area'+d+' span').text(len);
|
||||
}
|
||||
}else{
|
||||
area.find('.area'+d).remove();
|
||||
}
|
||||
if (allLen == allChkLen) {
|
||||
$('.city input[name=cityAll]').prop('checked', true);
|
||||
} else {
|
||||
$('.city input[name=cityAll]').prop('checked', false);
|
||||
}
|
||||
|
||||
function countyChk(a){
|
||||
var target=$(a);
|
||||
var list=target.closest('.list');
|
||||
var area=$('.river_area .area_list');
|
||||
var len=target.closest('ul').find('input[type=checkbox]').length;
|
||||
var chkLen=target.closest('ul').find('input[type=checkbox]:checked').length;
|
||||
var allLen=$('.city input[name=areaCd]').length;
|
||||
var allChkLen=$('.city input[name=areaCd]:checked').length;
|
||||
var txt=list.find('.county').text();
|
||||
var d=list.find('.county').attr('data');
|
||||
|
||||
if(len==chkLen){
|
||||
list.find('input[name=countyAll]').prop('checked',true);
|
||||
}else{
|
||||
list.find('input[name=countyAll]').prop('checked',false);
|
||||
}
|
||||
|
||||
if(allLen==allChkLen){
|
||||
$('.city input[name=cityAll]').prop('checked',true);
|
||||
}else{
|
||||
$('.city input[name=cityAll]').prop('checked',false);
|
||||
}
|
||||
|
||||
if(chkLen==0){
|
||||
area.find('.area'+d).remove();
|
||||
}else{
|
||||
if($('.river_area .area_list .area'+d).attr('data')==d){
|
||||
area.find('.area'+d+' span').text(chkLen);
|
||||
}else{
|
||||
area.append('<li class="area area'+d+'" data="'+d+'">· '+txt+' <span>'+chkLen+'</span>개 지역</li>');
|
||||
}
|
||||
if (chkLen == 0) {
|
||||
area.find('.area' + d).remove();
|
||||
} else {
|
||||
if ($('.river_area .area_list .area' + d).attr('data') == d) {
|
||||
area.find('.area' + d + ' span').text(chkLen);
|
||||
} else {
|
||||
area.append('<li class="area area' + d + '" data="' + d + '">· ' + txt + ' <span>' + chkLen + '</span>개 지역</li>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 날짜 및 시간 입력 시 자동 작성 스크립트 */
|
||||
|
||||
$(document).ready(function () {
|
||||
$(document).ready(function () {
|
||||
|
||||
boardCaptionToggle();
|
||||
boardCaptionToggle02();
|
||||
boardCaptionToggle03();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function boardCaptionToggle() {
|
||||
/*function boardCaptionToggle() {
|
||||
var bdWid = $("body").width();
|
||||
var thLength = $(".tb_type01 th").length;
|
||||
if (bdWid > 640) {
|
||||
@ -1083,7 +1090,7 @@ $(function(){
|
||||
$(".tb_type01 th").each(function (index, item) {
|
||||
itmText += $(item).text();
|
||||
if (index === thLength - 1) {
|
||||
/* 마지막 th일 경우 - ,가 들어가면 안됨. */
|
||||
마지막 th일 경우 - ,가 들어가면 안됨.
|
||||
itmText;
|
||||
} else {
|
||||
itmText += ", ";
|
||||
@ -1105,4 +1112,94 @@ $(function(){
|
||||
} else {
|
||||
$(".tb_type01 caption").remove();
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
function boardCaptionToggle() {
|
||||
var thLength = $(".tb_type01 th").length;
|
||||
$(".tb_type01").each(function (idx, itm) {
|
||||
var subTit = $(itm).prev(".tb_tit01").find(".tb_tit01_left p").text();
|
||||
var thText = "";
|
||||
$(itm).find("th").each(function (index, item) {
|
||||
thText += $(item).text();
|
||||
if (index === thLength - 1) {
|
||||
//마지막 th일 경우 - ,가 들어가면 안됨.
|
||||
thText;
|
||||
} else {
|
||||
thText += ", ";
|
||||
}
|
||||
|
||||
})
|
||||
if ($(".tb_type01 caption").length == 0) {
|
||||
if($(itm).is(".tb_input")){
|
||||
$(itm).find("table").prepend("<caption>" + subTit + " : " + thText + "등의 정보입력 </caption>");
|
||||
}else{
|
||||
$(itm).find("table").prepend("<caption>" + subTit + " : " + thText + "등의 정보제공 </caption>");
|
||||
}
|
||||
|
||||
} else {
|
||||
$(itm).find("caption").remove();
|
||||
if($(itm).is(".tb_input")){
|
||||
$(itm).find("table").prepend("<caption>" + subTit + " : " + thText + "등의 정보입력 </caption>");
|
||||
}else{
|
||||
$(itm).find("table").prepend("<caption>" + subTit + " : " + thText + "등의 정보제공 </caption>");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
function boardCaptionToggle02() {
|
||||
var thLength = $(".tb_list01 th").length;
|
||||
$(".tb_list01").each(function (idx, itm) {
|
||||
var subTit = $(itm).siblings(".cont_tit").find("h2").text()
|
||||
var thText = "";
|
||||
$(itm).find("th").each(function (index, item) {
|
||||
thText += $(item).text();
|
||||
if (index === thLength - 1) {
|
||||
//마지막 th일 경우 - ,가 들어가면 안됨.
|
||||
thText;
|
||||
} else {
|
||||
thText += ", ";
|
||||
}
|
||||
|
||||
})
|
||||
if ($(".tb_list01 caption").length == 0) {
|
||||
$(itm).find("table").prepend("<caption>" + subTit + " : " + thText + "등의 정보제공 </caption>");
|
||||
} else {
|
||||
$(itm).find("caption").remove();
|
||||
$(itm).find("table").prepend("<caption>" + subTit + " : " + thText + "등의 정보제공 </caption>");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function boardCaptionToggle03() {
|
||||
var thLength = $(".tb_type02 thead th").length;
|
||||
$(".tb_type02").each(function (idx, itm) {
|
||||
var subTit = $(itm).prev(".tb_tit01").find(".tb_tit01_left p").text();
|
||||
var thText = "";
|
||||
$(itm).find("thead th").each(function (index, item) {
|
||||
thText += $(item).text();
|
||||
if (index === thLength - 1) {
|
||||
//마지막 th일 경우 - ,가 들어가면 안됨.
|
||||
thText;
|
||||
} else {
|
||||
thText += ", ";
|
||||
}
|
||||
|
||||
})
|
||||
if ($(".tb_type02 caption").length == 0) {
|
||||
if($(itm).is(".tb_type02_write")){
|
||||
$(itm).find("table").prepend("<caption>" + subTit + " : " + thText + "등의 정보입력 </caption>");
|
||||
}else{
|
||||
$(itm).find("table").prepend("<caption>" + subTit + " : " + thText + "등의 정보제공 </caption>");
|
||||
}
|
||||
|
||||
} else {
|
||||
$(itm).find("caption").remove();
|
||||
if($(itm).is(".tb_type02_write")){
|
||||
$(itm).find("table").prepend("<caption>" + subTit + " : " + thText + "등의 정보입력 </caption>");
|
||||
}else{
|
||||
$(itm).find("table").prepend("<caption>" + subTit + " : " + thText + "등의 정보제공 </caption>");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user