1/** 2 * ìëììí ììììí ë©ì¸ ì¤í¬ë¦½í¸ 3 * 4 * @author E.J Jeong 5 * @since 2020.07.10 6 **/ 7 8$(function() { 9 const scheduleModal = $('#schedule_modal'); 10 11 $('#schedule_modal button').click(function() { 12 fn_scheduleModal(scheduleModal); 13 }); 14 15 $('.btn_schedule_modal_open').click(function() { 16 const uid = $(this).data('uid'); 17 18 fn_scheduleModal(scheduleModal, uid); 19 }); 20 21 $('.btn_today_modal_open').click(function() { 22 const date = $(this).data('date'); 23 const cs_cd = $(this).data('cs_cd'); 24 25 fn_scheduleTodayModal(scheduleModal, date, cs_cd); 26 }); 27 28 // ìì¬ì¼ì 29 $("#agenda .list_wrap").slick({ 30 dots:false, 31 vertical:true, 32 infinite:false, 33 autoplay:true, 34 slidesToShow:1, 35 slidesToScroll:1, 36 nextArrow:"#bt_a_next", 37 prevArrow:"#bt_a_prev", 38 }); 39 $("#bt_a_stop").click(function() { 40 if ($("#bt_a_stop").hasClass('on') == false ) { 41 $(this).addClass('on'); 42 $(this).text("ìì¬ì¼ì 보기 ì¬ì"); 43 $("#agenda .list_wrap").slick('slickPause'); 44 } else { 45 $(this).removeClass('on'); 46 $(this).text("ìì¬ì¼ì 보기 ì¼ìì ì§"); 47 $("#agenda .list_wrap").slick('slickPlay'); 48 } 49 return false; 50 }); 51 52 let calendar = new JSCalendar(); 53 $("#agenda .week").html(calendar.html); 54 iniWeekSlider(calendar.currentWeekIndex); 55 change_date(calendar.sourceDate); 56 57 $("#agenda") 58 .on("click", "#bt_d_prev", function (e) { 59 e.preventDefault(); 60 change_date(moment($("#agenda .week_wrap .date").data("current_date")), "prev"); 61 }) 62 .on("click", "#bt_d_next", function (e) { 63 e.preventDefault(); 64 change_date(moment($("#agenda .week_wrap .date").data("current_date")), "next"); 65 }) 66 .on("click", ".show-agenda-day", function (e) { 67 e.preventDefault(); 68 var date = $(this).data("date"); 69 viewScheduleDay(date); 70 }) 71 .on("click", ".show-agenda", function (e) { 72 e.preventDefault(); 73 var sid = $(this).data("sid"); 74 viewSchedule(sid); 75 }); 76 77 $("#agenda .date .list").slick({ 78 slidesToShow:1, 79 slidesToScroll:1, 80 infinite:false, 81 arrows:false, 82 fade:true, 83 asNavFor:"#agenda .week" 84 }); 85 86 // ììë¡¤ë§ 87 $("#member .list_wrap").slick({ 88 dots:false, 89 infinite:true, 90 speed:500, 91 fade:true, 92 autoplay:true, 93 nextArrow:"#bt_m_next", 94 prevArrow:"#bt_m_prev", 95 }); 96 $("#bt_m_stop").click(function() { 97 if ($("#bt_m_stop").hasClass('on') == false ) { 98 $(this).addClass('on'); 99 $(this).text("ìì보기 ì¬ì"); 100 $("#member .list_wrap").slick('slickPause'); 101 } else { 102 $(this).removeClass('on'); 103 $(this).text("ìì보기 ì¼ìì ì§"); 104 $("#member .list_wrap").slick('slickPlay'); 105 } 106 return false; 107 }); 108 109 $(".btn_player").click(function(){ 110 111 var check = $(".pop_player").attr("class"); 112 113 if(check != "on"){ 114 $(".pop_player").addClass("on"); 115 $(".mask").addClass("on"); 116 } else { 117 $(".pop_player").removeClass("on"); 118 $(".mask").removeClass("on"); 119 } 120 }); 121 122 $(".btn_v_close").click(function(){ 123 $(".mask").removeClass("on"); 124 $(this).parent(".pop_player").removeClass("on"); 125 }); 126}); 127 128function change_date(date, direction) { 129 $("#agenda .week_wrap .date").data("current_date", date); 130 var el = $("#agenda .week"); 131 if ("undefined" !== typeof direction) { 132 if ("prev" === direction) { 133 date.add(-1, "day"); 134 if (date.weekday() === 6) { 135 calendar = new JSCalendar({ sourceDate: date }); 136 el.slick("unslick"); 137 el.html(calendar.html); 138 iniWeekSlider(calendar.currentWeekIndex); 139 } 140 } 141 if ("next" === direction) { 142 date.add(1, "day"); 143 if (date.weekday() === 0) { 144 calendar = new JSCalendar({ sourceDate: date }); 145 el.slick("unslick"); 146 el.html(calendar.html); 147 iniWeekSlider(calendar.currentWeekIndex); 148 } 149 } 150 } 151 $("#agenda .week_wrap .date .list").html( 152 "<span>"+ 153 date.format("YYYY") + ". " + 154 "<strong>" + 155 date.format("MM") + ". " + date.format("DD") + 156 "<span>(" + date.format("ddd") + ")</span>"+ 157 "</strong>" + 158 159 "</span>" 160 ); 161 $("#agenda .week .list").each(function (i, e) { 162 $(e).removeClass("today"); 163 }); 164 $("#agenda .week .list[data-date='" + date.format("YYYY-MM-DD") + "']").addClass("today"); 165 try { 166 $.ajax({
167 type: "post", 168 url: reqInfo.cntx_path + "/kr/main/loadScheduleDay.do", 169 dataType: "json", 170 data: { begin_dt: date.format("YYYY-MM-DD") + ' 00:00:00', end_dt: moment(date).add(1, 'day').format('YYYY-MM-DD') +' 00:00:00' }, 171 success: function (data) { 172 var list_el = $("#agenda .list_wrap"); 173 if (list_el.hasClass("slick-slider")) list_el.slick("unslick"); 174 if (data.result && data.schedule_list.length > 0) { 175 var list_html = ""; 176 for (var i in data.schedule_list) { 177 var schedule = data.schedule_list[i]; 178 179 list_html +="<div class='list'>" + "<a href='#' class='show-agenda' data-sid='" + schedule.enc_uid + "' title='" + schedule.subject + "'>" + 180 "<span class='txt'>" + schedule.subject + "</span>" + "</a>" + "</div>"; 181 } 182 list_el.html(list_html); 183 } else { 184 list_el.html("<div class='list'>ë±ë¡ë ìì¬ì¼ì ì´ ììµëë¤.</div>"); 185 } 186 try { 187 // ìì¬ì¼ì 188 slick = list_el.slick({ 189 dots:false, 190 vertical:true, 191 infinite:false, 192 autoplay:true, 193 slidesToShow:1, 194 slidesToScroll:1, 195 nextArrow:"#bt_a_next", 196 prevArrow:"#bt_a_prev", 197 }); 198 $("#bt_a_next, #bt_a_prev").click(function (e) { e.preventDefault(); }); 199 } catch (e) { 200 console.log(e); 201 } 202 203 }, 204 error: function (request, status, error) { 205 console.log("code:" + request.status + "\nmessage:" + request.responseText + "\nerror:" + error); 206 } 207 }) 208 } catch (e) { 209 console.log(e); 210 } 211} 212 213function iniWeekSlider(initSlideIndex) { 214 var el = $("#agenda .week"); 215 if (el.hasClass("slick-slider")) $("#agenda .week").slick("unslick"); 216 var slick; 217 try { 218 slick = el.slick({ 219 slidesToShow:7, 220 slidesToScroll:1, 221 infinite:false, 222 nextArrow:false, 223 prevArrow:false, 224 // nextArrow:"#bt_d_next", 225 // prevArrow:"#bt_d_prev", 226 initialSlide:parseInt(initSlideIndex) * 7 227 }); 228 } catch (e) { 229 console.log(e); 230 } 231 return slick; 232} 233 234function viewScheduleDay(date) { 235 $("#schedule_modal .modal-content").waitMe({ 236 effect: "rotation", 237 text: "ìì¬ì¼ì ì ë¶ë¬ì¤ë ì¤ì ëë¤.", 238 bg: "rgba(255,255,255,0.6)", 239 color: "#555" 240 }); 241 $.ajax({ 242 type: "post", 243 url: reqInfo.upper_path + "/main/loadScheduleDay.do", 244 dataType: "json", 245 data: { begin_dt: date + ' 00:00:00', end_dt: date +' 23:59:59' }, 246 success: function (data) { 247 if (!data.schedule_list || typeof data.schedule_list !== 'object' || data.schedule_list.length < 1) return false; 248 var body = ""; 249 for (var i in data.schedule_list) { 250 var schedule = data.schedule_list[i]; 251 body+="<ul id='schedule_list'>"; 252 body+= " <li class='schedule'>"; 253 body+= " <dt><strong>ì¼ì ëª </strong>: " + schedule.subject + " </dt>"; 254 body+= " <dd>"; 255 body+= " <ul>"; 256 body+= " <li><strong>ì¼ì</strong>:<span>" + moment(schedule.begindate).format("YYYY-MM-DD HH:mm:ss") + "</span></li>"; 257 body+= " <li><strong>ì¼ì ë´ì©</strong>:<span>" + schedule.content + "</span></li>"; 258 if ('' !== schedule.remark) { 259 body += " <li><strong>ë¹ê³ </strong>:<span>" + schedule.remark + "</span></li>"; 260 } 261 body+= " </ul>"; 262 if (schedule.file_list.length > 0) { 263 body+= "<ul class='attach'>"; 264 for (var j in schedule.file_list) { 265 var file = schedule.file_list[j]; 266 body+= " <li class='file'>"; 267 body+= " <a href='" + reqInfo.upper_path + "/bbs/download.do?bbs_id=" + file.bbs_id + "&uid=" + file.enc_uid + "' title='" + file.orig_nm + "'><img src='" + reqInfo.cntx_path + "/images/board/ico_" + getFileIconImage(file.ext) + ".gif' alt='" + file.orig_nm + "' title='" + file.orig_nm + "' /> <span>" + file.orig_nm + "</span></a>"; 268 body+= " </li>"; 269 } 270 body+= "</ul>"; 271 } 272 body+= " </dd>"; 273 body+= " </li>"; 274 body+= "</ul>"; 275 } 276 $("#schedule_modal .modal-body").html(body); 277 $("#schedule_modal").modal("show"); 278 }, 279 complete: function () { 280 setTimeout(function () { $("#schedule_modal .modal-content").waitMe('hide'); }, 500); 281 } 282 }) 283} 284 285function viewSchedule(uid) { 286 if (!uid) { 287 alert("ìì¬ì¼ì ê³ ì ì ë³´ê° íìí©ëë¤."); 288 return false; 289 } 290 $("#schedule_modal .modal-content").waitMe({ 291 effect: "rotation", 292 text: "ìì¬ì¼ì ì ë¶ë¬ì¤ë ì¤ì ëë¤.", 293 bg: "rgba(255,255,255,0.6)", 294 color: "#555" 295 }); 296 $.ajax({
297 type: "post", 298 url: reqInfo.upper_path + "/main/loadSchedule.do", 299 dataType: "json", 300 data: { uid: uid }, 301 success: function (data) { 302 303 if (!data.schedule || typeof data.schedule !== 'object' || data.schedule.length < 1) return false; 304 var body = ""; 305 var schedule = data.schedule; 306 body+="<ul id='schedule_list'>"; 307 if ("L" === schedule.media_type && "" !== schedule.media_path) { 308 body+= " <li class='schedule live-schedule'>"; 309 body+= " <dt>" + 310 " <strong>ìë°©ì¡</strong>: "; 311 if ("F" === schedule.state) { 312 body+= " <span class='ico on off-air'>ë°©ì¡ì¢ ë£</span>"; 313 } else if ("T" === schedule.state) { 314 body+= " <a class='ico on off-air' href='" + reqInfo.cntx_path + "/viewer/video/live/" + schedule.enc_uid + ".do' title='ìíë°©ì¡(ìì°½ì´ë¦¼)' target='_blank'>ìíë°©ì¡</a>"; 315 } else { 316 body+= " <a class='ico on on-hompage' href='" + reqInfo.cntx_path + "/viewer/video/live/" + schedule.enc_uid + ".do' title='ííì´ì§ìì ìì²(ìì°½ì´ë¦¼)' target='_blank'>ííì´ì§</a>"; 317 body+= " <a class='ico on on-youtube' href='https://www.youtube.com/channel/UCEB8TvA0kwy6CgikFOkRpeg' title='ì íë¸ìì ìì²(ìì°½ì´ë¦¼)' target='_blank'>ì íë¸</a>"; 318 } 319 body+= " </dt>"; 320 body+= " </li>"; 321 } 322 body+= " <li class='schedule'>"; 323 body+= " <dt><strong>ì¼ì ëª </strong>: " + schedule.subject + " </dt>"; 324 body+= " <dd>"; 325 body+= " <ul>"; 326 body+= " <li><strong>ì¼ì</strong>:<span>" + moment(schedule.begindate).format("YYYY-MM-DD HH:mm:ss") + "</span></li>"; 327 body+= " <li><strong>ì¼ì ë´ì©</strong>:<span>" + schedule.content + "</span></li>"; 328 if ('' !== schedule.remark) { 329 body += " <li><strong>ë¹ê³ </strong>:<span>" + schedule.remark + "</span></li>"; 330 } 331 body+= " </ul>"; 332 if (schedule.file_list.length > 0) { 333 body+= "<ul class='attach'>"; 334 for (var j in schedule.file_list) { 335 var file = schedule.file_list[j]; 336 body+= " <li class='file'>"; 337 body+= " <a href='" + reqInfo.upper_path + "/bbs/download.do?bbs_id=" + file.bbs_id + "&uid=" + file.enc_uid + "' title='" + file.orig_nm + "'><img src='" + reqInfo.cntx_path + "/images/board/ico_" + getFileIconImage(file.ext) + ".gif' alt='" + file.orig_nm + "' title='" + file.orig_nm + "' /> <span>" + file.orig_nm + "</span></a>"; 338 body+= " </li>"; 339 } 340 body+= "</ul>"; 341 } 342 body+= " </dd>"; 343 body+= " </li>"; 344 body+= "</ul>"; 345 $("#schedule_modal .modal-body").html(body); 346 $("#schedule_modal").modal("show"); 347 }, 348 complete: function () { 349 setTimeout(function () { $("#schedule_modal .modal-content").waitMe('hide'); }, 500); 350 } 351 }) 352} 353 354const fn_scheduleModalOpen = function(o) { 355 o.css('display', 'block'); 356 setTimeout(() => o.removeClass('out').addClass('in'), 0); 357} 358 359const fn_scheduleModalClose = function(o) { 360 o.removeClass('in').addClass('out'); 361 setTimeout(() => o.css("display", "none"), 200); 362} 363 364const fn_scheduleModal = function(o, u) { 365 if(o.hasClass('in')) { 366 fn_scheduleModalClose(o); 367 } else { 368 fn_scheduleModalOpen(o); 369 } 370 371 if(!utils.isEmpty(u)) { 372 utils.callAjax({ 373 url: '/api/v2/bbs/agenda/list.do', 374 data: {uid: u}, 375 waitMe: false, 376 success: function(result) { 377 const data = result.data[0]; 378 const beginDate = result.beginDateList[0]; 379 380 const parts = moment(data.begindate).format("YYYY.MM.DD").split('.'); // 문ìì´ì '.'ë¡ ë¶ë¦¬ 381 const date = new Date(parts[0], parts[1] - 1, parts[2]); // ìì 0ë¶í° ììíë¯ë¡ -1 ì²ë¦¬ 382 const days = ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í ']; 383 384 let schedule = ""; 385 schedule += "<li class=\"schedule\">"; 386 schedule += "<dt class=\"subject\"></dt>"; 387 schedule += "<dd>"; 388 schedule += "<ul>"; 389 schedule += "<li><strong>íìì¼ì</strong>:<span class=\"begindate\"></span></li>"; 390 schedule += "<li><strong>íìë´ì©</strong><br><span class=\"content\"></span></li>"; 391 schedule += "<li><strong>ë¹ê³ </strong>:<span class=\"remark\"></span></li>"; 392 schedule += "</ul>"; 393 schedule += "<ul class=\"attach\"></ul>"; 394 schedule += "</dd>"; 395 schedule += "</li>"; 396 397 $(o).find('#schedule_list').html(schedule); 398 399 $(o).find('.subject').text(data.subject); 400 401// $(o).find('.begindate').text(moment(data.begindate).format("YYYY.MM.DD") + '.(' + days[date.getDay()] + ') ' + moment(data.begindate).format("HH:mm"));
402 $(o).find('.begindate').text(beginDate); 403 if(data.html == 'Y') { 404 $(o).find('.content').html(data.content); 405 } else { 406 $(o).find('.content').text(data.content); 407 } 408 409 $(o).find('.attach').html(''); 410 for(var i in data.file_list) { 411 const attach_file = data.file_list[i]; 412 $(o).find('.attach').append('<li class\'file\'><a href=\'/kr/bbs/download.do?bbs_id=schedule&uid=' + attach_file.enc_uid + '\' title=\'' + attach_file.orig_nm + '\'><img src=\'/images/board/ico_' + attach_file.ext + '.gif\' alt=\'' + attach_file.orig_nm + '\' title\'' + attach_file.orig_nm + '\'><span>' + attach_file.orig_nm + '</span></a></li>'); 413 } 414 415 if(!utils.isEmpty(data.remark)) { 416 $(o).find('.remark').parent('li').css('display', 'block'); 417 $(o).find('.remark').text(data.remark); 418 } else { 419 $(o).find('.remark').parent('li').css('display', 'none'); 420 } 421 } 422 }); 423 } 424}; 425 426const fn_scheduleTodayModal = function(o, d, a) { 427 if(o.hasClass('in')) { 428 fn_scheduleModalClose(o); 429 } else { 430 fn_scheduleModalOpen(o); 431 } 432 433 if(!utils.isEmpty(d)) { 434 utils.callAjax({ 435 url: '/api/v2/bbs/agenda/list.do', 436 data: {begin_dt: d, end_dt: d, cs_cd_sch : a}, 437 waitMe: false, 438 success: function(result) { 439 console.info(result); 440 let schedule = ""; 441 for(let i in result.data) { 442 console.log(i); 443 console.log(result.data[i]); 444 const article = result.data[i]; 445 446 const parts = moment(article.begindate).format("YYYY.MM.DD").split('.'); // 문ìì´ì '.'ë¡ ë¶ë¦¬ 447 const date = new Date(parts[0], parts[1] - 1, parts[2]); // ìì 0ë¶í° ììíë¯ë¡ -1 ì²ë¦¬ 448 const days = ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í ']; 449 450 schedule += "<li class=\"schedule\">"; 451 schedule += "<dt class=\"subject\">" + article.subject + "</dt>"; 452 schedule += "<dd>"; 453 schedule += "<ul>"; 454 schedule += "<li><strong>íìì¼ì</strong>:<span class=\"begindate\">" + moment(article.begindate).format("YYYY.MM.DD") + '.(' + days[date.getDay()] + ') ' + moment(article.begindate).format("HH:mm") + "</span></li>"; 455 schedule += "<li><strong>íìë´ì©</strong><br><span class=\"content\">" + article.content + "</span></li>"; 456 if(!utils.isEmpty(article.remark)) { 457 schedule += "<li><strong>ë¹ê³ </strong>:<span class=\"remark\">" + article.remark + "</span></li>"; 458 } 459 schedule += "</ul>"; 460 schedule += "<ul class=\"attach\">"; 461 schedule += "</ul>"; 462 for(var j in article.file_list) { 463 const attach_file = article.file_list[j]; 464 schedule += "<li class\'file\'><a href=\'/kr/bbs/download.do?bbs_id=schedule&uid=' + attach_file.enc_uid + '\' title=\'' + attach_file.orig_nm + '\'><img src=\'/images/board/ico_' + attach_file.ext + '.gif\' alt=\'' + attach_file.orig_nm + '\' title\'' + attach_file.orig_nm + '\'><span>' + attach_file.orig_nm + '</span></a></li>"; 465 } 466 schedule += "</dd>"; 467 schedule += "</li>"; 468 } 469 console.info(schedule); 470 $(o).find('#schedule_list').html(schedule); 471 } 472 }); 473 } 474};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.