1// ì ì ë³ì 2var errmsg = ""; 3var errfld = null; 4 5// íë ê²ì¬ 6function check_field(fld, msg) 7{ 8 if ((fld.value = trim(fld.value)) == "") 9 error_field(fld, msg); 10 else 11 clear_field(fld); 12 return; 13} 14 15// íë ì¤ë¥ íì 16function error_field(fld, msg) 17{ 18 if (msg != "") 19 errmsg += msg + "\n"; 20 if (!errfld) errfld = fld; 21 fld.style.background = "#BDDEF7"; 22} 23 24// íë를 깨ëíê² 25function clear_field(fld) 26{ 27 fld.style.background = "#FFFFFF"; 28} 29 30function trim(s) 31{ 32 var t = ""; 33 var from_pos = to_pos = 0; 34 35 for (i=0; i<s.length; i++) 36 { 37 if (s.charAt(i) == ' ') 38 continue; 39 else 40 { 41 from_pos = i; 42 break; 43 } 44 } 45 46 for (i=s.length; i>=0; i--) 47 { 48 if (s.charAt(i-1) == ' ') 49 continue; 50 else 51 { 52 to_pos = i; 53 break; 54 } 55 } 56 57 t = s.substring(from_pos, to_pos); 58 // alert(from_pos + ',' + to_pos + ',' + t+'.'); 59 return t; 60} 61 62function check_password_strength(str) 63{ 64 if (str.length < 9 || str.length > 20) { 65 return "ë¹ë°ë²í¸ë 9ì ì´ì 20ì ì´íë¡ ì ë ¥í´ì£¼ì¸ì."; 66 } 67 68 var check = 0; 69 if (/[a-zA-Z]/.test(str)) check++; 70 if (/[0-9]/.test(str)) check++; 71 if (/[\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/.test(str)) check++; 72 73 if (check < 3) { 74 return "ë¹ë°ë²í¸ë ì문, ì«ì, í¹ì문ì를 모ë í¬í¨í´ì¼ í©ëë¤."; 75 } 76 77 if (/(.)\1\1/.test(str)) { 78 return "ëì¼í 문ì를 3ë² ì´ì ì°ìí´ì ì¬ì©í ì ììµëë¤."; 79 } 80 81 return ""; 82} 83 84// ìë°ì¤í¬ë¦½í¸ë¡ PHPì number_format íë´ë¥¼ ë 85// ì«ìì , 를 ì¶ë ¥ 86function number_format(data) 87{ 88 89 var tmp = ''; 90 var number = ''; 91 var cutlen = 3; 92 var comma = ','; 93 var i; 94 95 data = data + ''; 96 97 var sign = data.match(/^[\+\-]/); 98 if(sign) { 99 data = data.replace(/^[\+\-]/, ""); 100 } 101 102 len = data.length; 103 mod = (len % cutlen);
104 k = cutlen - mod; 105 for (i=0; i<data.length; i++) 106 { 107 number = number + data.charAt(i); 108 109 if (i < data.length - 1) 110 { 111 k++; 112 if ((k % cutlen) == 0) 113 { 114 number = number + comma; 115 k = 0; 116 } 117 } 118 } 119 120 if(sign != null) 121 number = sign+number; 122 123 return number; 124} 125 126// ì ì°½ 127function popup_window(url, winname, opt) 128{ 129 window.open(url, winname, opt); 130} 131 132 133// í¼ë©ì¼ ì°½ 134function popup_formmail(url) 135{ 136 opt = 'scrollbars=yes,width=417,height=385,top=10,left=20'; 137 popup_window(url, "wformmail", opt); 138} 139 140// , 를 ìì¤ë¤. 141function no_comma(data) 142{ 143 var tmp = ''; 144 var comma = ','; 145 var i; 146 147 for (i=0; i<data.length; i++) 148 { 149 if (data.charAt(i) != comma) 150 tmp += data.charAt(i); 151 } 152 return tmp; 153} 154 155// ìì ê²ì¬ íì¸ 156function del(href) 157{ 158 if(confirm("íë² ìì í ìë£ë 복구í ë°©ë²ì´ ììµëë¤.\n\nì ë§ ìì íìê² ìµëê¹?")) { 159 window.location.href = href; 160 } 161} 162 163// ì¿ í¤ ì ë ¥ 164function set_cookie(name, value, expirehours, domain) 165{ 166 var today = new Date(); 167 today.setTime(today.getTime() + (60*60*1000*expirehours)); 168 document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";"; 169 if (domain) { 170 document.cookie += "domain=" + domain + ";"; 171 } 172} 173 174// ì¿ í¤ ì»ì 175function get_cookie(name) 176{ 177 var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); 178 if (match) return unescape(match[2]); 179 return ""; 180} 181 182// ì¿ í¤ ì§ì 183function delete_cookie(name) 184{ 185 var today = new Date(); 186 187 today.setTime(today.getTime() - 1); 188 var value = get_cookie(name); 189 if(value != "") 190 document.cookie = name + "=" + value + "; path=/; expires=" + today.toGMTString(); 191} 192 193var last_id = null; 194function menu(id) 195{ 196 if (id != last_id) 197 { 198 if (last_id != null) 199 document.getElementById(last_id).style.display = "none"; 200 document.getElementById(id).style.display = "block"; 201 last_id = id; 202 } 203 else 204 { 205 document.getElementById(id).style.display = "none"; 206 last_id = null; 207 } 208} 209 210function textarea_decrease(id, row) 211{ 212 if (document.getElementById(id).rows - row > 0) 213 document.getElementById(id).rows -= row; 214} 215 216function textarea_original(id, row) 217{ 218 document.getElementById(id).rows = row; 219} 220 221function textarea_increase(id, row) 222{ 223 document.getElementById(id).rows += row; 224} 225 226// ê¸ì«ì ê²ì¬ 227function check_byte(content, target) 228{ 229 var i = 0; 230 var cnt = 0; 231 var ch = ''; 232 var cont = document.getElementById(content).value; 233 234 for (i=0; i<cont.length; i++) { 235 ch = cont.charAt(i); 236 if (escape(ch).length > 4) { 237 cnt += 2; 238 } else { 239 cnt += 1; 240 } 241 } 242 // ì«ì를 ì¶ë ¥ 243 document.getElementById(target).innerHTML = cnt; 244 245 return cnt; 246} 247 248// ë¸ë¼ì°ì ìì ì¤ë¸ì í¸ì ì¼ìª½ ì¢í 249function get_left_pos(obj) 250{ 251 var parentObj = null; 252 var clientObj = obj; 253 //var left = obj.offsetLeft + document.body.clientLeft; 254 var left = obj.offsetLeft; 255 256 while((parentObj=clientObj.offsetParent) != null) 257 { 258 left = left + parentObj.offsetLeft; 259 clientObj = parentObj; 260 } 261 262 return left; 263} 264 265// ë¸ë¼ì°ì ìì ì¤ë¸ì í¸ì ìë¨ ì¢í 266function get_top_pos(obj) 267{ 268 var parentObj = null; 269 var clientObj = obj; 270 //var top = obj.offsetTop + document.body.clientTop; 271 var top = obj.offsetTop; 272 273 while((parentObj=clientObj.offsetParent) != null) 274 { 275 top = top + parentObj.offsetTop; 276 clientObj = parentObj; 277 } 278 279 return top; 280} 281 282function flash_movie(src, ids, width, height, wmode) 283{ 284 var wh = ""; 285 if (parseInt(width) && parseInt(height)) 286 wh = " width='"+width+"' height='"+height+"' "; 287 return "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' "+wh+" id="+ids+"><param name=wmode value="+wmode+"><param name=movie value="+src+"><param name=quality value=high><embed src="+src+" quality=high wmode="+wmode+" type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash' "+wh+"></embed></object>"; 288} 289 290function obj_movie(src, ids, width, height, autostart) 291{ 292 var wh = ""; 293 if (parseInt(width) && parseInt(height)) 294 wh = " width='"+width+"' height='"+height+"' "; 295 if (!autostart) autostart = false;
296 return "<embed src='"+src+"' "+wh+" autostart='"+autostart+"'></embed>"; 297} 298 299function doc_write(cont) 300{ 301 document.write(cont); 302} 303 304var win_password_lost = function(href) { 305 window.open(href, "win_password_lost", "left=50, top=50, width=617, height=330, scrollbars=1"); 306} 307 308$(document).ready(function(){ 309 $("#login_password_lost, #ol_password_lost").click(function(){ 310 win_password_lost(this.href); 311 return false; 312 }); 313}); 314 315/** 316 * í¬ì¸í¸ ì°½ 317 **/ 318var win_point = function(href) { 319 var new_win = window.open(href, 'win_point', 'left=100,top=100,width=600, height=600, scrollbars=1'); 320 new_win.focus(); 321} 322 323/** 324 * ìª½ì§ ì°½ 325 **/ 326var win_memo = function(href) { 327 var new_win = window.open(href, 'win_memo', 'left=100,top=100,width=620,height=500,scrollbars=1'); 328 new_win.focus(); 329} 330 331/** 332 * ìª½ì§ ì°½ 333 **/ 334var check_goto_new = function(href, event) { 335 if( !(typeof g5_is_mobile != "undefined" && g5_is_mobile) ){ 336 if (window.opener && window.opener.document && window.opener.document.getElementById) { 337 event.preventDefault ? event.preventDefault() : (event.returnValue = false); 338 window.open(href); 339 //window.opener.document.location.href = href; 340 } 341 } 342} 343 344/** 345 * ë©ì¼ ì°½ 346 **/ 347var win_email = function(href) { 348 var new_win = window.open(href, 'win_email', 'left=100,top=100,width=600,height=580,scrollbars=1'); 349 new_win.focus(); 350} 351 352/** 353 * ì기ìê° ì°½ 354 **/ 355var win_profile = function(href) { 356 var new_win = window.open(href, 'win_profile', 'left=100,top=100,width=620,height=510,scrollbars=1'); 357 new_win.focus(); 358} 359 360/** 361 * ì¤í¬ë© ì°½ 362 **/ 363var win_scrap = function(href) { 364 var new_win = window.open(href, 'win_scrap', 'left=100,top=100,width=600,height=600,scrollbars=1'); 365 new_win.focus(); 366} 367 368/** 369 * ííì´ì§ ì°½ 370 **/ 371var win_homepage = function(href) { 372 var new_win = window.open(href, 'win_homepage', ''); 373 new_win.focus(); 374} 375 376/** 377 * ì°í¸ë²í¸ ì°½ 378 **/ 379var win_zip = function(frm_name, frm_zip, frm_addr1, frm_addr2, frm_addr3, frm_jibeon) { 380 if(typeof daum === "undefined"){ 381 alert("KAKAO ì°í¸ë²í¸ ìë¹ì¤ postcode.v2.js íì¼ì´ ë¡ëëì§ ìììµëë¤."); 382 return false; 383 } 384 385 // íì¹ ì¤ íì ì ê±° 386 var vContent = "width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10"; 387 $("#meta_viewport").attr("content", vContent + ",user-scalable=no"); 388 389 var zip_case = 1; //0ì´ë©´ ë ì´ì´, 1ì´ë©´ íì´ì§ì ë¼ì ë£ê¸°, 2ì´ë©´ ìì°½ 390 391 var complete_fn = function(data){ 392 // íì ìì ê²ìê²°ê³¼ í목ì í´ë¦íìë ì¤íí ì½ë를 ìì±íë ë¶ë¶. 393 394 // ê° ì£¼ìì ë ¸ì¶ ê·ì¹ì ë°ë¼ 주ì를 ì¡°í©íë¤. 395 // ë´ë ¤ì¤ë ë³ìê° ê°ì´ ìë ê²½ì°ì 공백('')ê°ì ê°ì§ë¯ë¡, ì´ë¥¼ ì°¸ê³ íì¬ ë¶ê¸° íë¤. 396 var fullAddr = ''; // ìµì¢ 주ì ë³ì 397 var extraAddr = ''; // ì¡°í©í 주ì ë³ì 398 399 // ì¬ì©ìê° ì íí 주ì íì ì ë°ë¼ í´ë¹ 주ì ê°ì ê°ì ¸ì¨ë¤. 400 if (data.userSelectedType === 'R') { // ì¬ì©ìê° ëë¡ëª 주ì를 ì ííì ê²½ì° 401 fullAddr = data.roadAddress; 402 403 } else { // ì¬ì©ìê° ì§ë² 주ì를 ì ííì ê²½ì°(J) 404 fullAddr = data.jibunAddress; 405 } 406 407 // ì¬ì©ìê° ì íí 주ìê° ëë¡ëª íì ì¼ë ì¡°í©íë¤. 408 if(data.userSelectedType === 'R'){ 409 //ë²ì ëëª ì´ ìì ê²½ì° ì¶ê°íë¤. 410 if(data.bname !== ''){ 411 extraAddr += data.bname; 412 } 413 // ê±´ë¬¼ëª ì´ ìì ê²½ì° ì¶ê°íë¤. 414 if(data.buildingName !== ''){ 415 extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName); 416 } 417 // ì¡°í©í주ìì ì 무ì ë°ë¼ ì쪽ì ê´í¸ë¥¼ ì¶ê°íì¬ ìµì¢ 주ì를 ë§ë ë¤. 418 extraAddr = (extraAddr !== '' ? ' ('+ extraAddr +')' : ''); 419 } 420 421 // ì°í¸ë²í¸ì 주ì ì 보를 í´ë¹ íëì ë£ê³ , 커ì를 ìì¸ì£¼ì íëë¡ ì´ëíë¤. 422 var of = document[frm_name]; 423 424 of[frm_zip].value = data.zonecode; 425 426 of[frm_addr1].value = fullAddr; 427 of[frm_addr3].value = extraAddr; 428 429 if(of[frm_jibeon] !== undefined){ 430 of[frm_jibeon].value = data.userSelectedType; 431 } 432 433 setTimeout(function(){ 434 $("#meta_viewport").attr("content", vContent); 435 of[frm_addr2].focus(); 436 } , 100); 437 }; 438 439 switch(zip_case) { 440 case 1 : //iframeì ì´ì©íì¬ íì´ì§ì ë¼ì ë£ê¸° 441 var daum_pape_id = 'daum_juso_page'+frm_zip, 442 element_wrap = document.getElementById(daum_pape_id), 443 currentScroll = Math.max(document.body.scrollTop, document.documentElement.scrollTop); 444 if (element_wrap == null) { 445 element_wrap = document.createElement("div"); 446 element_wrap.setAttribute("id", daum_pape_id); 447 element_wrap.style.cssText = 'display:none;border:1px solid;left:0;width:100%;height:300px;margin:5px 0;position:relative;-webkit-overflow-scrolling:touch;'; 448 element_wrap.innerHTML = '<img src="//t1.daumcdn.net/
448postcode/resource/images/close.png" id="btnFoldWrap" style="cursor:pointer;position:absolute;right:0px;top:-21px;z-index:1" class="close_daum_juso" alt="ì 기 ë²í¼">'; 449 jQuery('form[name="'+frm_name+'"]').find('input[name="'+frm_addr1+'"]').before(element_wrap); 450 jQuery("#"+daum_pape_id).off("click", ".close_daum_juso").on("click", ".close_daum_juso", function(e){ 451 e.preventDefault(); 452 $("#meta_viewport").attr("content", vContent); 453 jQuery(this).parent().hide(); 454 }); 455 } 456 457 new daum.Postcode({ 458 oncomplete: function(data) { 459 complete_fn(data); 460 // iframeì ë£ì element를 ìë³´ì´ê² íë¤. 461 element_wrap.style.display = 'none'; 462 // ì°í¸ë²í¸ 찾기 íë©´ì´ ë³´ì´ê¸° ì´ì ì¼ë¡ scroll ìì¹ë¥¼ ëë린ë¤. 463 document.body.scrollTop = currentScroll; 464 }, 465 // ì°í¸ë²í¸ 찾기 íë©´ í¬ê¸°ê° ì¡°ì ëììë ì¤íí ì½ë를 ìì±íë ë¶ë¶. 466 // iframeì ë£ì elementì ëì´ê°ì ì¡°ì íë¤. 467 onresize : function(size) { 468 element_wrap.style.height = size.height + "px"; 469 }, 470 maxSuggestItems : g5_is_mobile ? 6 : 10, 471 width : '100%', 472 height : '100%' 473 }).embed(element_wrap); 474 475 // iframeì ë£ì element를 ë³´ì´ê² íë¤. 476 element_wrap.style.display = 'block'; 477 break; 478 case 2 : //ìì°½ì¼ë¡ ëì°ê¸° 479 new daum.Postcode({ 480 oncomplete: function(data) { 481 complete_fn(data); 482 } 483 }).open(); 484 break; 485 default : //iframeì ì´ì©íì¬ ë ì´ì´ ëì°ê¸° 486 var rayer_id = 'daum_juso_rayer'+frm_zip, 487 element_layer = document.getElementById(rayer_id); 488 if (element_layer == null) { 489 element_layer = document.createElement("div"); 490 element_layer.setAttribute("id", rayer_id); 491 element_layer.style.cssText = 'display:none;border:5px solid;position:fixed;width:300px;height:460px;left:50%;margin-left:-155px;top:50%;margin-top:-235px;overflow:hidden;-webkit-overflow-scrolling:touch;z-index:10000'; 492 element_layer.innerHTML = '<img src="//i1.daumcdn.net/localimg/localimages/07/postcode/320/close.png" id="btnCloseLayer" style="cursor:pointer;position:absolute;right:-3px;top:-3px;z-index:1" class="close_daum_juso" alt="ë«ê¸° ë²í¼">'; 493 document.body.appendChild(element_layer); 494 jQuery("#"+rayer_id).off("click", ".close_daum_juso").on("click", ".close_daum_juso", function(e){ 495 e.preventDefault(); 496 $("#meta_viewport").attr("content", vContent); 497 jQuery(this).parent().hide(); 498 }); 499 } 500 501 new daum.Postcode({ 502 oncomplete: function(data) { 503 complete_fn(data); 504 // iframeì ë£ì element를 ìë³´ì´ê² íë¤. 505 element_layer.style.display = 'none'; 506 }, 507 maxSuggestItems : g5_is_mobile ? 6 : 10, 508 width : '100%', 509 height : '100%' 510 }).embed(element_layer); 511 512 // iframeì ë£ì element를 ë³´ì´ê² íë¤. 513 element_layer.style.display = 'block'; 514 } 515} 516 517/** 518 * ìë¡ì´ ë¹ë°ë²í¸ ë¶ì¤ ì°½ : 101123 519 **/ 520win_password_lost = function(href) 521{ 522 var new_win = window.open(href, 'win_password_lost', 'width=617, height=330, scrollbars=1'); 523 new_win.focus(); 524} 525 526/** 527 * ì¤ë¬¸ì¡°ì¬ ê²°ê³¼ 528 **/ 529var win_poll = function(href) { 530 var new_win = window.open(href, 'win_poll', 'width=616, height=500, scrollbars=1'); 531 new_win.focus(); 532} 533 534/** 535 * ì¿ í° 536 **/ 537var win_coupon = function(href) { 538 var new_win = window.open(href, "win_coupon", "left=100,top=100,width=700, height=600, scrollbars=1"); 539 new_win.focus(); 540} 541 542 543/** 544 * ì¤í¬ë¦°ë¦¬ë 미ì¬ì©ì를 ìí ì¤í¬ë¦½í¸ - ì§ì´ìë¹ 2013-04-22 545 * alt ê°ë§ ê°ë ê·¸ëí½ ë§í¬ì ë§ì°ì¤ì¤ë² ì title ê° ë¶ì¬, ë§ì°ì¤ìì ì title ê° ì ê±° 546 **/ 547$(function() { 548 $('a img').mouseover(function() { 549 $a_img_title = $(this).attr('alt'); 550 $(this).attr('title', $a_img_title); 551 }).mouseout(function() { 552 $(this).attr('title', ''); 553 }); 554}); 555 556/** 557 * í ì¤í¸ 리ì¬ì´ì¦ 558**/ 559function font_resize(id, rmv_class, add_class, othis) 560{ 561 var $el = $("#"+id); 562 563 if((typeof rmv_class !== "undefined" && rmv_class) || (typeof add_class !== "undefined" && add_class)){ 564 $el.removeClass(rmv_class).addClass(add_class); 565 566 set_cookie("ck_font_resize_rmv_class", rmv_class, 1, g5_cookie_domain); 567 set_cookie("ck_font_resize_add_class", add_class, 1, g5_cookie_domain); 568 } 569 570 if(typeof othis !== "undefined"){ 571 $(othis).addClass('select').siblings().removeClass('select'); 572 } 573} 574 575/** 576 * ëê¸ ìì í í° 577**/ 578function set_comment_token(f) 579{ 580 if(typeof f.token === "undefined") 581 $(f).prepend('<input type="hidden" name="token" value="">'); 582 583 $.ajax({ 584 url: g5_bbs_url+"/ajax.comment_token.php", 585 type: "GET", 586 dataType: "json", 587 async: false, 588 cache: false, 589 success: function(data, textStatus) { 590 f.token.value = data.token; 591 } 592 }); 593} 594 595$(function(){
596 $(".win_point").click(function() { 597 win_point(this.href); 598 return false; 599 }); 600 601 $(".win_memo").click(function() { 602 win_memo(this.href); 603 return false; 604 }); 605 606 $(".win_email").click(function() { 607 win_email(this.href); 608 return false; 609 }); 610 611 $(".win_scrap").click(function() { 612 win_scrap(this.href); 613 return false; 614 }); 615 616 $(".win_profile").click(function() { 617 win_profile(this.href); 618 return false; 619 }); 620 621 $(".win_homepage").click(function() { 622 win_homepage(this.href); 623 return false; 624 }); 625 626 $(".win_password_lost").click(function() { 627 win_password_lost(this.href); 628 return false; 629 }); 630 631 /* 632 $(".win_poll").click(function() { 633 win_poll(this.href); 634 return false; 635 }); 636 */ 637 638 $(".win_coupon").click(function() { 639 win_coupon(this.href); 640 return false; 641 }); 642 643 // ì¬ì´ëë·° 644 var sv_hide = false; 645 $(".sv_member, .sv_guest").click(function() { 646 $(".sv").removeClass("sv_on"); 647 $(this).closest(".sv_wrap").find(".sv").addClass("sv_on"); 648 }); 649 650 $(".sv, .sv_wrap").hover( 651 function() { 652 sv_hide = false;
653 }, 654 function() { 655 sv_hide = true; 656 } 657 ); 658 659 $(".sv_member, .sv_guest").focusin(function() { 660 sv_hide = false; 661 $(".sv").removeClass("sv_on"); 662 $(this).closest(".sv_wrap").find(".sv").addClass("sv_on"); 663 }); 664 665 $(".sv a").focusin(function() { 666 sv_hide = false; 667 }); 668 669 $(".sv a").focusout(function() { 670 sv_hide = true; 671 }); 672 673 // ì ë í¸ ul 674 var sel_hide = false; 675 $('.sel_btn').click(function() { 676 $('.sel_ul').removeClass('sel_on'); 677 $(this).siblings('.sel_ul').addClass('sel_on'); 678 }); 679 680 $(".sel_wrap").hover( 681 function() { 682 sel_hide = false; 683 }, 684 function() { 685 sel_hide = true; 686 } 687 ); 688 689 $('.sel_a').focusin(function() { 690 sel_hide = false; 691 }); 692 693 $('.sel_a').focusout(function() { 694 sel_hide = true; 695 }); 696 697 $(document).click(function() { 698 if(sv_hide) { // ì¬ì´ëë·° í´ì 699 $(".sv").removeClass("sv_on"); 700 } 701 if (sel_hide) { // ì ë í¸ ul í´ì 702 $('.sel_ul').removeClass('sel_on'); 703 } 704 }); 705 706 $(document).focusin(function() { 707 if(sv_hide) { // ì¬ì´ëë·° í´ì 708 $(".sv").removeClass("sv_on"); 709 } 710 if (sel_hide) { // ì ë í¸ ul í´ì 711 $('.sel_ul').removeClass('sel_on'); 712 } 713 }); 714 715 $(document).on( "keyup change", "textarea#wr_content[maxlength]", function(){ 716 var str = $(this).val(); 717 var mx = parseInt($(this).attr("maxlength")); 718 if (str.length > mx) { 719 $(this).val(str.substr(0, mx)); 720 return false; 721 } 722 }); 723}); 724 725function get_write_token(bo_table) 726{ 727 var token = ""; 728 729 $.ajax({ 730 type: "POST", 731 url: g5_bbs_url+"/write_token.php", 732 data: { bo_table: bo_table }, 733 cache: false, 734 async: false, 735 dataType: "json", 736 success: function(data) { 737 if(data.error) { 738 alert(data.error); 739 if(data.url) 740 document.location.href = data.url; 741 742 return false; 743 } 744 745 token = data.token; 746 } 747 }); 748 749 return token; 750} 751 752$(function() { 753 $(document).on("click", "form[name=fwrite] input:submit, form[name=fwrite] button:submit, form[name=fwrite] input:image", function() { 754 var f = this.form; 755 756 if (typeof(f.bo_table) == "undefined") { 757 return; 758 } 759 760 var bo_table = f.bo_table.value; 761 var token = get_write_token(bo_table); 762 763 if(!token) { 764 alert("í í° ì ë³´ê° ì¬ë°ë¥´ì§ ììµëë¤."); 765 return false; 766 } 767 768 var $f = $(f); 769 770 if(typeof f.token === "undefined") 771 $f.prepend('<input type="hidden" name="token" value="">'); 772 773 $f.find("input[name=token]").val(token); 774 775 return true; 776 }); 777}); 778 779// ë¶ë¥ ì í ë³ê²½ 780function listMulti_select(selectBox) { 781 const scaValue = document.getElementById('bo_cate_list')?.value || ''; 782 const guValue = document.getElementById('bo_gu_list')?.value || ''; 783 784 const url = new URL(window.location.href); 785 const params = url.searchParams; 786 787 const prevSca = params.get('sca') ?? ''; 788 const prevGu = params.get('gu') ?? ''; 789 790 if (scaValue) params.set('sca', scaValue); else params.delete('sca'); 791 if (guValue) params.set('gu', guValue); else params.delete('gu'); 792 793 const nextSca = params.get('sca') ?? ''; 794 const nextGu = params.get('gu') ?? ''; 795 796 if (prevSca === nextSca && prevGu === nextGu) return; 797 798 const query = params.toString(); 799 window.location.href = query ? `${url.pathname}?${query}` : url.pathname; 800} 801 802 803// ê°ë³ ì í 804const GU_PARAM = 'gu'; 805function listMulti(checkbox) { 806 const name = checkbox.getAttribute('name'); // 'sca[]' | 'gu[]' 807 const isCategory = name === 'sca[]'; 808 const isGu = name === 'gu[]'; 809 810 const allSelector = `input[name="${name}"][value=""]`; 811 const itemSelector = `input[name="${name}"]:not([value=""])`; 812 const allBox = document.querySelector(allSelector); 813 const itemBoxes = document.querySelectorAll(itemSelector); 814 815 if (checkbox.value === '') { 816 if (checkbox.checked) {
817 itemBoxes.forEach(b => { b.checked = false; }); 818 } else { 819 const anyChecked = Array.from(itemBoxes).some(b => b.checked); 820 if (!anyChecked) checkbox.checked = true; 821 } 822 } else { 823 if (allBox && allBox.checked) allBox.checked = false; 824 825 const anyCheckedItems = document.querySelectorAll(`${itemSelector}:checked`).length; 826 if (anyCheckedItems === 0 && allBox) { 827 allBox.checked = true; // ìë ì ì²´ ì²´í¬ 828 } 829 } 830 831 const shouldNavigate = isGu || isCategory; 832 if (!shouldNavigate) return; 833 834 const scaValues = Array.from(document.querySelectorAll('input[name="sca[]"]:checked')) 835 .map(b => b.value).filter(v => v !== ''); 836 const guValues = Array.from(document.querySelectorAll('input[name="gu[]"]:checked')) 837 .map(b => b.value).filter(v => v !== ''); 838 839 const url = new URL(window.location.href); 840 const params = url.searchParams; 841 842 const prevSca = params.get('sca') ?? ''; 843 const prevGu = params.get(GU_PARAM) ?? ''; 844 845 if (scaValues.length > 0) params.set('sca', scaValues.join(',')); 846 else params.delete('sca'); 847 848 if (guValues.length > 0) params.set(GU_PARAM, guValues.join(',')); 849 else params.delete(GU_PARAM); 850 851 const nextSca = params.get('sca') ?? ''; 852 const nextGu = params.get(GU_PARAM) ?? ''; 853 854 if (prevSca === nextSca && prevGu === nextGu) return; 855 856 const query = params.toString(); 857 window.location.href = query ? `${url.pathname}?${query}` : url.pathname; 858}
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.