1/* 22018.07.10 JS íµí©ìì 3 4######################################################### 5* í©ì³ì§ë íì¼ 6######################################################### 71. /script/bannerpop.js 9ê° 82. /script/resizePhoto.js 5ê° 93. /script/onScroll.js 1ê° 104. /script/floating.banner.js 2ê° 115. /script/mosaic.js 6ê° 126. /script/newsAutoCall.js 2ê° 138. /script/common.js 8ê° 147. /script/app.js 49ê° 15 16=> /script/common.js ë¡ íµí© 17########################################################## 18*/ 19 20/* ****************************************** */ 21/* /script/bannerpop.js */ 22/* ****************************************** */ 23 24var adWrite={ 25 // php ì ë¬ ë³ì 26 vars:{ 27 separator : "|" 28 ,editId : null // ìì í id 29 ,box : '<div class="ad-map" />' // ìì±ë ë°ì¤ 30 ,buttons : '<div class="ad-map-btns"><div class="btn-group-vertical"><button type="button" class="btn_com btn_com_0_699 adcmb_button adcmb_modify button secondary tiny" title="ìì "><i class="fa fa-link fa-fw" aria-hidden="true"></i></button><button type="button" class="btn_com btn_com_35_699 adcmb_button adcmb_delete button tiny nd-gray" title="ìì "><i class="fa fa-trash-o fa-fw" aria-hidden="true"></i></button></div></div>' //ìì ë ë°ì¤ì ë²í¼ë¤ 31 ,$textBox : null 32 ,act : "" // ì¬ì§ ì ë¡ëíê³ ì´ë¬ì íê² ì주 actê°ì´ ë°ëëë°, ê·¸ê²ì ìë ê° 33 ,iframe : '<iframe src="about:blank" name="adc_up_frame" id="adc_up_frame" width="0" height="0" frameborder="0"></iframe>' // uploadì© iframe 34 ,loadData : {} 35 } 36 37 // ì´ë¯¸ì§ ë¡ë©ëë©´ í¬ê¸° ì¬ì´ì¤ê¸° 38 // IEë§ ì´ë¯¸ì§ ë¡ë©ëí ì´ë²¤í¸ê° 먹ì´ì ¸ì í¬ê¸°ë¥¼ ì ëë¡ ì¬ì´ì¤ì§ 못í´ì inlineì¼ë¡ ì¤í¬ë¦½í¸ ìì±í¨ 39 ,getSizeLoadImage:function(_this) 40 { 41 var _w = _this.width 42 ,_h = _this.height; 43 44 _this.setAttribute("data-display-width", _w); 45 _this.setAttribute("data-display-height", _h); 46 47 // ì´ë¯¸ì§ë§µ ì´ë²¤í¸ 48 adWrite.map($(_this)); 49 } 50 51 // ë±ë¡ì ì´ë²¤í¸ë¤ 52 ,evtCrtForm:function() 53 { 54 var parents = this 55 ,$type = $("#adc_crt_type_html, #adc_crt_type_file") 56 ,$htmlBox = $("#adc_crt_html_box") 57 ,$fileBox = $("#adc_crt_attach_file_box") 58 59 ,$popupType = $("#adc_crt_popup_type_layer, #adc_crt_popup_type_window") 60 ,$layer = $("#adc_crt_popup_layer_opt_box") 61 ,$window = $("#adc_crt_popup_window_opt_box") 62 63 ,$closeIcon = $("#adc_crt_popup_layer_icon") 64 ,$iconBox = $("#adc_crt_popup_layer_icon_box") 65 66 ,$closeExpire = $("#bottom_close_expire_label") 67 ,$closeExpireBox = $("#bottom_close_expire_box") 68 69 ,$attachFile = $("#adc_crt_attach_file") 70 ,$previewFile = $("#adc_crt_file_image") 71 ,$previewBox = $("#adc_crt_image_preview_box") 72 73 ,$max_file_size = $("#file_upload_max_size").val(); 74 75 // ì ë ¥ë¶ë¶ ë´ìë기 76 this.vars.$textBox = $("#adc_crt_image_link_box"); 77 78 // html, file ì ë ¥ 79 $type.click(function(){ 80 var isChecked = $(this).attr("value"); 81 82 $htmlBox[isChecked==="HTML"?"removeClass":"addClass"]("is-hidden"); 83 $fileBox[isChecked==="FILE"?"removeClass":"addClass"]("is-hidden"); 84 }); 85 86 // 미리보기 í¸ì¶ // 87 $attachFile.change(function(){ 88 var form = document.adc_form; 89 90 if (typeof (FileReader) != "undefined") { 91 92 var file = $(this)[0].files[0] 93 ,regex = ['jpg', 'jpeg', 'png', 'gif', 'swf'] 94 ,filesize = file.size 95 ,extension = file.name.split('.').pop().toLowerCase(); 96 97 if(filesize > $max_file_size){ 98 alert('ì ë¡ë ì©ëì´ ì´ê³¼ëììµëë¤.'); 99 $attachFile.val(""); 100 return false; 101 } 102 103 if((regex.indexOf(extension) > -1) === false){ 104 alert('jpg, png, gif, swf íì¥ìë§ ì ííì¬ ì£¼ì¸ì.'); 105 $attachFile.val(""); 106 107 //ì ë ¥ìë§ í¨ì ë°ë ìì 108 $previewBox.addClass("is-hidden"); 109 return false; 110 } 111 112 if(extension == "swf"){ 113 $previewBox.addClass("is-hidden"); 114 return false; 115 } 116 117 var reader = new FileReader(); 118 reader.onload = function (e) { 119 var img = new Image(); 120 img.src = e.target.result; 121 122 img.onload = function(){ 123 $previewFile.attr({"src":e.target.result,"data-display-width":this.width, "data-display-height":this.height, "data-width":this.width, "data-height":this.height, "alt":(form.title.value)?form.title.value:form.idxno.value}); 124 $previewBox.removeClass("is-hidden"); 125 126 $('#size_width').val(this.width); 127 $('#size_height').val(this.height); 128 129 $('#popup_width').val(this.width); 130 $('#popup_height').val(this.height); 131 132 // ì´ë¯¸ì§ë§µ ì´ë²¤í¸ 133 parents.map($previewFile); 134 } 135 } 136
137 reader.readAsDataURL(file); 138 parents.mapDeleteAll(); 139 } 140 }); 141 142 var $mapRadio = $("#adc_crt_image_link_total, #adc_crt_image_link_part, #adc_crt_image_link_not") 143 ,$imgLinkSelect = $(".adcil_btns") 144 ,$imgLink = $("#adc_crt_image_link") 145 ,$imgLinkFile = $("#adc_crt_image_link_file") 146 ,$selectPopup = $("#adc_crt_image_link_popup") 147 ,$btnMapRegist = $("#adc_crt_img_link_btn_regist") 148 ,$linkAction = ''; 149 150 // ì ì²´ ëë ì´ë¯¸ì§ ë§µ ì íì 151 $mapRadio.click(function(){ 152 var $this = $(this) 153 ,type = $this.attr("data-type"); 154 155 if(type == 'total' || type == 'map'){ 156 157 if(type == 'map') $('#link_event_tag').hide(); 158 else $('#link_event_tag').show(); 159 160 $("#adc_crt_image_link_box").removeClass('is-hidden'); 161 162 $btnMapRegist[type==="map"?"removeClass":"addClass"]("is-hidden"); 163 164 if(type==="total") parents.mapDeleteAll(); // ì ì²´ì íì¼ë, ì´ì ë°ì´í 모ë ì§ì 165 166 }else{ 167 $("#adc_crt_image_link_box").addClass('is-hidden'); 168 } 169 }); 170 171 // layer or window ì í 172 $popupType.click(function(){ 173 var isChecked = $(this).attr("data-type"); 174 175 $layer[isChecked==="layer"?"removeClass":"addClass"]("is-hidden"); 176 $window[isChecked==="window"?"removeClass":"addClass"]("is-hidden"); 177 }); 178 179 // ë«ê¸° ìì´ì½ í´ë¦ì ìì´ì½ íí ì í ë°ì¤ ì´ê² 180 $closeIcon.click(function(){ 181 var $label_attr_for = $(this).attr('for') 182 ,isChecked = $('#'+$label_attr_for).is(":checked"); 183 184 $iconBox[isChecked===false?"removeClass":"addClass"]("is-hidden"); 185 }); 186 187 // ëªì¼ ëì ì´ì§ ì기 ì ë ¥ë°ì¤ ì´ê¸° 188 $closeExpire.click(function(){ 189 var $label_attr_for = $(this).attr('for') 190 ,isChecked = $('#'+$label_attr_for).is(":checked"); 191 192 $closeExpireBox[isChecked===false?"removeClass":"addClass"]("is-hidden"); 193 }); 194 195 // ì´ë¤ííì ë§í¬ì¸ì§ íì¸ 196 // link, popup, file, close, day_close 197 $imgLinkSelect.click(function(){ 198 var $this = $(this) 199 ,type = $this.attr("data-type"); 200 201 if(type==="popup" || type==="close" || type==="day_close"){ 202 $imgLink.add($imgLinkFile).addClass("is-hidden"); 203 $selectPopup[type==="popup"?"removeClass":"addClass"]("is-hidden"); 204 }else{ 205 $imgLink[type==="link"?"removeClass":"addClass"]("is-hidden"); 206 $imgLinkFile[type==="link"?"addClass":"removeClass"]("is-hidden"); 207 $selectPopup.addClass("is-hidden"); 208 } 209 }); 210 211 $btnMapRegist.click(function(){ 212 213 // ë§µ ë±ë¡ ìì 214 var $popupSelect = $("#adc_crt_image_link_popup_select") 215 ,$linkText = $("#adcil_link_text") 216 ,$etcFile = $("#adcilf_attach") 217 ,$linkTarget = $(".adcil_btns_link option:selected"); 218 219 if(!parents.vars.editId){ 220 alert('ì´ë¯¸ì§ìì ìì í ë§µë°ì´í를 ì ííì¬ì£¼ì¸ì.'); 221 return false; 222 } 223 224 // close, day_close 모ë ë±ë¡ ëë¬ì¼ ì ì¥ëê²...ìê·¸ë¼ radioí´ë¦ë§ì¼ë¡ ì´ì ì ë³´ ì체를 ë ë ¤ë²ë¦¼ 225 var type = $(".adcil_btns:checked").attr('data-type') 226 ,url = "" 227 ,target = ""; 228 229 if(!type) return false; 230 if(type==="link"){ 231 url = $linkText.val(); 232 if(!url){ 233 alert('ë§í¬ë¥¼ ì ë ¥íì¬ ì£¼ì¸ì.'); 234 $linkText.focus(); 235 return false; 236 } 237 238 target = $linkTarget.val(); 239 }else if(type==="popup"){ 240 url = $popupSelect.val(); 241 if(!url){ 242 alert('íì ì ì ííì¬ ì£¼ì¸ì.') 243 $popupSelect.focus(); 244 return false; 245 } 246 }else if(type==="file"){ 247 if(!$etcFile.val()){ 248 alert('íì¼ì ì ííì¬ ì£¼ì¸ì.'); 249 $etcFile.focus(); 250 return false; 251 } 252 253 parents.uploadAttachTmpFile(); 254 255 return false; 256 } 257 258 parents.insertData({ 259 type:type 260 ,url:url 261 ,target:target
262 }) 263 return false; 264 }); 265 } 266 267 // ì´ë¯¸ì§ë§µì íì¼ì¼ë ì ì¥ 268 ,uploadAttachTmpFile:function() 269 { 270 var parents = this 271 ,iframe = this.vars.iframe 272 ,form = document.adc_form; 273 274 $(document.body).append(iframe); 275 276 form.action = "/bannerpop/upload_act.php"; 277 form.target = "adc_up_frame"; 278 form.submit(); 279 } 280 281 // ì´ë¯¸ì§ë§µì ììíì¼ì ì¥í ë¦¬í´ ê° 282 ,afterUploadAttachTmpFile:function(result) 283 { 284 // ì±ê³µì´ë ìëë í¼ì ì¼ë¨ ì´ê¸°íí¨ 285 this.releaseForm(); 286 $("#adc_up_frame").remove(); 287 288 var json = $.parseJSON(adWrite.rawurldecode(result)) 289 ,filename = json[0].filename; 290 291 if(!filename){ 292 alert('ì ë¡ëì ìë¬ê° ë°ìíìµëë¤. ë¤ì ì ë¡ëíì¬ ì£¼ì¸ì.'); 293 return false; 294 } 295 296 this.insertData({type:"file",url:filename,target:"self",json_obj:result}); 297 } 298 299 //rawurldecode 300 ,rawurldecode:function(str) { 301 return decodeURIComponent((str + '') 302 .replace(/%(?![\da-f]{2})/gi, function() { 303 return '%25'; 304 })); 305 } 306 307 // ì´ë¯¸ì§ë§µ ì ë ¥í¼ ì´ê¸°í 308 ,initInsertForm:function(data) 309 { 310 var parents = this 311 ,type = data.type||"link" 312 ,$btns = $(".adcil_btns") 313 ,$imgLink = $("#adc_crt_image_link") 314 ,$imgLinkFile = $("#adc_crt_image_link_file") 315 ,$selectPopup = $("#adc_crt_image_link_popup") 316 ,$filebox = $("#adcilf_uploaded_file"); 317 318 //$btns.filter("[data-type='"+type+"']").prop("checked", true); 319 $btns.filter("[data-type='"+type+"']").click(); // 커ì¤í radio box ë¼ì ì´ë ê² ì²ë¦¬ 320 $filebox.hide(); 321 322 if(type==="popup" || type==="close" || type==="day_close"){ 323 $imgLink.add($imgLinkFile).addClass("is-hidden"); 324 $selectPopup[type==="popup"?"removeClass":"addClass"]("is-hidden"); 325 326 if(type==="popup") $("#adc_crt_image_link_popup_select").val(data.url); 327 328 }else{ 329 $imgLink[type==="link"?"removeClass":"addClass"]("is-hidden"); 330 $imgLinkFile[type==="link"?"addClass":"removeClass"]("is-hidden"); 331 $selectPopup.addClass("is-hidden"); 332 333 if(type==="link"){ 334 $(".adcil_btns_link option[value="+(data.target||"blank")+"]").prop("selected", true); 335 $("#adcil_link_text").val(data.url) 336 }else if(type==="file"){ 337 var $attach = $("#adcilf_attach") 338 ,$delBtn = $("#adcilfuf_btn") 339 ,$filename = $("#adcilfuf_file") 340 ,$fmode = $filename.attr('data-type'); 341 342 $attach.replaceWith($attach.clone()); 343 344 if(data.url){ 345 // íì¼ìì 346 $filebox.show(); 347 $filename.html(data.url); 348 $delBtn.unbind("click").on("click", function(){ 349 if(confirm("ìë²ìì íì¼ì´ ë°ë¡ ì ê±°ë©ëë¤.\nê·¸ëë ìì íìê² ìµëê¹?")) { 350 var file = data.url 351 ,extension = file.split('.').pop().toLowerCase() 352 ,filename = file.replace('.'+extension,''); 353 354 $.post(SITE_DOMAIN + "/bannerpop/upload_act.php" 355 ,{mode:'dlt', fmode:$fmode, idxno:document.adc_form.idxno.value||"", filename:file} 356 ,function(data,rst){ 357 if(rst==="success"){ 358 if(data.result==="success"){ 359 $filename.empty(); 360 $filebox.hide(); 361 parents.insertData({type:"file", url:"", target:"", json_obj:""}, "no"); 362 //alert(decodeURIComponent(data.msg)); 363 }else alert(decodeURIComponent(data.msg)); 364 }else alert('ìì±í ì ìë í ì íì를 ì´ê³¼íììµëë¤.'); 365 },"json"); 366 } 367 }); 368 } 369 } 370 } 371 } 372 373 // ììí¼ ì´ê¸°í 374 ,releaseForm:function(form) 375 { 376 if(!form) form = document.adc_form; 377 378 // í´ì 379 form.action = this.vars.act; 380 form.target = ""; 381 } 382 383 // ë°ì´í ì»ì´ì¤ê¸° 384 ,getHiddenData:function() 385 { 386 var $id = $("#input_"+this.vars.editId) 387 ,val = $id.val().split(this.vars.separator); 388 389 return {id:$id, val:val}; 390 } 391 392 // input type ì ë£ì 393 ,insertData:function(data, isInit) 394 { 395 if(!data) data={}; 396 if(!this.vars.editId) return false; 397 if(!isInit) isInit = "ok"; 398 399 var $data = this.getHiddenData() 400 ,$id = $data.id 401 ,val = $data.val; 402 403 if(val.length<=0) return false; 404 405 val.splice(4, 4, data.type, data.url, data.target, (data.type == 'file' && data.url) ? data.json_obj : '') 406 var value = val.join(this.vars.separator); 407 408 $id.val(value); 409 410 if(isInit==="ok") { 411 $("#link_event_tag").val("") 412 this.initInsertForm({type:"link", url:"", target:"self"}); 413 } 414 this.vars.editId = null; 415 416 alert('ì ì©ëììµëë¤.'); 417 } 418 419 // ìì í¼ 420 ,modifyForm:function(id) 421 { 422 if(!id) return false; 423 this.vars.editId = id; 424 425 var $data = this.getHiddenData() 426 ,val = $data.val 427 ,type = val[4]||"link" 428 ,url = val[5]||"" 429 ,target = val[6]||"self"; 430 431 //ì´ë¯¸ì§ë§µì íì¼ì¸ì§, ì ì²´ë§í¬ì íì¼ì¸ì§ 구ë¶ì§ê¸° ìí¨ 432 $("#adcilfuf_file").attr('data-type', 'M' + (Number(this.vars.editId.replace(/[^0-9]/g,'')) + 1)); 433 434 this.initInsertForm({type:type, url:url, target:target}); 435 this.mapBlinkArea(); 436 } 437 438 // ì´ë¯¸ì§ ë§µ ì¡ê¸° ìí´ ìì ì ì¥ 439 ,afterUploadTmpFile:function(json) 440 { 441 var form = document.adc_form 442 ,result = json.result||"error" 443 ,data = json.data||"" 444 ,width = json.width||"" 445 ,height = json.height||"" 446 ,mime = json.mime||""; 447 448 // í´ì 449 this.releaseForm(form); 450 451 if(result === "error"){ 452 alert(data); 453 return false; 454 } 455 456 // ëì¤ì í¼ nameì¼ë¡ ë°ê¿ê²!!! 457 //$("#adc_crt_popup_size_width").val(width); 458 //$("#adc_crt_popup_size_height").val(height); 459 if(form.popup_width) form.popup_width.value = width; 460 if(form.popup_height) form.popup_height.value = height; 461 462 // ì°½ ë³´ì´ê³ , ì´ë¯¸ì§ 미리보기 - íìëë ì¬ì´ì¦ ì¬ì¤ê¸° 463 $("#adc_crt_image_preview_box").show(); 464 $("#adc_crt_file_image").attr({"src":"data:"+mime+";base64,"+data, "data-width":width, "data-height":height}); 465 466 // ìë¡ ì¬ë¦°ê²ì´ë, ë¡ë©ëí 모ë ì´ì ì ì ì¥ë ë§µ ì ë³´ ë 림 467 // ì´ì ë°ì´í ìì 468 this.mapDeleteAll(); 469 } 470 471 472 // ë¹ì¨ëë¡ ì¢í ê³ì°í기 473 ,mapCalcPositionRatio:function(val, ratio) 474 { 475 if(ratio === 1) return val; 476 477 return Math.round(val * ratio); 478 } 479 480 // ë¹ì¨ëë¡ ì¢í ê³ì°í기-ì¶ì 481 ,mapScalePositionRatio:function(val, ratio) 482 { 483 if(ratio === 1) return val; 484 485 return Math.round(val / ratio); 486 } 487 488 /** 489 * input type="hidden" ìì± 490 * id : string 491 * pos : object - ì¤ì ìì¹ 492 * kind : string - ë§í¬,íì¼ ë± 493 * url : string - ë§í¬, javascript function 494 * target : string - íì¬ì°½,ìì°½,ë¶ëª¨ì°½ 495 */ 496 ,mapHidden:function($form, id, pos, kind, url, target) 497 { 498 var inputId = "input_"+id 499 ,val = [pos.x1, pos.y1, pos.x2, pos.y2, kind, url, target].join(this.vars.separator) 500 ,input = '<input type="hidden" name="link_url[]" id="'+inputId+'" class="adc_crt_image_map_data" value="'+val+'" />'; 501 502 $form.append(input); 503 } 504 505 // ìì±ë ë§µ ìì 506 ,mapDelete:function(id) 507 { 508 var bId = "btn_"+id 509 ,inputId = "input_"+id; 510 511 $("#"+id+",#"+bId+",#"+inputId).remove(); 512 this.initInsertForm({type:"link", url:"", target:"self"}); 513 alert('ìì ëììµëë¤.'); 514 } 515 516 // ìì±ë ë§´ ì ì²´ ìì 517 ,mapDeleteAll:function() 518 { 519 $(".adc_crt_image_map_data, .ad-map, .ad-map-btns").remove(); 520 } 521 522 // ì ë ¥ë¶ë¶ ê¹ë¹¡ì 523 ,mapBlinkArea:function() 524 { 525 var parents = this; 526 parents.vars.$textBox.addClass("ad-map-bg"); 527 setTimeout(function(){ 528 parents.vars.$textBox.removeClass("ad-map-bg") 529 },500); 530 } 531 532 // ì´ë¯¸ì§ ë§µ ì¡ê¸° 533 ,map:function(target) 534 { 535 var parents = this 536 ,$img = !!target.jquery ? target : $(target) 537 ,width = Number($img.attr("data-width"))||0 // ì¤ì ì¬ì´ì¦ 538 ,height = Number($img.attr("data-height"))||0 539 ,dWidth = Number($img.attr("data-display-width"))||0 // íì ì¬ì´ì¦ 540 ,dHeight = Number($img.attr("data-display-height"))||0 541 ,ratio = width>dWidth ? Number((width/dWidth).toFixed(1)) : 1 // ì¤ì ì¬ì´ì¦ê° íìë ì¬ì´ì¦ë³´ë¤ í´ê²½ì° ë¹ì¨ ë§ì¶ê¸° ìí´ 542 ,box = parents.vars.box 543 ,buttons = parents.vars.buttons 544 ,$imgmapRadio = $("#adc_crt_image_link_part") 545 ,$imgmapBtnRegist = $("#adc_crt_img_link_btn_regist") 546 ,$form = $("#adc_form"); 547 548 549 return { 550 exe:function() 551 { 552 this.canvas().loadData().addEvent(); 553 } 554 555 // ë§ë¶ì´ê¸° 556 ,canvas:function() 557 { 558 $img.next("#adc_crt_edit_canvas").remove().end().after('<div id="adc_crt_edit_canvas" class="ad-canvas" style="left:'+$img.position().left+'px;width:'+dWidth+'px;height:'+dHeight+'px"></div>'); 559 return this; 560 } 561 562 // ë¡ëë ë§µ ë°ì´íì ë°ë¼ 그리기 563 ,loadData:function() 564 { 565 var _parent = this 566 ,$input = $(".adc_crt_image_map_data") 567 ,$canvas = $("#adc_crt_edit_canvas"); 568 569 // ì ì²´ì íì´ë¼ë©´ 570 if($input.length<=0){ 571 parents.initInsertForm(parents.vars.loadData); 572 return this; 573 } 574 575 if($input.length>0) $('#link_event_tag').hide(); 576 577 // ì´ë¯¸ì§ ë§µ ì¤ì ì¼ë¡ ìì 578 $imgmapRadio.not(":checked").prop("checked", true); 579 $imgmapBtnRegist.show(); 580 581 $.each($input, function(i,ele){ 582 var $ele = $(ele) 583 ,id = ele.id.replace("input_","") 584 ,val = $ele.val().split(parents.vars.separator)||[] 585 ,x1 = val[0]||0 586 ,y1 = val[1]||0 587 ,x2 = val[2]||0 588 ,y2 = val[3]||0 589 ,type = val[4]||"link" 590 ,url = val[5]||"" 591 ,target = val[6]||"self"; 592 593 _parent.display($canvas, id, {x1:x1, y1:y1, x2:x2, y2:y2}); 594 }); 595 596 return this; 597 } 598 599 // ìì 그림 600 ,display:function($canvas, id, data) 601 { 602 if(!data) data={}; 603 604 var $box = $(parents.vars.box) 605 ,$buttons = $(parents.vars.buttons) 606 ,offsetGap = $canvas.position().left||0 // ì ë ì¢íì´ê¸°ì ìºë°ì¤ë³´ë¤ ìì ì´ë¯¸ì§ì¼ê²½ì° gapë§í¼ ëí´ì íìí´ì¤ 607 ,bId = "btn_"+id 608 ,x1 = (Number(parents.mapScalePositionRatio(data.x1, ratio))+offsetGap)||0 609 ,y1 = parents.mapScalePositionRatio(data.y1, ratio)||0 610 ,x2 = (Number(parents.mapScalePositionRatio(data.x2, ratio))+offsetGap)||0 611 ,y2 = parents.mapScalePositionRatio(data.y2, ratio)||0 612 ,width = Math.abs(x1-x2) 613 ,height = Math.abs(y1-y2); 614 615 // ë²í¼ ë§ë¤ê¸°
616 $buttons.css({"top":y1+"px", "left":x2+"px"}).attr({"id":bId}) 617 .find(".adcmb_button").click(function(){ 618 var $this = $(this) 619 ,isModify = $this.is(".adcmb_modify"); 620 621 if(isModify===true){ 622 parents.modifyForm(id); 623 }else{ 624 parents.mapDelete(id); 625 } 626 }); 627 628 // box ë§ë¤ê¸° 629 $box.css({"top":y1+"px", "left":x1+"px", "width":width, "height":height}).attr({"id":id}); 630 631 $canvas.after($box); 632 $box.after($buttons); 633 634 return this; 635 } 636 637 // event 638 ,addEvent:function() 639 { 640 var _this = this 641 ,position = {x:0, y:0} 642 ,$box = null 643 ,start = false; 644 645 $(document.body).off("mousedown mousemove mouseup touchstart touchmove touchend","#adc_crt_edit_canvas") 646 .on({ 647 "mousedown touchstart":function(event) 648 { 649 start = true; 650 651 var $this = $(this) 652 ,evt = parents.getEventObject(window.event || event) 653 ,$evtTarget = $(evt.target||evt.srcElement) 654 ,offsetGap = $evtTarget.position().left // ìëìì¹ê¸° ë문ì ê° left ê°ì ëí´ì¤ì¼ í¨ 655 ,x = Math.round(evt.offsetX||(evt.pageX-$evtTarget.offset().left)) 656 ,y = Math.round(evt.offsetY||(evt.pageY-$evtTarget.offset().top)) 657 ,id = "acem_"+new Date().getTime(); 658 659 position.x = x; 660 position.y = y; 661 662 $box = $(box).css({"top":y, "left":x+offsetGap}).attr({"id":id}) 663 $this.after($box); 664 665 //evt.cancelBubble = true; 666 //evt.stopPropagation(); 667 //evt.preventDefault(); 668 } 669 670 ,"mousemove touchmove":function(event) 671 { 672 if(start === true){ 673 var evt = parents.getEventObject(window.event || event) 674 ,$evtTarget = $(evt.target||evt.srcElement) 675 ,offsetGap = $evtTarget.position().left // ìëìì¹ê¸° ë문ì ê° left ê°ì ëí´ì¤ì¼ í¨ 676 ,x = Math.round(evt.offsetX||(evt.pageX-$evtTarget.offset().left)) 677 ,y = Math.round(evt.offsetY||(evt.pageY-$evtTarget.offset().top)) 678 //,width = Math.abs(x-position.x)-5 679 //,height = Math.abs(y-position.y)-5 680 ,width = Math.abs(x-position.x) 681 ,height = Math.abs(y-position.y) 682 ,css = {}; 683 684 css = {"width":width, "height":height}; 685 686 if(position.x>x && position.y>y){ // ì¢ì 687 css.left = position.x-width+offsetGap; 688 css.top = position.y-height; 689 }else if(position.x>x && position.y<y){ // ì¢í 690 css.left = position.x-width+offsetGap; 691 }else if(position.x<x && position.y>y){ // ì°ì 692 css.top = position.y-height; 693 } 694 695 $box.css(css); 696 } 697 } 698 699 ,"mouseup touchend":function(event) 700 { 701 start = false; 702 703 // $box기ì¤ì¼ë¡ x1,y1,x2,y2 ê°ì ¸ì´ 704 var width = $box.width() 705 ,height = $box.height(); 706 707 if(width<20 && height<20){ 708 $box.remove(); 709 return false; 710 } 711 712 var $buttons = $(buttons) 713 ,evt = parents.getEventObject(window.event || event) 714 ,$evtTarget = $(evt.target||evt.srcElement) 715 ,offsetGap = $evtTarget.position().left // ìëìì¹ê¸° ë문ì ê° left ê°ì ë¹¼ì¤ì¼ì§ ì§ì§ ë§µì´ ë¨ 716 ,pos = $box.css(["top","left"]) 717 ,x1 = parents.castIntFromCss(pos.left) 718 ,y1 = parents.castIntFromCss(pos.top) 719 ,id = $box.attr("id") 720 ,bId = "btn_"+id 721 ,inputId = "input_"+id 722 ,info = { x1 : x1, y1 : y1, x2 : x1 + width, y2 : y1 + height } 723 ,real = { x1 : parents.mapCalcPositionRatio(info.x1, ratio)-offsetGap, y1 : parents.mapCalcPositionRatio(info.y1, ratio), x2 : parents.mapCalcPositionRatio(info.x2, ratio)-offsetGap, y2 : parents.mapCalcPositionRatio(info.y2, ratio)}; 724 725 // ìì ìì ì´ë²¤í¸ 726 $buttons.css({"top":info.y1, "left":info.x2}).attr({"id":bId}) 727 .find(".adcmb_button").click(function(){ 728 var $this = $(this) 729 ,isModify = $this.is(".adcmb_modify"); 730 731 if(isModify===true){ 732 parents.modifyForm(id); 733 }else{ 734 parents.mapDelete(id); 735 } 736 });
737 738 $box.after($buttons); 739 parents.mapHidden($form, id, real, "", "", ""); 740 parents.initInsertForm({type:"link", url:"", target:"self"}); // í¼ ì´ê¸°í 741 parents.vars.editId = id; 742 743 // ì´ë¯¸ì§ë§µì¼ë¡ ì²´í¬ 744 $imgmapRadio.not(":checked").click().prop("checked", true); 745 $imgmapBtnRegist.show(); 746 747 parents.mapBlinkArea(); // ê¸ì°ê¸° í¼ ì´íí¸ 748 749 //util.toast(lang.adcRequireLink); 750 } 751 },"#adc_crt_edit_canvas"); 752 753 return this; 754 } 755 756 }.exe(); 757 } 758 759 // jquery ì´ë²¤í¸ ë±ë¡ ì¬ì©ì, ì´ë²¤í¸ ììë´ê¸° 760 ,getEventObject:function(e) 761 { 762 var evt = window.event||e; 763 evt = evt.targetTouches?evt.targetTouches[0]:evt; // jquery touch event 764 return evt; 765 } 766 767 // css pxì ê±°í ì«ìíì¼ë¡ 768 ,castIntFromCss:function(v) 769 { 770 return Number(v.replace("px","")); 771 } 772 773 // listìì ë²í¼ ì´ë²¤í¸ 774 ,evtClickedButtons:function() 775 { 776 // edit 777 var edit_info = $('#admin-ad-list') 778 ,edit_section = edit_info.attr("data-edit-section") 779 ,edit_area = edit_info.attr("data-edit-area") 780 ,edit_step = edit_info.attr("data-edit-step") 781 ,edit_idxno = edit_info.attr("data-edit-idxno") 782 ,edit_mode = edit_info.attr("data-edit-mode") 783 ,org_banner_kind = edit_info.attr("data-edit-org-banner-kind") 784 ,banner_kind = edit_info.attr("data-edit-banner-kind") 785 ,page = edit_info.attr("data-page") 786 //,tmp_banner_idxno = edit_info.attr("data-edit-tmp-banner-idxno") 787 ,sc_area = edit_info.attr("data-search-scarea") 788 ,sc_word = encodeURIComponent(edit_info.attr("data-search-scword")) 789 790 $(".ad-tile-toolkit, .content-inert").on("click", "button" 791 , function(){ 792 var $this = $(this) 793 ,type = $this.attr("data-btn-type") 794 ,$parent = $this.closest(".adccfg_list_items") 795 ,bannerIdxno = $parent.attr("data-banner-idxno") 796 ,banner_type = $parent.attr("data-banner-type") 797 ,linkInfo = $parent.attr("data-link-info") 798 ,title = $.trim($parent.find(".acli_title").text()) 799 ,state = $.trim($parent.find(".ad-tile-state").text()) 800 ,Imgbp_Tag = $.trim($parent.find(".Imgbp_Tag").html()); 801 802 switch(type){ 803 case "add": 804 if(banner_type == 'popup') { 805 var data = {'mode':edit_mode,'section':edit_section,'popup_title':encodeURIComponent(title),'popup_idxno':bannerIdxno} 806 adWrite.addEditPopupContents(data); 807 }else{ 808 var data = {mode:edit_mode,'idxno':edit_idxno,'area':edit_area,'section':edit_section,'step':edit_step,'banner_title':encodeURIComponent(title),'banner_idxno':bannerIdxno,'kind':banner_kind,'edit_msg':'ì íí ë°°ëë¡ êµì²´íìê² ìµëê¹?'}; 809 adWrite.addEditContents(data); 810 } 811 break; 812 case "down": 813 location.href = '/bannerpop/attach_down.php?idxno='+bannerIdxno+'&mode=O'; 814 break; 815 case "linkInfo": // ì ë¡ëë íì¼ ë§í¬ ë³µì¬ 816 var source = '/bannerpop/uploads/image/'+linkInfo; 817 adWrite.copyExe(source); 818 break; 819 case "sourceCopy": // ìì¤ë³µì¬ 820 /*if(state == '무ì í') { 821 if(!Imgbp_Tag) return false; 822 var _html = '<!--'+title+'-->' 823 + Imgbp_Tag 824 + '<!--//'+title+'-->'; 825 }else{*/ 826 var _time = new Date().getTime() 827 ,_html = '<!--'+title+'-->' 828 + '<script type="text/javascript">var ___BANNER = "ban_'+_time+'";</script>' 829 + '<script type="text/javascript" charset="utf-8" src="/bannerpop/uploads/js/'+bannerId
829xno+'.js?'+_time+'" id="ban_'+_time+'"></script>' 830 + '<!--//'+title+'-->'; 831 //} 832 833 adWrite.copyExe(_html); 834 break; 835 case "preview": 836 if(!window.___popup) return false; 837 838 var p = ___popup[bannerIdxno]; 839 840 if(!p) return false; 841 if(!window.___currentTime) window.___currentTime = Math.floor(new Date().getTime()/1000);// ìê°ì´ ì¤ì ëì§ ììë¤ë©´ js ìê°ì¼ë¡ ì¤ì í¨ 842 843 // ê´ë¦¬ìë§... 844 $(".layer_box").remove(); // ë¤ë¥¸ê² ì´ë ¤ìë¤ë©´ ìì 845 bannerpop.vars.popup.view = "manager"; 846 bannerpop.float(p); 847 break; 848 case "mdf": 849 var $ahref = '/bannerpop/'; 850 $ahref += edit_section ? 'edit.html' : 'write.html'; 851 $ahref += '?type='+banner_type+'&mode=modify&idxno='+bannerIdxno+'&page='+page; 852 if(edit_section) $ahref += '&edit_section=' + edit_section; 853 if(edit_area) $ahref += '&edit_area=' + edit_area; 854 if(edit_step) $ahref += '&edit_step=' + edit_step; 855 if(edit_idxno) $ahref += '&edit_idxno=' + edit_idxno; 856 if(edit_mode) $ahref += '&edit_mode=' + edit_mode; 857 //if(tmp_banner_idxno) $ahref += '&tmp_banner_idxno=' + tmp_banner_idxno; 858 if(org_banner_kind) $ahref += '&org_banner_kind=' + org_banner_kind; 859 if(banner_kind) $ahref += '&banner_kind=' + banner_kind; 860 if(sc_area) $ahref += '&sc_area=' + sc_area; 861 if(sc_word) $ahref += '&sc_word=' + sc_word; 862 location.href = $ahref; 863 break; 864 case "del": 865 if(window.confirm('ìì í ê¹ì?')) { 866 var $ahref = '/bannerpop/delete_act.php?type='+banner_type+'&idxno='+bannerIdxno+'&page='+page; 867 if(edit_section) $ahref += '&edit_section=' + edit_section; 868 if(edit_area) $ahref += '&edit_area=' + edit_area; 869 if(edit_step) $ahref += '&edit_step=' + edit_step; 870 if(edit_idxno) $ahref += '&edit_idxno=' + edit_idxno; 871 if(org_banner_kind) $ahref += '&org_banner_kind=' + org_banner_kind; 872 if(banner_kind) $ahref += '&banner_kind=' + banner_kind; 873 if(sc_area) $ahref += '&sc_area=' + sc_area; 874 if(sc_word) $ahref += '&sc_word=' + sc_word; 875 location.href = $ahref; 876 } 877 break; 878 case "mdf_activity": 879 var $ahref = '/bannerpop/'; 880 $ahref += edit_section ? 'edit.html' : 'write_activity.html'; 881 $ahref += '?type='+banner_type+'&mode=modify&activity_idxno='+bannerIdxno+'&page='+page; 882 if(edit_section) $ahref += '&edit_section=' + edit_section; 883 if(edit_area) $ahref += '&edit_area=' + edit_area; 884 if(edit_step) $ahref += '&edit_step=' + edit_step; 885 if(edit_idxno) $ahref += '&edit_idxno=' + edit_idxno; 886 if(edit_mode) $ahref += '&edit_mode=' + edit_mode; 887 if(org_banner_kind) $ahref += '&org_banner_kind=' + org_banner_kind; 888 if(banner_kind) $ahref += '&banner_kind=' + banner_kind; 889 //if(tmp_banner_idxno) $ahref += '&tmp_banner_idxno=' + tmp_banner_idxno; 890 if(sc_area) $ahref += '&sc_area=' + sc_area; 891 if(sc_word) $ahref += '&sc_word=' + sc_word; 892 location.href = $ahref; 893 break; 894 case "del_activity": 895 if(window.confirm('ìì í ê¹ì?')) { 896 var $ahref = '/bannerpop/delete_activity_act.php?type='+banner_type+'&activity_idxno='+bannerIdxno+'&page='+page; 897 if(edit_section) $ahref += '&edit_section=' + edit_section; 898 if(edit_area) $ahref += '&edit_area=' + edit_area; 899 if(edit_step) $ahref += '&edit_step=' + edit_step; 900 if(edit_idxno) $ahref += '&edit_idxno=' + edit_idxno; 901 if(org_banner_kind) $ahref += '&org_banner_kind=' + org_banner_kind; 902 if(banner_kind) $ahref += '&banner_kind=' + banner_kind; 903 if(sc_area) $ahref += '&sc_area=' + sc_area; 904 if(sc_word) $ahref += '&sc_word=' + sc_word; 905 location.href = $ahref; 906 } 907 break; 908 case "sourceCopy_activity": // ìì¤ë³µì¬ 909 var _time = new Date().getTime() 910 ,_html = '<!--'+title+'-->' 911 + '<script type="text/javascript">var ___BANNER = "ban_'+_time+'";</script>' 912 + '<script type="text/javascript" charset="utf-8" src="/bannerpop/uploads/js_activity/'+bannerId
912xno+'.js?'+_time+'" id="ban_'+_time+'"></script>' 913 + '<!--//'+title+'-->'; 914 915 adWrite.copyExe(_html); 916 break; 917 case "mdf_multi": 918 var $ahref = '/bannerpop/'; 919 $ahref += edit_section ? 'edit.html' : 'write_activity_multi.html'; 920 $ahref += '?type='+banner_type+'&mode=modify&multi_idxno='+bannerIdxno+'&page='+page; 921 if(edit_section) $ahref += '&edit_section=' + edit_section; 922 if(edit_area) $ahref += '&edit_area=' + edit_area; 923 if(edit_step) $ahref += '&edit_step=' + edit_step; 924 if(edit_idxno) $ahref += '&edit_idxno=' + edit_idxno; 925 if(edit_mode) $ahref += '&edit_mode=' + edit_mode; 926 if(org_banner_kind) $ahref += '&org_banner_kind=' + org_banner_kind; 927 if(banner_kind) $ahref += '&banner_kind=' + banner_kind; 928 //if(tmp_banner_idxno) $ahref += '&tmp_banner_idxno=' + tmp_banner_idxno; 929 if(sc_area) $ahref += '&sc_area=' + sc_area; 930 if(sc_word) $ahref += '&sc_word=' + sc_word; 931 location.href = $ahref; 932 break; 933 case "del_multi": 934 if(window.confirm('ìì í ê¹ì?')) { 935 var $ahref = '/bannerpop/delete_activity_multi_act.php?type='+banner_type+'&multi_idxno='+bannerIdxno+'&page='+page; 936 if(edit_section) $ahref += '&edit_section=' + edit_section; 937 if(edit_area) $ahref += '&edit_area=' + edit_area; 938 if(edit_step) $ahref += '&edit_step=' + edit_step; 939 if(edit_idxno) $ahref += '&edit_idxno=' + edit_idxno; 940 if(org_banner_kind) $ahref += '&org_banner_kind=' + org_banner_kind; 941 if(banner_kind) $ahref += '&banner_kind=' + banner_kind; 942 if(sc_area) $ahref += '&sc_area=' + sc_area; 943 if(sc_word) $ahref += '&sc_word=' + sc_word; 944 location.href = $ahref; 945 } 946 break; 947 case "sourceCopy_multi": 948 var _time = new Date().getTime() 949 ,_html = '<!--'+title+'-->' 950 + '<script type="text/javascript">var ___BANNER = "ban_'+_time+'";</script>' 951 + '<script type="text/javascript" charset="utf-8" src="/bannerpop/uploads/js_multi/'+bannerIdxno+'.js?'+_time+'" id="ban_'+_time+'"></script>' 952 + '<!--//'+title+'-->'; 953 adWrite.copyExe(_html); 954 break; 955 } 956 957 return false; 958 }); 959 } 960 961 //ìì ì ì¹ì í 컨í ì¸ ì½ì 962 ,addEditContents:function(data) 963 { 964 //var flag = false; 965 var flag = true; 966 967 /*if(data.mode == 'modify') { 968 if(data.tmp_banner_idxno != data.banner_idxno) { 969 if(confirm(data.edit_msg)) flag = true; 970 else flag = false; 971 }else flag = true; 972 }else flag = true;*/ 973 974 if(flag) { 975 data = JSON.stringify(data); 976 $.ajax({ 977 url:"/edit/adminReservationBannerWrite.php" 978 ,type:'post' 979 ,dataType:'json' 980 ,contentType:'application/x-www-form-urlencoded; charset=utf-8' 981 ,data:{post_data:data} 982 ,success:function(json, result) { 983 if(result == 'success') { 984 if(json.response == 'ok') { 985 window.parent.location.reload(); 986 }else{ 987 alert(json.msg); 988 return false; 989 } 990 }else return false; 991 } 992 }); 993 }else{ 994 return false; 995 } 996 } 997 998 //ìì ì ì¹ì í 컨í ì¸ ì½ì 999 ,addEditPopupContents:function(data) 1000 { 1001 data = JSON.stringify(data); 1002 $.ajax({ 1003 url:"/edit/adminReservationPopupWrite.php" 1004 ,type:'post' 1005 ,dataType:'json' 1006 ,contentType:'application/x-www-form-urlencoded; charset=utf-8' 1007 ,data:{post_data:data} 1008 ,success:function(json, result) { 1009 if(result == 'success') { 1010 if(json.response == 'ok') { 1011 //window.parent.location.reload(); 1012 parent.$('#edit-modal').find('.close-buttons').trigger('click'); 1013 adWrite.addPopupContentsList(json); 1014 }else{ 1015 alert(json.msg); 1016 return false; 1017 } 1018 }else return false; 1019 } 1020 }); 1021 } 1022 1023 ,addPopupContentsList:function(json) { 1024 var html = ''; 1025 1026 console.log(json); 1027 1028 if(json.rows.length>0) { 1029 for(var i = 0; i < json.rows.length; i++) { 1030 var index = i+1; 1031 html += '<!-- íì //-->';
1032 html += '<div class="option-popup-item">'; 1033 html += ' <input type="radio" name="editPopup" id="editPopup' + index + '" class="popup_element_ckecked" title="' + adWrite.rawurldecode(json.rows[i].popup_title) + '" data-idxno="' + json.rows[i].idxno + '" data-step="' + json.rows[i].step + '" value="' + json.rows[i].popup_idxno + '" />'; 1034 html += ' <label for="editPopup' + index + '">'; 1035 if(json.rows[i].popup_image && json.rows[i].extension != 'swf') { 1036 html += '<img src="/bannerpop/uploads/image/' + json.rows[i].popup_image + '" alt="' + adWrite.rawurldecode(json.rows[i].popup_title) + '" />'; 1037 }else{ 1038 if(json.rows[i].extension == 'swf') html += 'SWF'; 1039 else html += 'HTML'; 1040 } 1041 html += ' <div class="option-popup-item-title">' + adWrite.rawurldecode(json.rows[i].popup_title) + '</div>'; 1042 html += ' </label>'; 1043 html += '</div>'; 1044 html += '<!--// íì -->'; 1045 } 1046 } 1047 1048 parent.$('.option-popup-group').html(html); 1049 } 1050 1051 //ì ì²´ì íãí´ì 1052 ,allChk:function() 1053 { 1054 var $allChk = $('#allCheck'); 1055 $allChk.click(function(){ 1056 if($(this).is(':checked') == true) { 1057 $('.elembox').prop('checked',true); 1058 }else{ 1059 $('.elembox').prop('checked',false); 1060 } 1061 }); 1062 } 1063 1064 /** 1065 * í´ë¦½ë³´ë ë³µì¬ 1066 * source : ë³µì¬í ì ë³´ 1067 */ 1068 ,copyExe:function(source) 1069 { 1070 if(window.clipboardData){ // ie 1071 window.clipboardData.setData('Text',source); 1072 alert("ë³µì¬ëììµëë¤. ìíë ê³³ì ë¶ì¬ë£ê¸°íì¬ ì£¼ì¸ì."); 1073 }else{ // etc 1074 1075 var $tmpDiv=$('<div class="blind">'+source.replace(/</g,"<").replace(/>/g,">")+'</div>').appendTo("body") 1076 ,range=document.createRange() 1077 ,selection=null; 1078 1079 range.selectNodeContents($tmpDiv.get(0)); 1080 selection=window.getSelection(); 1081 selection.removeAllRanges(); 1082 selection.addRange(range); 1083 1084 if(document.execCommand("copy", false, null)) alert("ë³µì¬ëììµëë¤. ìíë ê³³ì ë¶ì¬ë£ê¸°íì¬ ì£¼ì¸ì."); 1085 else window.prompt('í¤ë³´ëì ctrl+C ëë ë§ì°ì¤ ì¤ë¥¸ìª½ì ë³µì¬í기를 ì´ì©í´ì£¼ì¸ì.', source); 1086 1087 $tmpDiv.remove(); 1088 } 1089 } 1090 1091 /** 1092 * 기ë¥ì± ë°°ë ì¶ê°/ììë³ê²½/ìì / 1093 */ 1094 ,evtClickActivityAdd:function() { 1095 //sessionStorage.removeItem("last_idx"); 1096 var activity_idxno=window.parent.$('#all-banner-list').closest('div').attr('data-activity-idxno')||''; 1097 $('#activity-add-btn').click(function() { 1098 var $this=$(this); 1099 //,$viewHref=$('#activity-view-btn').attr('href') 1100 //,$last_idx=(activity_idxno)?activity_idxno:sessionStorage.getItem('last_idx'); 1101 1102 if($('.banner_element_ckecked').is(':checked') == false) { 1103 alert('ë°°ë를 ì íí´ì£¼ì¸ì.'); 1104 //if(!$last_idx) $('#activity-view-btn').addClass('is-hidden'); 1105 return false; 1106 }else{ 1107 var $checked=$(".banner_element_ckecked:checked") 1108 ,arr = new Array(); 1109 if($checked.length>0) { 1110 $.each($checked, function(idx, v) { 1111 arr.push(v.value); 1112 }); 1113 1114 var data = {mode:activity_idxno?'modify':'input', activity_idxno:activity_idxno, banner_idxno:arr}; 1115 data = JSON.stringify(data); 1116 console.log(data); 1117 $.ajax({
1118 url:"/bannerpop/activity_act.php" 1119 ,type:'post' 1120 ,dataType:'json' 1121 ,contentType:'application/x-www-form-urlencoded; charset=utf-8' 1122 ,data:{post_data:data} 1123 ,success:function(json, result) { 1124 if(result == 'success') { 1125 if(json.response == 'ok') { 1126 //alert('ì¶ê°ëììµëë¤.\nì°ì¸¡ì ë²í¼ì í´ë¦íìë©´ ìì¸ íë©´ì¼ë¡ ì´ëí©ëë¤.'); 1127 /*if(!activity_idxno) { 1128 sessionStorage.setItem('last_idx', json.last_insert_id); 1129 $('#activity-view-btn').attr('href', $viewHref + '&activity_idxno='+json.last_insert_id); 1130 } 1131 $('#activity-view-btn').removeClass('is-hidden');*/ 1132 window.parent.location.reload(); 1133 }else{ 1134 //alert(json.msg); 1135 return false; 1136 } 1137 }else return false; 1138 }, 1139 error:function(request,status,error){ 1140 alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); 1141 } 1142 }); 1143 } 1144 } 1145 }); 1146 1147 $('#banner-activity-box').sortable({ 1148 axis: '', 1149 update: function() { 1150 //console.log($(this)); 1151 } 1152 }); 1153 1154 $('.trash').click(function() { 1155 if($('.banner-activity-list').length <= 1) { 1156 alert('ë§ì§ë§ ë°°ëë ìì í ì ììµëë¤.'); 1157 return false; 1158 } 1159 1160 var $this=$(this) 1161 ,$parent = $this.closest('.banner-activity-list'); 1162 1163 $parent.fadeOut('fast', function(){ 1164 $parent.remove(); 1165 }); 1166 }); 1167 1168 $('#all-banner-list').on('click', function(e) { 1169 1170 $this = $(this); 1171 href = $this.attr('href'); 1172 1173 $("#edit-modal-iframe").attr("src", href); 1174 $('#edit-modal').foundation('open'); 1175 1176 return false; 1177 }); 1178 1179 $('#edit-modal').on('open.zf.reveal', function(e){ 1180 $('#for-loading').show(); 1181 }); 1182 1183 $('#edit-modal').on('closed.zf.reveal', function(e){ 1184 $("#edit-modal-iframe").attr("src", "about:blank").height('0px').closest('#activity-modal').css('height', '0px'); 1185 }); 1186 } 1187 1188 ,valid_activity:function() { 1189 if($('#activity_title').val() == '') { 1190 alert('ì 목ì ì ë ¥íì¸ì.'); 1191 $('#activity_title').focus(); 1192 return false; 1193 } 1194 1195 if($('.banner-activity-list').length<=0) { 1196 alert('ë°°ë를 íë ì´ì ì¶ê°íì ì¼ í©ëë¤.'); 1197 return false; 1198 } 1199 1200 return true; 1201 } 1202 1203}; // end adWrite 1204 1205var bannerpop={ 1206 vars:{ 1207 popup:{ 1208 bodyWidth:0 1209 ,bodyLeft:0 1210 ,screenWidth:0 1211 ,popname:"popup_" 1212 ,width:{ window:[],layer:[] } 1213 ,height:{ window:[],layer:[] } 1214 ,top:{ window:[],layer:[] } 1215 ,left:{ window:[],layer:[] } 1216 ,order:0 // z-indexì© ìì°¨ì 1217 ,view:"normal" // ì¼ë° : normal or ê´ë¦¬ì : manager 1218 } 1219 } 1220 1221 /** 1222 * ë°°ë í¨ê³¼ 1223 * íê·¸ ìì± ì::: bannerpop.banner(".banner_event_box"); 1224 <div class="boder_box banner_event_box" data-type="slide" data-idxno="3" data-speed="0.3"> 1225 <div class="boder_box beb_box"> 1226 <ul class="no_type beb_ul"> 1227 <li class="beb_li" data-delay="1"><a href=""><img src="http://sample.ndsoftnews.com/template_sian/download.php?idxno=856&file_extension=jpg&filename=Untitled-1.jpg" alt="ë°°ë : ì 목" /></a></li> 1228 <li class="beb_li" data-delay="1"><a href=""><img src="http://sample.ndsoftnews.com/template_sian/download.php?idxno=854&file_extension=jpg&filename=250%B0%E6%B3%B2%B5%B5%B9%CE%BD%C5%B9%AE.jpg" alt="ë°°ë : ì 목" /></a></li> 1229 <li class="beb_li" data-delay="1"><a href=""><img src="http://sample.ndsoftnews.com/template_sian/download.php?idxno=846&file_extension=jpg&filename=330%C6%F7%C5%E4.jpg" alt="ë°°ë : ì 목" /></a></li> 1230 <li class="beb_li" data-delay="1"><a href=""><img src="http://sample.ndsoftnews.com/template_sian/download.php?idxno=848&file_extension=jpg&filename=675_weeklyjournal.jpg" alt="ë°°ë : ì 목" /></a></li> 1231 <li class="beb_li" data-delay="5"><iframe width="640" height="360" src="http://www.youtube.com/embed/dykTgBpgbVs?feature=player_detailpage" frameborder="0" allowfullscreen></iframe></li> 1232 </ul> 1233 </div> 1234 <div class="beb_buttons"> 1235 <button type="button" class="beb_btns beb_btn_prev">ë¤ë¡</button> 1236 <button type="button" class="beb_btns beb_btn_stop">ë©ì¶¤</button> 1237 <button type="button" class="beb_btns beb_btn_next">ìì¼ë¡</button>
1238 </div> 1239 </div> 1240 */ 1241 ,effect:function() 1242 { 1243 var savePrefix = "banner_order_"; 1244 1245 // ë°°ë ëì´ 1246 function setSizeInfo($this){ 1247 var idxno = $this.attr("data-idxno") 1248 ,$ul = $this.find(".beb_ul") 1249 ,$li = $ul.find(".beb_li") 1250 ,boxWidth = $this.innerWidth()||$this.closest("#float_side_box").width() // ì ì¬ì´ëì ë°°ëì¼ê²½ì° ì¬ì¸¡ì 1251 ,liCount = $li.length||0; 1252 1253 // ê´ë¦¬ì íì´ì§ê° ìëë ì¤ì ë ¸ì¶ì¤ì¸ ê²ë§ ì°¾ì 1254 //if(ADM_DOMAIN.indexOf(location.host)<0){ 1255 $.each($li,function(){ 1256 var $this=$(this), len=$this.find(".banner_box").length; 1257 if(!len) $this.remove(); 1258 }); 1259 $li = $ul.find(".beb_li"); 1260 liCount = $li.length||0; 1261 //} 1262 1263 // ë¶ëª¨ë°ì¤ 기ì¤ì¼ë¡ ul ìµë ëì´ ì§ì 1264 $ul.width(boxWidth*liCount); 1265 1266 // ë°°ëë§ë¤ ëì´ê° ë¤ë¥¼ì ìì¼ë ë¶ëª¨ë°ì¤ ëì´ê¸°ì¤ì¼ë¡í¨ 1267 $li.width(boxWidth); 1268 1269 return { 1270 idxno : idxno 1271 ,$ul : $ul 1272 ,$li : $li 1273 ,boxWidth : boxWidth 1274 ,liCount : liCount 1275 }; 1276 } 1277 1278 return { 1279 // ììëë¡ íëì ë°°ëë§ ë³´ì 1280 order:function(){ 1281 var _this = this 1282 ,$this = $(_this) 1283 ,$info = setSizeInfo($this) 1284 ,idxno = $info.idxno 1285 ,$li =$info.$li 1286 ,liCount = $info.liCount-1 1287 ,saveKey = savePrefix+idxno 1288 ,order = Number(localStorage.getItem(saveKey))||0; 1289 1290 // ëë¤ ì íëê²ë§ ë³´ì, ë²í¼ ìì° 1291 $li.css("display","list-item").not(":eq("+order+")").css("display","none"); 1292 1293 localStorage.setItem(saveKey, (order>=liCount ? 0 : order+1)); 1294 } 1295 1296 // random banner 1297 ,random:function(){ 1298 var _this = this 1299 ,$this = $(_this) 1300 ,$info = setSizeInfo($this) 1301 ,$li =$info.$li 1302 ,liCount = $info.liCount 1303 ,random = Math.floor(Math.random()*liCount); 1304 1305 // ëë¤ ì íëê²ë§ ë³´ì, ë²í¼ ìì° 1306 $li.css("display","list-item").not(":eq("+random+")").css("display","none"); 1307 } 1308 1309 // random ë°°ë ì íí ì¬ë¼ì´ë 1310 ,randomSlide:function(){ 1311 bannerpop.effect()['slide'].call(this, true); 1312 } 1313 1314 // slide banner 1315 // rand true or false 1316 ,slide:function(rand){ 1317 var _this = this 1318 ,$this = $(_this) 1319 ,$info = setSizeInfo($this) 1320 ,$ul = $info.$ul 1321 ,$li =$info.$li.css("display","list-item") 1322 ,$btnBox = $this.find(".beb_buttons") 1323 ,$btnStop = $btnBox.find(".beb_btn_stop") 1324 ,$btnCurrent = null // íì¬ ì íë ë²í¼ prev,next,play,stop of buttons 1325 ,speed = Number(_this.getAttribute("data-speed"))||.3 1326 ,delayInfo = $li.map(function(){ return Number(this.getAttribute("data-delay"))||5; }).get() 1327 ,boxWidth =$info.boxWidth 1328 ,liCount = $info.liCount 1329 ,count = (rand===true?Math.floor(Math.random()*(liCount)):-1) // ì²ìë¶í° +1 íê³ ììí기ì -1ì´ê¸°ê°-randomì¼ëë ë°°ëìì¤ 1ê° 1330 ,delay = null // ë©ì¶°ìë ìê°(ì´) 1331 ,left = boxWidth // ìì§ì´ë ê°ê²© 1332 ,si = null // setInterval ë³ì : animate completeìì delayë¡ í´ê²°íë ¤ íëë° ëê° ì ìí림 1333 ,tmpDelay = null // next, prev ì delay ìì´ ëê¹ 1334 ,firstBtnClicked = 0; // prev,nextë¡ ì´ëíëê° - rotateìì ëíë² +,- í기ì ì²ìë§ ì¤íëì´ì¼ í¨ 1335 1336 /**** function //s ****/ 1337 /* 1338 ë¤ì ë°°ë 1339 @params 1340 loop : ë°ë³µë ê²ì¸ê° 1341 mode : + or - 1342 */ 1343 function rotate(loop, mode){ 1344 if(!mode) mode="+"; 1345 if(mode==="+") count++; 1346 else count--; 1347 1348 if(count>=liCount || count<=0) count = 0; // ì§ì°ìê° ë´ì ë°°ì´ì°¾ê¸° key 1349 var front = count+1; // ì§ì°í ìì§ì¬ì¼ íë 거리 미리 ë´ìë 1350 if(count>=(liCount-1)) front = 0; 1351 left = boxWidth*front*-1;
1352 delay = tmpDelay===null?delayInfo[count]:tmpDelay; 1353 1354 si = setTimeout(function(){ 1355 $ul.animate({ marginLeft:left } 1356 ,speed*1000, 1357 function(){ 1358 if(loop===false) $btnCurrent.prop("disabled", false); 1359 tmpDelay = null; 1360 });//.delay(delay*1000); 1361 if(loop!==false) rotate(); 1362 },delay*1000); 1363 } 1364 1365 // stop 1366 function stop(){ 1367 firstBtnClicked++; 1368 1369 //$ul.stop(true, false); 1370 clearTimeout(si); 1371 tmpDelay=null; 1372 $btnStop.addClass("beb_btn_start").text("play"); 1373 } 1374 1375 // restart 1376 function start(){ 1377 firstBtnClicked = 0; 1378 1379 count--; 1380 if(count<=0) count=0; 1381 1382 tmpDelay=null; 1383 rotate(); 1384 1385 $btnStop.removeClass("beb_btn_start").text("ë©ì¶¤"); 1386 } 1387 1388 // ì´ì 1389 function prev(){ 1390 stop(); 1391 1392 if(firstBtnClicked===1) count--; // ì²ìë§ ì´ë¯¸ ì¦ê°ëê°ì ê°ììí´ 1393 if(count<=0) count=liCount; 1394 1395 tmpDelay=0; 1396 rotate(false,"-"); 1397 1398 $btnCurrent.prop("disabled", true); 1399 } 1400 1401 // ì´í 1402 function next(){ 1403 stop(); 1404 1405 if(firstBtnClicked===1) count--; 1406 if(count>=liCount) count=0; 1407 1408 tmpDelay=0; 1409 rotate(false); 1410 1411 $btnCurrent.prop("disabled", true); 1412 } 1413 /**** function //e ****/ 1414 1415 // ì²ì ë°°ë를 ë³´ì´ì§ ìëë¤ë ê²ì ëë¤ ë°°ëì ì¬ë¼ì´ëë¼ë ê²-ì²ìë³´ì¼ë°°ë ì¤ì 1416 if(count>=0 && rand===true){ 1417 var _boxWidth = boxWidth*(count>=liCount?liCount-1:count)*-1; 1418 count--; 1419 $ul.css("margin-left",_boxWidth+"px"); 1420 } 1421 1422 // ì¤í 1423 rotate(); 1424 1425 // ë²í¼ë³´ì 1426 $btnBox/*.css("display","block")*/.find(".beb_btns").unbind("click") 1427 .click(function(){ 1428 var $this = $(this); 1429 1430 $btnCurrent = $this; 1431 if($this.is(".beb_btn_prev")) prev(); 1432 else if($this.is(".beb_btn_next")) next(); 1433 else if($this.is(".beb_btn_stop")){ 1434 if($this.is(".beb_btn_start")) start(); 1435 else stop(); 1436 } 1437 }); 1438 1439 // mouseover event 1440 $ul.on({ 1441 mouseenter:stop 1442 ,mouseleave:start 1443 }); 1444 } 1445 }; 1446 } 1447 1448 // ë°°ëí¸ì¶ 1449 ,banner:function(target) 1450 { 1451 var parents = this 1452 ,$target = !!target.jquery?target:$(target); 1453 1454 //console.log($target); 1455 $.each($target, function(i, ele){ 1456 var type = ele.getAttribute("data-type")||"random"; 1457 parents.effect()[type].call(this); 1458 }); 1459 } 1460 1461 ,getCookie:function(name) 1462 { /* 1463 var cookie = document.cookie; 1464 if(cookie.indexOf(name)<0) return ""; 1465 1466 var regexp = new RegExp("^(.*)"+name+"=(.*?);(.*)$","g"); 1467 return cookie.replace(regexp,"$2").replace(/^\s+|\s+$/g,""); 1468 */ 1469 name+="="; 1470 var ca = document.cookie.split(';'); 1471 for(var i=0; i<ca.length; i++) { 1472 var c = ca[i]; 1473 while (c.charAt(0)==' ') c = c.substring(1); 1474 if (c.indexOf(name) == 0) return c.substring(name.length,c.length); 1475 } 1476 return ""; 1477 } 1478 1479 ,setCookie:function(name, value, days, domain) 1480 { 1481 var expires = ""; 1482 if(days){ 1483 var date = new Date(); 1484 date.setTime(date.getTime()+(days*24*60*60*1000)); 1485 expires = "; expires="+date.toGMTString(); 1486 } 1487 1488 var dm=SITE_DOMAIN.replace('http://',''); 1489 if(!domain) domain="." + dm; 1490 1491 document.cookie = name+"="+value+expires+"; path=/; " + (domain?"domain="+domain+";":""); 1492 } 1493 1494 // urlì arrayë¡ 1495 ,linkToJson:function(link) 1496 { 1497 if(!link) return false; 1498 1499 var json = {} 1500 ,tmp = link.replace(/^\/\?/,"").split("&"); 1501 1502 if(tmp.length<=0 || !tmp) return false; 1503 for(var i in tmp){ 1504 var param = tmp[i].split("=") 1505 ,key = param[0] 1506 ,value = param[1]; 1507 1508 json[key] = value; 1509 } 1510 return json; 1511 } 1512 1513 // ë°°ë append 1514 ,append:function() 1515 { 1516 var id = ___BANNER 1517 ,status = bannerStatus 1518 ,time = ___currentTime 1519 ,sTime = startTime 1520 ,eTime = endTime 1521 ,content = decodeURIComponent(bannerContent) 1522 ,title = typeof bannerTitle == "undefined" ? "":decodeURIComponent(bannerTitle) 1523 ,$target = $("#"+id) 1524 ,explain = ''; 1525 //,explain = "\n<br />"+util.timestampToDatetime(sTime).strDateTime.substring(0,16)+"~"+util.timestampToDatetime(eTime).strDateTime.substring(0,16); 1526 1527 1528 if(!id || $target.length<=0 || $target.attr("data-append")=="true") return false; // ê°ì²´ê° ìê±°ë ììì ,ì´ë¯¸ ì¶ê°ëìë¤ë©´ ì¤ë¨ 1529 1530 // ìì ,ì¢ ë£ ë°°ë 1531 else if(sTime > time || time > eTime || status=="0"){ 1532 if(location.href.indexOf('/edit/adminSection.html')<0) return false; // ê´ë¦¬ìê° ìëë¼ë©´ ì¢ ë£ ë©ìì§ ìëì°ê¸° 1533 var adcMsg="" 1534 ,adcClass=""; 1535 if(sTime > time && status!="0"){ 1536 adcMsg = 'ë ¸ì¶ìì ë°°ë'; 1537 adcClass = "banner-later"; 1538 }else if(time > eTime || status=="0"){ 1539 adcMsg = 'ì¢ ë£ë ë°°ë'; 1540 adcClass = "banner-finish"; 1541 } 1542 1543 $target.attr("data-append","true").after('<div class="ad-finished"><span class="'+adcClass+'"><i class="fa fa-clock-o"></i> '+adcMsg+' "'+title+'"</span>'+explain+'</div>');
1543 // ì¢ ë£ ë©ìì§ ëì°ê³ ì¢ ë£ 1544 bannerTitle="";//ì´ê¸°í 1545 1546 return false; 1547 } 1548 1549 $target.attr("data-append","true").after(content); // ì¶ê° ëìì¼ë©´ data-append íê·¸ ëê¹ 1550 } 1551 1552 /****** íì ëì°ê¸° 1553 var ___popup = [{},...]; 1554 1555 * json ë´ì© * 1556 idxno - íì idxno ê³ ì ë²í¸ 1557 title - íì ì ì 목 1558 start - íì ììì¼ì 1559 end - íì ì¢ ë£ì¼ì 1560 status - ì§íìí (1=ì§í, 0=ì¢ ë£) 1561 popup_type - íì íí (layer=ë ì´ì´, window=ìëì°) 1562 popup_size - auto (ì¬ì©ìí¨) 1563 popup_width - íì ì°½í¬ê¸°(ê°ë¡) 1564 popup_height - íì ì°½í¬ê¸°(ì¸ë¡) 1565 position - auto (ì¬ì©ìí¨) 1566 x_position - ì°½ì x ìì¹ 1567 y_position - ì°½ì y ìì¹ 1568 apply_page - ì ì©íì´ì§ (main, section, list, view ê°ì´ ì ë ¥ ëì´ìì , phpìì íì´ì§ 구ë¶í´ì jsonì¼ë¡ ë§ë¤ì´ ì¤ëë¤.) 1569 bottom_close - íë¨íì ì°½ë«ê¸° ì¶ë ¥ì¬ë¶ (Y=ì¶ë ¥, N=ì¶ë ¥ìí¨) 1570 bottom_close_expire_ck - **ëì ì´ì§ì기 (none=ì¬ì©ìí¨, day=í루ëì ì´ì§ì기, days=ëªì¼ëì ì´ì§ì기) 1571 bottom_close_expire - ëªì¼ì¸ì§ 1572 layer_border - ë ì´ì´ íì ì¸ ê²½ì° ì¸ê³½ì (Y=ì¬ì©í¨, N=ì¬ì©ìí¨) 1573 layer_move - ë ì´ì´ íì ì¸ ê²½ì° ëëê·¸ ê°ë¥ (Y=ì¬ì©í¨, N=ì¬ì©ìí¨) 1574 layer_scroll - ë ì´ì´ íì ì¸ ê²½ì° ì¤í¬ë¡¤ ë°ë¼ë¤ë기 (Y=ì¬ì©í¨, N=ì¬ì©ìí¨) 1575 layer_close - ë ì´ì´ íì ì¸ ê²½ì° ë«ê¸° ìì´ì½ (Y=ì¬ì©í¨, N=ì¬ì©ìí¨) 1576 layer_close_icon - ë ì´ì´ íì ì¸ ê²½ì° ë«ê¸° ìì´ì½ ì í 1577 layer_close_position - ë ì´ì´ íì ì¸ ê²½ì° ë«ê¸° ìì´ì½ ì¶ë ¥ ìì¹ (TL-ì/ì¢, TR-ì/ì°, BL-í/ì¢, BR-í/ì°) 1578 window_scroll - ìëì° íì ì¸ ê²½ì° ì¤í¬ë¡¤ íì±í (Y=ì¬ì©í¨, N=ì¬ì©ìí¨) 1579 content - ì¶ë ¥ HTML ë´ì© 1580 *****/ 1581 ,float:function(j) 1582 { 1583 // json ê° 1584 var current = ___currentTime 1585 ,start = Number(j.start)||0 1586 ,end = Number(j.end)||(new Date().getTime()+100) // ì¢ ë£ì¼ì´ 기ì ëì§ ììë¤ë©´, íì¬ë³´ë¤ 100ì©ëí´ì ê³ì ë림 1587 ,status = j.status||"0"; 1588 1589 if(this.vars.popup.view!="manager" && (status=="0" || current < start || (current > end && end!==0))) return false; // ì¢ ë£ or 기ê°ì´ ìëë¼ë©´ íµê³¼ 1590 1591 var parents = this 1592 ,idxno = j.idxno||"0" 1593 ,oriTitle = j.title||"" 1594 ,title = decodeURIComponent(j.title)||"" 1595 ,popupType = j.popup_type||"window" 1596 ,popupSize = j.popup_size||"auto" 1597 ,popupWidth = Number(j.popup_width)||0 1598 ,popupHeight = (Number(j.popup_height)||0) + 32 1599 ,position = j.position||"auto" 1600 ,xPosition = Number(j.x_position)||0 1601 ,yPosition = Number(j.y_position)||0 1602 ,applyPage = j.apply_page||"main" 1603 ,bottomClose = j.bottom_close||"N" 1604 ,bottomCloseExpireCk = j.bottom_close_expire_ck||"none" 1605 ,bottomCloseExpire = j.bottom_close_expire||1 1606 ,layerBorder = j.layer_border||"N" 1607 ,layerMove = j.layer_move||"N" 1608 ,layerScroll = j.layer_scroll||"N" 1609 ,layerClose = j.layer_close||"N" 1610 ,layerCloseIcon = j.layer_close_icon||"" 1611 ,layerClosePosition = j.layer_close_position||"BR" 1612 ,windowScroll = j.window_scroll||"Y" 1613 ,content = decodeURIComponent(j.content)||"" 1614 ,popupUrl = j.popup_url||""// + (parents.vars.popup.view=="manager"?"?edit_mode=preview":"")||"" 1615 ,top = 0 1616 ,left = 0 1617 ,popname = parents.vars.popup.popname+idxno 1618 ,_type = popupType; // default: ê°ìëì - íì ê³¼ ë ì´ì´ê° ìì¹ê°ì ê³µì íì¬ ì°¨ë¡ë¡ ëì¸ë ¤ë©´ "window" or ê³µì íì§ ìê³ ê°ì ëì¸ë ¤ë©´ popupType; 1619 1620 var type = { 1621 calcPosition:function(){ 1622 // x,y ê° 0ì¼ëë autoë¡ ê°ì£¼ 1623 if((xPosition===0 && yPosition===0)/* || position=="auto"*/){ 1624 var maxHeight = parents.arrayMaxMin(parents.vars.popup.height[_type],"max") 1625 ,maxTop = parents.arrayMaxMin(parents.vars.popup.top[_type],"max") 1626 ,initLeft = popupType=="window"?0:parents.vars.popup.bodyLeft 1627 ,prevWidth = parents.vars.popup.width[_type][parents.vars.popup.width[_type].length-1]||0 1628 ,prevLeft = parents.vars.popup.left[_type][parents.vars.popup.left[_type].length-1]||initLeft; // ë°ë¡ ì´ì íì ëì´ë¥¼ leftê°ì¼ë¡ ì í¨-window:0, layer:contentì left 1629 1630 //console.log(popupWidth); 1631 left = prevLeft+prevWidth; 1632 1633 // íì´ì§ ëì´ë³´ë¤ ì리ì¡ì leftê°ì´ í¬ë¤ë©´ íë©´ì íë¨ê³ ë´ë¦¼ 1634 if(left>parents.vars.popup[popupType=="window"?"screenWidth":"bodyWidth"]){ 1635 top += maxHeight; 1636 left = initLeft; 1637 1638 // ë¤ì ë¨ê³ì´ëê¹ ì´ê¸°í í¨ 1639 parents.vars.popup.width[_type] = []; 1640 parents.vars.popup.height[_type] = []; 1641 parents.vars.popup.top[_type] = []; 1642 parents.vars.popup.left[_type] = []; 1643 }else{ 1644 top = (maxTop||0); 1645 } 1646 1647 // ë³íëê° ë°°ì´ì ë£ê¸° ìí´ ì¡°ì 1648 xPosition = left; 1649 yPosition = top; 1650 1651 // ë³ìì ë´ì 1652 parents.vars.popup.width[_type].push(popupWidth||0); 1653 parents.vars.popup.height[_type].push(popupHeight||0); 1654 parents.vars.popup.top[_type].push(yPosition||0); 1655 parents.vars.popup.left[_type].push(xPosition||0); 1656 1657 }else{ 1658 top = yPosition; 1659 left = xPosition; 1660 } 1661 } 1662 1663 // ê´ë¦¬ì 미리보기ì ì¤ìì 1664 ,setPositionCenter:function(){ 1665 var _width = (document.body.clientWidth/2)-(popupWidth/2) 1666 ,_scrollTop = document.body.scrollTop; 1667 1668 top = _scrollTop + 50; 1669 left = _width; 1670 } 1671 1672 // ëì¸ íì´ì§ applyPage 1673 ,isApplyPage:function() 1674 { 1675 // ê´ë¦¬ì íµê³¼ 1676 if(parents.vars.popup.view=="manager") return true; 1677 /* 1678 var params = bannerpop.linkToJson(location.search.replace("?","")) 1679 ,mod = params.mod||"" 1680 ,act = params.act||"" 1681 ,section = params.section||""; 1682 1683 // ë©ì¸ 1684 if(((mod=="main" && act=="index" && !section) || (!mod && !act && !section)) && applyPage.indexOf("main")>=0) return true; 1685 // ì¹ì 1686 else if(mod=="main" && act=="index" && section && applyPage.indexOf("section")>=0) return true; 1687 // ê¸°ì¬ ë¦¬ì¤í¸ 1688 else if(mod=="news" && act=="articleList" && applyPage.indexOf("list")>=0) return true; 1689 // 기ì¬ë·° 1690 else if(mod=="news" && act=="articleView" && applyPage.indexOf("view")>=0) return true; 1691 */ 1692 } 1693 1694 ,window:function(){ 1695 //if(this.isApplyPage()!==true) return false; 1696 1697 this.calcPosition(); // ìì¹ ê³ì° 1698 var winpopupUrl = '/bannerpop/popup.html?win_popup_idxno=' + idxno; 1699 window.open(winpopupUrl, popname, "width="+popupWidth+",height="+popupHeight+",scrollbars="+(windowScroll=="Y"?"yes":"no")+",resizable=yes,top="+top+",left="+left); 1700 } 1701 1702 ,layer:function(){ 1703 //if(this.isApplyPage()!==true) return false; 1704 1705 this.calcPosition(); // ìì¹ ê³ì° 1706 1707 var $content = $(content); 1708 1709 $content.attr({"id":popname}) 1710 .css({"top":top+"px","left":left+"px","max-width":popupWidth+"px","min-height":popupHeight+"px","z-index":"100" + parents.vars.popup.order}).addClass("layer_box"+(layerScroll=="Y"?" layer_box_fixed":"")+(layerBorder=="Y"?" layer_box_border":"")) 1711 .find(".popup_close_box").addClass("layer_close_box"); 1712 1713 // ëëê·¸ ê°ë¥ 1714 if(layerMove=="Y") $content.addClass("layer_box_cursor_move").draggable(); 1715 1716 // ì°½ë«ê¸°-icon ë«ê¸° ë²í¼ì ë³ê°ë¤ 1717 //if(bottomClose=="Y"){ 1718 var $btnClose = $content.find(".popup_close, .popup_close_map, .popup_icon_close"); 1719 $btnClose.each(function(){ 1720 var _$this = $(this); 1721 //if(_$this.is(".popup_close") && bottomClose=="Y") _$this.text('ì°½ë«ê¸°'); 1722 1723 if(_$this.is(".popup_icon_close")) { 1724 if(layerClosePosition == 'BL' || layerClosePosition == 'BR') { 1725 1726 if($content.find(".popup_close, .popup_close_map").length>0) { 1727 _$this.css('top',Number(j.popup_height)-40+'px'); 1728 } 1729 } 1730 1731 _$this.addClass("layer_position_"+layerClosePosition); 1732 } 1733 }); 1734 1735 $btnClose.click(function(){ 1736 parents.evtClose(popupType, idxno); 1737 return false; 1738 }); 1739 //} 1740 1741 // ì´ë¯¸ì§ë´ ë§í¬ê° ì°½ë«ê¸° ë¼ë©´ 1742 //$content.find("a[href*='javascript:window.close()']").click(function(){ 1743 $content.find("[href*='javascript:window.close()']").click(function(){ 1744 parents.evtClose(popupType, idxno); 1745 return false; 1746 }); 1747 1748 // í루, ëªì¼ëì ì´ì§ ì기 1749 parents.daysNotOpen(bottomCloseExpireCk, bottomCloseExpire, $content.find(".popup-days, .popup_day_close_map"), j); 1750 1751 // ê´ë¦¬ì 미리보기ì ì¤ìì 1752 if(parents.vars.popup.view=="manager"){ 1753 $content.appendTo(document.body); 1754 this.setPositionCenter(); 1755 $content.removeClass("layer_box_fixed").css({"top":top+"px", "left"
1755:left+"px"}); 1756 }else{ 1757 $content.appendTo($("#layer-popups")); 1758 } 1759 } 1760 }; 1761 1762 type[popupType](); 1763 } 1764 1765 // íì ëì°ê¸° 1766 ,popup:function() 1767 { 1768 //try{ 1769 var parents = this; 1770 $(window).on("load", function(){ 1771 if(!window.___popup) return ; 1772 if($.isArray(___popup)===false && ___popup.length>0) return ; 1773 if(!window.___currentTime) ___currentTime = Math.floor(new Date().getTime()/1000);// ìê°ì´ ì¤ì ëì§ ììë¤ë©´ js ìê°ì¼ë¡ ì¤ì í¨ 1774 1775 var $content = $("#layer-popups"); 1776 1777 if($content.length<=0) return false; 1778 parents.vars.popup.bodyWidth = $content.innerWidth(); 1779 parents.vars.popup.bodyLeft = $content.position().left; 1780 parents.vars.popup.screenWidth = window.screen.width; 1781 for(var i=0,cnt=___popup.length; i<cnt; i++){ 1782 // ì¿ í¤ì¸ì§ íë¨í ì´ê¸° 1783 var coo = ""; 1784 coo = bannerpop.getCookie(parents.vars.popup.popname+___popup[i].idxno) 1785 1786 if(!coo){ 1787 parents.vars.popup.order++; 1788 parents.float(___popup[i]); 1789 } 1790 } 1791 }); 1792 //}catch(e){} 1793 } 1794 1795 1796 // ì°½ë«ê¸° 1797 ,evtClose:function(mode, idxno) 1798 { 1799 if(mode=="layer"){ 1800 var layerId = bannerpop.vars.popup.popname+idxno; 1801 1802 $("#"+layerId).fadeOut("fast", function(){ 1803 $(this).remove(); 1804 }); 1805 }else window.close(); 1806 } 1807 1808 // cookie 1809 ,evtCookieClose:function(name, days) 1810 { 1811 bannerpop.setCookie(name, "popup", days); 1812 } 1813 1814 // í루,ëªì¼ëì ì´ì§ ì기 1815 ,daysNotOpen:function(expire, period, $btn, p) 1816 { 1817 var parents = this 1818 ,idxno = p.idxno 1819 ,isClickedMap = false; 1820 1821 if(expire!="none"){ 1822 $btn.each(function(i,v) { 1823 var $thisBtn = $(this); 1824 if($thisBtn.is(".popup-days")){ 1825 // í루ëì 1826 if(expire=="day"){ 1827 $thisBtn.click(function(){ 1828 parents.evtCookieClose(parents.vars.popup.popname+idxno, "1"); 1829 parents.evtClose(p.popup_type, p.idxno); 1830 return false; 1831 }) 1832 // ë«ê¸° íê·¸ ìì ìê²ë ìë ê±° ì°¾ì ë«ê¸° í ì¤í¸ ë£ì´ì£¼ê¸° 1833 .not(":has(*)").html('<a href="#close-to-layer">í루ëì ë³´ì§ ì기</a>'); 1834 } 1835 // ëªì¼ëì daySubfix 1836 else if(expire=="days"){ 1837 var select = '<a href="#link">' 1838 +'<label class="sr-only" for="popDays"></label>' 1839 +'<select name="popDays" id="popDays" class="tiny" title="기ê°">' 1840 +' <option value="1">í루</option>' 1841 +' <option value="2">2ì¼</option>' 1842 +' <option value="3">3ì¼</option>' 1843 +' <option value="4">4ì¼</option>' 1844 +' <option value="5">5ì¼</option>' 1845 +' <option value="6">6ì¼</option>' 1846 +' <option value="7">7ì¼</option>' 1847 +'</select> ëì ì´ì§ì기' 1848 +'</a>'; 1849 var html = '<a href="#link">' 1850 + (period>1 ? 'ëªì¼ëì ë³´ì§ ì기' : 'í루ëì ë³´ì§ ì기') 1851 +'</a>'; 1852 //$btn.not(":has(*)").append(select).click(function(){ 1853 $thisBtn.append(html).click(function(){ 1854 var $this = $(this) 1855 //,days = $this.prev("select").val(); 1856 ,days = period; 1857 1858 parents.evtCookieClose(parents.vars.popup.popname+idxno, days); 1859 parents.evtClose(p.popup_type, p.idxno); 1860 return false; 1861 }); 1862 } 1863 }else{ 1864 // ì´ë¯¸ì§ë§µì¼ë, í루ëì ì´ì§ì기 1865 $thisBtn.click(function(){ 1866 parents.evtCookieClose(parents.vars.popup.popname+idxno, "1"); 1867 parents.evtClose(p.popup_type, p.idxno); 1868 return false; 1869 }); 1870 1871 isClickedMap = true; 1872 } 1873 }); 1874 } 1875 1876 // expire ê°ì´ë ê´ê³ìì´ ì´ë¯¸ì§ë§µì ì°¾ì ì²ë¦¬ 1877 if(isClickedMap===false && $btn.is(".popup_day_close_map")){ 1878 // ì´ë¯¸ì§ë§µì¼ë, í루ëì ì´ì§ì기 1879 $btn.click(function(){ 1880 parents.evtCookieClose(parents.vars.popup.popname+idxno, "1"); 1881 parents.evtClose(p.popup_type, p.idxno); 1882 return false; 1883 }); 1884 } 1885 } 1886 1887 // window popup control 1888 ,popupControl:function() 1889 { 1890 if(!___popup) return ; 1891 if((typeof ___popup)!=="object") return ; 1892 1893 var parents = this 1894 ,p = ___popup 1895 ,title = decodeURIComponent(p.title)||"" 1896 ,popupType = p.popup_type||"window" 1897 ,bottomClose = p.bottom_close||"Y" 1898 ,bottomCloseExpireCk = p.bottom_close_expire_ck||"day" // : day,days,none 1899 ,bottomCloseExpire = p.bottom_close_expire||1 // : ëªì¼ 1900 ,$btnClose = $(".popup_close, .popup_close_map, .popup_icon_close") 1901 ,$btnDayClose = $(".popup-days, .popup_day_close_map"); 1902 1903 if(popupType!="window") return ; 1904 1905 // ìëì° ë° íì´í êµì²´ 1906 document.title = title; 1907 1908 // ì°½ë«ê¸° 1909 if(bottomClose=="Y"){ 1910 $btnClose.each(function(){ 1911 var _$this = $(this); 1912 //if(_$this.is(".popup_close")) _$this.text('ì°½ë«ê¸°'); 1913 }); 1914 1915 $btnClose.click(function(){ 1916 parents.evtClose(p.popup_type, p.idxno); 1917 return false; 1918 }); 1919 } 1920 1921 // í루, ëªì¼ëì ì´ì§ ì기 1922 this.daysNotOpen(bottomCloseExpireCk, bottomCloseExpire, $btnDayClose, p);
1923 1924 } 1925 1926 // array ìµê³ ê° 1927 ,arrayMaxMin:function(arr, mode) 1928 { 1929 if($.isArray(arr)===false) return false; 1930 1931 if(!mode) mode = "max"; 1932 arr.sort(function(a, b){ 1933 return b-a; 1934 }); 1935 return (mode=="max"?arr[0]:arr[arr.length-1])||0; 1936 } 1937}; 1938 1939/****************************************************************************************************************** 1940* ë©í° 기ë¥ì± ë°°ë 1941* 1942* @update 2018/07/18 1943*/ 1944var bannerpopMulti = { 1945 // php ì ë¬ ë³ì 1946 vars:{ 1947 $banner_list:null, 1948 $edit_mode:"" 1949 } 1950 1951 // íì´ì§ ì´ê¸° ë¡ë 1952 ,init:function() { 1953 $('input[name="effect_type"]').on("click", function() { 1954 if ($(this).val()=='none') { 1955 $("#row_num").val(0).attr("disabled", true); 1956 $("#scroll_num").val(0).attr("disabled", true); 1957 } else { 1958 $("#row_num").removeAttr("disabled"); 1959 $("#scroll_num").removeAttr("disabled"); 1960 } 1961 }); 1962 1963 $('input[name="autoplay"]').on("click", function() { 1964 if ($(this).val()=='Y') { 1965 $("#autoplay_speed").removeAttr("disabled"); 1966 } else { 1967 $("#autoplay_speed").attr("disabled", true); 1968 } 1969 }); 1970 1971 $('#all-banner-list').on('click', function(e) { 1972 $this = $(this); 1973 href = $this.attr('href'); 1974 $("#edit-modal-iframe").attr("src", href); 1975 $('#edit-modal').foundation('open'); 1976 return false; 1977 }); 1978 1979 $('#banner-activity-box').sortable({ 1980 axis: '', 1981 update: function() { 1982 console.log($(this)); 1983 } 1984 }); 1985 1986 $('#edit-modal').on('open.zf.reveal', function(e){ 1987 $('#for-loading').show(); 1988 }); 1989 1990 $('#edit-modal').on('closed.zf.reveal', function(e){ 1991 $("#edit-modal-iframe").attr("src", "about:blank").height('0px').closest('#activity-modal').css('height', '0px'); 1992 }); 1993 1994 $(document).on("click", '.trash', function() { 1995 var $this=$(this) 1996 ,$parent = $this.closest('.banner-activity-list'); 1997 $parent.fadeOut('fast', function(){ 1998 $parent.remove(); 1999 }); 2000 }); 2001 } 2002 2003 // ë°°ë ê°ì ¸ì¤ê¸° 2004 ,evtClickMultipleAdd:function() { 2005 var multi_idxno=window.parent.$('#all-banner-list').closest('div').attr('data-multi-idxno')||''; 2006 $('#activity-add-btn').on("click", function() { // #activity-add-btn 기ë¥ì±ë°°ë ë²í¼ í´ë¦ ì´ë²¤í¸ë¥¼ ì´ì© 2007 var $this=$(this); 2008 if($('.banner_element_ckecked').is(':checked') == false) { 2009 alert('ë°°ë를 ì íí´ì£¼ì¸ì.'); 2010 return false; 2011 }else{ 2012 var $checked=$(".banner_element_ckecked:checked") 2013 ,arr = new Array(); 2014 if($checked.length>0) { 2015 $.each($checked, function(idx, v) { 2016 arr.push(v.value); 2017 }); 2018 2019 var data = {mode:multi_idxno?'modify':'input', multi_idxno:multi_idxno, banner_idxno:arr}; 2020 data = JSON.stringify(data); 2021 //console.log(data); 2022 2023 $.ajax({
2024 url:"/bannerpop/activity_multi_act.php" 2025 ,type:'post' 2026 ,dataType:'json' 2027 ,contentType:'application/x-www-form-urlencoded; charset=utf-8' 2028 ,data:{post_data:data} 2029 ,success:function(json, result) { 2030 if(result == 'success') { 2031 if(json.response == 'ok') { 2032 var item = JSON.parse(json.data); 2033 var $target = window.parent.$("#banner-activity-box"), 2034 $sample = window.parent.$("#sample"); 2035 bannerpopMulti.vars.$banner_list = item; 2036 bannerpopMulti.bannerCollocate($target, $sample); 2037 window.parent.$(".close-buttons").trigger("click"); 2038 }else{ 2039 return false; 2040 } 2041 }else return false; 2042 }, 2043 error:function(request,status,error){ 2044 alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); 2045 } 2046 }); 2047 } 2048 } 2049 }); 2050 } 2051 2052 // ë°°ë ë°°ì¹ í기 2053 ,bannerCollocate:function($targetArea, $sample) { 2054 if (!this.vars.$banner_list) return false; 2055 if (typeof $targetArea != "object" || typeof $sample != "object") return false; 2056 var item = this.vars.$banner_list; 2057 for (var i=0;i<item.length;i++) { 2058 var $areaBox = $targetArea, 2059 $clone = $sample.clone(), 2060 stateIcon = ""; 2061 if (typeof $clone == "object") { 2062 if (item[i].state=="previous") stateIcon = '<span class="label success tiny">ì§íì </span>'; 2063 else if (item[i].state=="proceeding") stateIcon = '<span class="label tiny">ì§íì¤</span>'; 2064 else stateIcon = '<span class="label secondary tiny">ì§íì¢ ë£</span>'; 2065 $clone.attr("data-banner-idxno", item[i].idxno); 2066 $clone.find(".banner-activity-list").attr("data-banner-idxno", item[i].idxno).end(). 2067 find(".dis-table-cell").append(item[i].banner).end(). 2068 find('input[name="banner_idxno[]"]').val(item[i].idxno).end(). 2069 find(".dis-status").empty().append(stateIcon).end(). 2070 find('input[name="delay[]"]').attr("id", "delay_"+item[i].idxno).attr("value", item[i].delay).end(). 2071 find('.input-group-label').attr("for", "delay_"+item[i].idxno); 2072 $areaBox.append($clone.html()); 2073 } 2074 } 2075 } 2076 2077 // ì íë ë°°ë íì 2078 ,selectBannerCheck:function() { 2079 var $areaBox = window.parent.$("#banner-activity-box"), 2080 $list = $areaBox.find('input[name="banner_idxno[]"]'), 2081 $bannerItems = $(".adccfg_list_items"), 2082 bannerList = [], 2083 i = 0; 2084 $list.each(function() { 2085 bannerList.push($(this).val()); 2086 }); 2087 //console.log(bannerList); 2088 2089 $bannerItems.each(function() { 2090 var $this = $(this), 2091 idxno = $this.attr("data-banner-idxno"); 2092 if ($.inArray(idxno, bannerList)!=-1) { 2093 $this.find(".ad-tile").append('<div class="content-inert"><button type="button" class="content-buttons display has-tip" title="ì½ì ëë°°ë" data-tooltip><i class="fa fa-television fa-fw"><span class="show-for-sr">ì½ì ëë°°ë</span></i></button></div>'); 2094 } 2095 }); 2096 } 2097 2098 // ë°°ë ë±ë¡í기 2099 ,valid_multi:function(form) { 2100 if(form.title.value == '') { 2101 alert('ì 목ì ì ë ¥íì¸ì.'); 2102 form.title.focus(); 2103 return false; 2104 } 2105 2106 if (form.column_num.value>9) { 2107 alert("ì´ìë 1~9ê¹ì§ë§ ì ë ¥í ì ììµëë¤."); 2108 form.column_num.focus(); 2109 return false; 2110 } 2111 2112 if (form.row_num.value>9) { 2113 alert("íìë 1~9ê¹ì§ë§ ì ë ¥í ì ììµëë¤."); 2114 form.row_num.focus(); 2115 return false; 2116 } 2117 2118 if (form.scroll_num.value>9) { 2119 alert("ì¤í¬ë¡¤ìë 1~9ê¹ì§ë§ ì ë ¥í ì ììµëë¤."); 2120 form.scroll_num.focus(); 2121 return false; 2122 } 2123 2124 if($('.banner-activity-list').length-1<=0) { 2125 alert('ë°°ë를 íë ì´ì ì¶ê°íì ì¼ í©ëë¤.'); 2126 return false; 2127 } 2128 2129 return true; 2130 } 2131 2132 // ë©í° 기ë¥ì± ë°°ë ì´ë²¤í¸ ë¡ë 2133 ,bannerLoad:function() { 2134 $('.banner-multi-box').each(function() { 2135 var $effectType = $(this).attr("data-effect-type"), 2136 $rowNum = $(this).attr("data-row-num")||1,
2137 $colNum = $(this).attr("data-column-num")||1, 2138 $scrollNum = $(this).attr("data-scroll-num")||1, 2139 $moveDisplay = $(this).attr("data-move-display")||'none', 2140 $autoplay = $(this).attr("data-autoplay")||'N', 2141 $autoplaySpeed = $(this).attr("data-autoplay-speed")||5, 2142 $speed = $(this).attr("data-speed")||300, 2143 $random = $(this).attr("data-random")||'N'; 2144 2145 if ($effectType!="none") { 2146 var totalSlide = $(this).find(".slick-slide").length||0, 2147 randomStart = Math.floor(Math.random() * totalSlide); 2148 randomStart = ($random=="Y") ? randomStart : 0; 2149 2150 var slickParam = {}; 2151 slickParam.prevArrow = '<button type="button" class="roll-btns btn-prev"><i class="icon-left"><span class="sr-only">prev</span></i></button>'; // ì´ì ë²í¼ 2152 slickParam.nextArrow = '<button type="button" class="roll-btns btn-next"><i class="icon-right"><span class="sr-only">next</span></i></button>'; // ë¤ìë²í¼ 2153 slickParam.infinite = true; // 무í ë기기 2154 slickParam.draggable = false; // ì ì¤ì²(모ë°ì¼ì©) 2155 2156 switch ($effectType) { 2157 case "vertical": 2158 slickParam.slidesToShow = parseInt($rowNum,10); 2159 slickParam.vertical = true; 2160 slickParam.verticalSwiping = true; 2161 if ($random=="Y"&&totalSlide>parseInt($rowNum,10)) slickParam.initialSlide = randomStart; 2162 break; 2163 case "horizon": 2164 default: 2165 slickParam.slidesToShow = parseInt($colNum,10); 2166 if (parseInt($rowNum,10)>1) slickParam.rows = parseInt($rowNum,10); 2167 if ($random=="Y") slickParam.initialSlide = randomStart; 2168 break; 2169 } 2170 2171 slickParam.slidesToScroll = parseInt($scrollNum,10); 2172 slickParam.arrows = ($moveDisplay=="arrow"&&bannerpopMulti.vars.$edit_mode!="delete")?true:false; 2173 slickParam.dots = ($moveDisplay=="dot"&&bannerpopMulti.vars.$edit_mode!="delete")?true:false; 2174 slickParam.dotsClass = "auto-pager"; 2175 slickParam.autoplay = ($autoplay== "Y")?true:false; 2176 slickParam.autoplaySpeed = ($autoplay== "Y")?parseInt($autoplaySpeed,10)*1000:0; 2177 slickParam.speed = parseInt($speed, 10); 2178 slickParam.centerMode = false; 2179 slickParam.variableWidth = false; 2180 slickParam.focusOnSelect = true; 2181 //console.log(slickParam); 2182 2183 $(this).slick(slickParam); 2184 } else { 2185 if ($random=="Y") shuffle($(this)); 2186 } 2187 2188 function shuffleArray(d) { 2189 for (var c = d.length - 1; c > 0; c--) { 2190 var b = Math.floor(Math.random() * (c + 1)); 2191 var a = d[c]; 2192 d[c] = d[b]; 2193 d[b] = a; 2194 } 2195 return d; 2196 } 2197 2198 function shuffle(target){ 2199 var $box = $(target).children(".slick-slide-none") 2200 ,$container = $box.children(".row") 2201 ,$li = $box.find(".columns") 2202 ,total = $li.length 2203 ,tmp = []; 2204 2205 for(var i=0;i<total;i++) tmp.push(i); 2206 2207 $container.empty(); 2208 setTimeout( 2209 shuffleArray(tmp).forEach(function(a,b){ 2210 var $bannerBoxs=$li[a].querySelectorAll(".banner_box") 2211 ,length=$bannerBoxs.length 2212 ,div=document.createElement("div"); 2213 for(var i=0;i<length;i++){ 2214 div.appendChild($bannerBoxs[i]); 2215 div.className = "columns"; 2216 } 2217 $container.append(div); 2218 }) 2219 ,0); 2220 } 2221 }); 2222 } 2223}; 2224 2225/* ****************************************** */ 2226/* /script/resizePhoto.js */ 2227/* ****************************************** */ 2228 2229function resizePhoto() { 2230 2231 var $_container = $('#article-view-content-div'); 2232 var articleViewDivWidth = $_container.width(); 2233 2234 $_container.find('img').each(function(e){
2235 if($(this).closest('figure').length) { 2236 var ViewimageObj = new Image(); 2237 var $_thisImgObj = $(this); 2238 ViewimageObj.src = $(this).attr("src"); 2239 ViewimageObj.onload = function() { 2240 imageWidth = this.width; 2241 if(articleViewDivWidth <= imageWidth) { 2242 $_thisImgObj.closest('figure').addClass('bigsize'); 2243 } 2244 }; 2245 2246 } 2247 }); 2248 2249 $_container.on('click', 'figure.bigsize', function(e){ 2250 $('<form action="/news/userArticlePhoto.html" method="POST"><input type="hidden" name="src" value="'+$(this).find('img').attr('src')+'"></form>').appendTo('body').submit(); 2251 2252 //var src = $(this).find('img').attr('src'); 2253 //top.location.href = src; 2254 }); 2255} 2256 2257/* ****************************************** */ 2258/* /script/onScroll.js */ 2259/* ****************************************** */ 2260 2261var top_last_scroll = 0; 2262var diff_scroll = 0; 2263 2264function onScrollDirection() 2265{ 2266 var function_direction = function() 2267 { 2268 var top_scroll = jQuery(document).scrollTop(); 2269 window.diff_scroll = top_scroll - window.top_last_scroll; 2270 window.top_last_scroll = top_scroll; 2271 2272 jQuery(window).trigger("onScrollAdjustEndLine"); 2273 }; 2274 2275 jQuery(window).scroll(function_direction); 2276 jQuery(window).resize(function_direction); 2277 2278 setTimeout(function(){window.diff_scroll=-1;jQuery(window).trigger("onScrollAdjustEndLine");}, 200); 2279}; 2280 2281function onScrollAdjustEndLine(query_start, query_end, query_in) 2282{ 2283 jQuery(window).on 2284 ( 2285 "onScrollAdjustEndLine", 2286 function() 2287 { 2288 var obj_start = jQuery(query_start); 2289 var obj_end = jQuery(query_end); 2290 var obj_in = jQuery(query_in); 2291 2292 if ( obj_start && obj_end && obj_in ) 2293 { 2294 var top_in = obj_in.offset().top; 2295 var top_win = jQuery(document).scrollTop(); 2296 var top_start = obj_start.offset().top; 2297 var top_end = obj_end.offset().top; 2298 var left_start = obj_start.offset().left; 2299 var width_start = obj_start.width(); 2300 var height_win = jQuery(window).height(); 2301 var height_end = obj_end.height(); 2302 var height_in = obj_in.height(); 2303 var bot_win = top_win + height_win; 2304 var bot_end = top_end + height_end; 2305 var bot_in = top_in + height_in; 2306 2307 var gap_max = top_end + height_end - top_start - height_in; 2308 2309 obj_start.css({"height":height_in+"px"}); 2310 2311 if ( window.diff_scroll == 0 ) 2312 { 2313 if ( obj_in.css("position") == "fixed" ) 2314 { 2315 obj_in.css({"left":left_start+"px"}); 2316 } 2317 } 2318 2319 if ( height_in >= bot_end - top_start ) 2320 { 2321 // ìì§ì¼ íìê° ìì 2322 obj_in.css({"position":"relative","top":"0px","left":"0px","width":""}); 2323 } 2324 else if ( height_win > top_end + height_end - top_start ) 2325 { 2326 obj_in.css({"position":"relative","top":"0px","left":"0px","width":""}); 2327 } 2328 else if ( height_win > height_in ) 2329 { 2330 if ( top_start >= top_win ) 2331 { 2332 obj_in.css({"position":"relative","top":"0px","left":"0px","width":""}); 2333 } 2334 else if ( top_start + gap_max <= top_win ) 2335 { 2336 obj_in.css({"position":"relative","top":gap_max+"px","left":"0px","width":""}); 2337 } 2338 else 2339 { 2340 obj_in.css({"position":"fixed","top":"0px","left":left_start+"px","width":width_start+"px"}); 2341 } 2342 } 2343 else 2344 { 2345 if ( window.diff_scroll < 0 ) 2346 { 2347 if ( top_start >= top_win ) 2348 { 2349 obj_in.css({"position":"relative","top":"0px","left":"0px","width":""}); 2350 } 2351 else if ( top_in >= top_win ) 2352 { 2353 obj_in.css({"position":"fixed","top":"0px","left":left_start+"px","width":width_start+"px"}); 2354 } 2355 else if ( obj_in.attr("data-direction") == "down" && obj_in.css("position") == "fixed" ) 2356 { 2357 obj_in.css({"position":"relative","top":(top_in-top_start-diff_scroll)+"px","left":"0px","width":""}); 2358 } 2359 obj_in.attr("data-direction", "up"); 2360 } 2361 2362 if ( window.diff_scroll > 0 ) 2363 { 2364 if ( bot_end <= bot_win ) 2365 { 2366 obj_in.css({"position":"relative","top":gap_max+"px","left":"0px","width":""}); 2367 } 2368 else if ( bot_in <= bot_win ) 2369 { 2370 obj_in.css({"position":"fixed","top":(height_win-height_in)+"px","left":left_start+"px","width":width_start+"px"}); 2371 } 2372 else if ( obj_in.attr("data-direction") == "up" && obj_in.css("position") == "fixed" ) 2373 { 2374 obj_in.css({"position":"relative","top":(top_in-top_start-diff_scroll)+"px","left":"0px","width":""}); 2375 } 2376 obj_in.attr("data-direction", "down"); 2377 } 2378 } 2379 } 2380 } 2381 ); 2382};
2383 2384/* ****************************************** */ 2385/* /script/floating.banner.js */ 2386/* ****************************************** */ 2387 2388/* 2389floating_banner_body(id) -> position:relative 2390nd_floating_banner(class) -> position:absolute(ì¬ë¬ê° ê°ë¥) 2391 2392<div id="floating_banner_body"> 2393 // 2394 <div id="floating_banner_left" class="nd_floating_banner" data-parent-target="ND_Warp" data-top-margin="5" data-duration="300" data-scroll='y'> 2395 <ul> 2396 <li>ì¢ì¸¡ë°°ë</li> 2397 </ul> 2398 </div> 2399 <div id="floating_banner_right" class="nd_floating_banner" data-scroll='y' data-top-margin="5" data-duration="300"> 2400 <ul> 2401 <li>ì°ì¸¡ë°°ë</li> 2402 </ul> 2403 </div> 2404</div> 2405*/ 2406(function($) { 2407 $(function(){ 2408 if($(".view-aside").is(".view-aside") === true) { // ëìì´ ìì¼ë©´ ìë 2409 2410 var $NDFloatingBanner = { 2411 target:$(".view-aside"), // ë°°ë 2412 parentTarget:null, // ë¶ëª¨ 2413 parentTargetHeight:0, // ë¶ëª¨ëì´ 2414 targetTopMargin:[], // ì¤í¬ë¡¤ì´ ë°°ëë³´ë¤ ë°ì¼ë¡ ë´ë ¤ê°ë©´ ìë¨ì¼ë¡ ë¶ëë° ì´ë ì¬ë°± 2415 targetTopPosi:[], // 문ììì ë¶ë¶ê³¼ ë°°ë ìë¨ì¬ì´ ì¬ë°± 2416 targetHeight:[], // ë°°ëëì´ 2417 execMaxPosi:[], // ë°°ëê° ì¤í¬ë¡¤ëì´ ë´ë ¤ì¤ë íê³ì 2418 duration:[], // ì§ììê° 2419 tops:[], // ìì top ê° 2420 scrolls:[], // ì¤í¬ë¡¤ ì¬ë¶ 2421 stop:false, // ì¤í¬ë¡¤ ì ì§ì¬ë¶ 2422 getOptions:function() { // ìµì ê° ì§ì 2423 var $this = this; 2424 var scrollStopCheck = true; 2425 this.parentTarget = $("#"+this.target.attr("data-parent-target")); 2426 this.parentTargetHeight = this.parentTarget.height() || 0; 2427 this.target.each(function(index,ele) { 2428 $this.targetTopMargin[index] = Number($(ele).attr("data-top-margin")) || 5; 2429 $this.scrolls[index] = $(ele).attr("data-scroll") || "n"; 2430 if($this.scrolls[index] == 'y') scrollStopCheck = false; 2431 $this.tops[index] = parseInt($(ele).css("top")) || 0; 2432 $this.targetTopPosi[index] = $(ele).offset().top - $this.targetTopMargin[index] || 0; 2433 $this.targetHeight[index] = $(ele).height() || 0; 2434 $this.execMaxPosi[index] = $this.parentTargetHeight - $this.targetHeight[index] || 0; 2435 $this.duration[index] = $(ele).attr("data-duration") || 300; 2436 }); 2437 // ì¤í¬ë¡¤ ë²ìê° ìë¤ë©´ ì ì§ 2438 this.stop = (this.parentTargetHeight < this.targetHeight) ? true : false; 2439 // data-scroll ì´ ëª¨ë nì´ë¼ë©´ ì ì§ 2440 if(scrollStopCheck === true) this.stop = true; 2441 } 2442 }; 2443 $NDFloatingBanner.getOptions(); 2444 2445 if($NDFloatingBanner.scrolls.length > 0 && $NDFloatingBanner.stop === false) { 2446 $(window).scroll(function() { 2447 var position = 0; 2448 // ì¤í¬ë¡¤ ìì¹ê³ì° 2449 if (window.innerWidth) position = window.pageYOffset; 2450 else if (document.documentElement && document.documentElement.clientWidth) position = document.documentElement.scrollTop; 2451 else if (document.body.clientWidth) position = document.body.scrollTop; 2452 2453 // ì¬ë¬ê° ë°°ëì¤ ì¤í¬ë¡¤ì íë ê²ë§ 2454 for(scrollData in $NDFloatingBanner.scrolls) { 2455 if($NDFloatingBanner.scrolls[scrollData] == 'y') { 2456 var top = 0; 2457 2458 if($NDFloatingBanner.execMaxPosi[scrollData] < position) { // íê³ì ì ê°ë©´ ìµëì¹ë¡ ì§ì 2459 top = $NDFloatingBanner.execMaxPosi[scrollData] + $NDFloatingBanner.tops[scrollData] - $NDFloatingBanner.targetTopPosi[scrollData]; 2460 2461 //2016. 11. 15 ì±ì¬ì ì¶ê° - ND_Warp ëì´ê° ì§§ìê±´ ë¹ì ìì ì¼ë¡ ìë¡ ì¬ë¼ê°ê±°ë ë°ì¼ë¡ ë´ë ¤ê°ë íì ë°©ì§ ìì . 2462 if(top < $NDFloatingBanner.tops[scrollData] - $NDFloatingBanner.execMaxPosi[scrollData]){ 2463 if($NDFloatingBanner.targetTopPosi[scrollData] < position) top = position + $NDFloatingBanner.tops[scrollData] - $NDFloatingBanner.targetTopPosi[scrollData]; 2464 else top = $NDFloatingBanner.tops[scrollData]; 2465 }else{ 2466 if(top < 0){ 2467 if($NDFloatingBanner.targetTopPosi[scrollData] < position) top = position + $NDFloatingBanner.tops[scrollData] - $NDFloatingBanner.targetTopPosi[scrollData]; 2468 else top = $NDFloatingBanner.tops[scrollData]; 2469 }else{ 2470 if(top < $NDFloatingBanner.tops[scrollData]) top = $NDFloatingBanner.tops[scrollData]; 2471 } 2472 } 2473 2474 } else { // ë°°ë ìë¨ì ì¬ë°±ì´ì ì§ëê°ë©´ ìë¨ì ë
2474¶ëë¡ 2475 if($NDFloatingBanner.targetTopPosi[scrollData] < position) top = position + $NDFloatingBanner.tops[scrollData] - $NDFloatingBanner.targetTopPosi[scrollData]; 2476 else top = $NDFloatingBanner.tops[scrollData]; 2477 } 2478 2479 $NDFloatingBanner.target.eq(scrollData).stop().animate({"top":top+"px"},{duration:$NDFloatingBanner.duration[scrollData], specialEasing: {width: "linear",height: "easeOutBounce"}, queue:false}); 2480 } 2481 } 2482 }); 2483 } 2484 } 2485 }); 2486})(jQuery); 2487 2488/* ****************************************** */ 2489/* /script/mosaic.js */ 2490/* ****************************************** */ 2491 2492function mosaic_autobox(data) { 2493 var $_container = $(data[0].container); 2494 var autoplay = data[0].autoplay; 2495 var autotime = data[0].autotime; 2496 var temp_autoplay = autoplay; 2497 var totalcount = $_container.find('ul.auto-nav > li').length; 2498 var point = 0; 2499 2500 $_container.on('mouseenter', '.auto-cursor', function(e){ 2501 mosaic_cmd('current', $(this).index()); 2502 }); 2503 2504 $_container.on('mouseenter', function(e){ 2505 if(autoplay) temp_autoplay = false; 2506 }).on('mouseleave', function(e){ 2507 if(autoplay) temp_autoplay = true; 2508 }); 2509 2510 if(autoplay) { 2511 var rolling = window.setInterval(function () { 2512 if(temp_autoplay) mosaic_cmd('next', 0); 2513 }, autotime); 2514 } 2515 2516 function mosaic_cmd(mode, current_point) { 2517 2518 if(mode == "prev") { 2519 point -= 1; 2520 if(point < 0) point = totalcount - 1; 2521 }else if(mode == "next") { 2522 point += 1; 2523 if(point >= totalcount) point = 0; 2524 }else if(mode == "current") { 2525 point = current_point; 2526 } 2527 2528 $_container.find('ul.auto-container > li').eq(point).show().siblings().hide(); 2529 $_container.find('ul.auto-nav > li').eq(point).addClass('active').siblings().removeClass('active'); 2530 2531 if(point < 2){ 2532 $_container.find('ul.auto-container').css({"left":"33.333333%","top":"33.333333%"}); 2533 } else if(point < 4 && point >= 2) { 2534 $_container.find('ul.auto-container').css({"left":"0px","top":"33.333333%"}); 2535 } else if(point < 6 && point >= 4) { 2536 $_container.find('ul.auto-container').css({"left":"0px","top":"0px"}); 2537 } else if(point >= 6) { 2538 $_container.find('ul.auto-container').css({"left":"33.333333%","top":"0px"}); 2539 } 2540 2541 return false; 2542 } 2543} 2544 2545/* ****************************************** */ 2546/* /script/newsAutoCall.js */ 2547/* ****************************************** */ 2548 2549function fn_articleAutoCall(mode, cycle) { 2550 2551 var autoCallMode = mode; 2552 var autoCallCycle = 1000*60*cycle; 2553 var _autoCallWatch = setInterval(action, autoCallCycle); 2554 2555 // DESKì¤ë³µìì ì´ë©´ ì´ê¸° 1í ë°ë¡ì¤í. 2556 if(autoCallMode == "desk") action(); 2557 2558 function action() { 2559 if(autoCallMode == "save") TxRx("/news/articleAutoSave.ajax.php"); 2560 else if(autoCallMode == "desk") TxRx("/news/articleAutoDesk.ajax.php"); 2561 else stop(); 2562 } 2563 2564 function TxRx(url) { 2565 2566 $.ajax({ 2567 type: "post", 2568 dataType: "json", 2569 url:url, 2570 data:$('#newsWriteForm').serialize(), 2571 success: function(data) { 2572 console.log(data[1]); 2573 }, 2574 error: function(error, request) { 2575 console.log("ìëì½ìë¬ - code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); 2576 stop(); 2577 } 2578 }); 2579 2580 } 2581 2582 function stop() { 2583 2584 clearInterval(_autoCallWatch); 2585 console.log(autoCallMode + 'ì¤í±'); 2586 2587 } 2588} 2589 2590/* ****************************************** */ 2591/* 기존 common.js */ 2592/* ****************************************** */ 2593 2594/*--------------------------------------------------------------------------------------------- 2595 JAVASCRIPT CODE 2596 --------------------------------------------------------------------------------------------- 2597 function name | description | use process 2598 --------------------------------------------------------------------------------------------- 2599 setCookie(ì¿ í¤ëª , ê°, ì í¨ê¸°ê°(ì¼)) | | ì¿ í¤ìì± 2600 getCookie(ì¿ í¤ëª ) | | ì¿ í¤ê°ì ¸ì¤ê¸° 2601 ---------------------------------------------------------------------------------------------*/ 2602 2603// ì¿ í¤ ìì± 2604function setCookie(cName, cValue, cDay, cDomain){ 2605 var expire = new Date(); 2606 expire.setDate(expire.getDate() + cDay); 2607 cookies = cName + '=' + escape(cValue) + '; path=/ '; // íê¸ ê¹¨ì§ì ë§ê¸°ìí´ escape(cValue)를 í©ëë¤. 2608 if(typeof cDay != 'undefined') cookies += ';expires=' + expire.toGMTString() + ';'; 2609 document.cookie = cookies; 2610 if (cDomain) { 2611 document.cookie += "domain=" + cDomain + ";"; 2612 } 2613} 2614
2615// ì¿ í¤ ê°ì ¸ì¤ê¸° 2616function getCookie(cName) { 2617 cName = cName + '='; 2618 var cookieData = document.cookie; 2619 var start = cookieData.indexOf(cName); 2620 var cValue = ''; 2621 if(start != -1){ 2622 start += cName.length; 2623 var end = cookieData.indexOf(';', start); 2624 if(end == -1)end = cookieData.length; 2625 cValue = cookieData.substring(start, end); 2626 } 2627 return unescape(cValue); 2628} 2629 2630// ì¿ í¤ ì§ì 2631function delCookie(cName) { 2632 var today = new Date(); 2633 2634 today.setTime(today.getTime() - 1); 2635 var value = getCookie(cName); 2636 if(value != "") 2637 document.cookie = cName + "=" + value + "; path=/; expires=" + today.toGMTString(); 2638} 2639 2640 2641/*--------------------------------------------------------------------------------------------- 2642 JAVASCRIPT CODE 2643 --------------------------------------------------------------------------------------------- 2644 function name | description | use process 2645 --------------------------------------------------------------------------------------------- 2646 checkMsgLength() | ì ë ¥ë 문ìì´ ê¸¸ì´ ê²ì¬ | ê¸°ì¬ ëê¸ 2647 calculateMsgLength() | 문ìì´ ê¸¸ì´ ë°í | ê¸°ì¬ ëê¸ 2648 assertMsgLength() | 문ìì´ ê¸¸ì´ë§í¼ ìë¼ ë³í | ê¸°ì¬ ëê¸ 2649 ---------------------------------------------------------------------------------------------*/ 2650 2651// 문ìì´ê¸¸ì´ ê²ì¬ 2652function checkMsgLength(frm, id, lenStr) { 2653 var length = calculateMsgLength(document.getElementById(frm).value); 2654 document.getElementById(id).innerHTML = length; 2655 if (length > lenStr) { 2656 alert("ìµë "+lenStr+" ë°ì´í¸ê¹ì§ ë¨ê¸°ì¤ ì ììµëë¤.\r\nì´ê³¼ë " + (length - lenStr) + "ë°ì´í¸ë ìëì¼ë¡ ìì ë©ëë¤."); 2657 document.getElementById(frm).value = assertMsgLength(document.getElementById(frm).value, lenStr, id); 2658 } 2659} 2660 2661//문ìì´ê¸¸ì´ ë°í 2662function calculateMsgLength(message) { 2663 var nbytes = 0; 2664 2665 for (i=0; i<message.length; i++) { 2666 var ch = message.charAt(i); 2667 2668 if (escape(ch).length > 4) { 2669 nbytes += 2; 2670 } else if (ch != "\r") { 2671 nbytes++; 2672 } 2673 } 2674 2675 return nbytes; 2676} 2677 2678//문ìì´ ê¸¸ì´ë§í¼ ìë¼ ë³í 2679function assertMsgLength(message, maximum, id) { 2680 var inc = 0; 2681 var nbytes = 0; 2682 var msg = ""; 2683 var msglen = message.length; 2684 2685 for (i=0; i<msglen; i++) { 2686 var ch = message.charAt(i); 2687 2688 if (escape(ch).length > 4) { 2689 inc = 2; 2690 } else if (ch != "\r") { 2691 inc = 1; 2692 } 2693 2694 if ((nbytes + inc) > maximum) { 2695 break; 2696 } 2697 2698 nbytes += inc; 2699 msg += ch; 2700 } 2701 2702 document.getElementById(id).innerHTML = nbytes; 2703 return msg; 2704} 2705 2706/*--------------------------------------------------------------------------------------------- 2707 JAVASCRIPT CODE 2708 --------------------------------------------------------------------------------------------- 2709 function name | description | use process 2710 --------------------------------------------------------------------------------------------- 2711 articleHeader() | 기ì¬ë·° í¤ë ë¤ë¹ | 기ì¬ë·° í¤ë ë¤ë¹ 2712 ---------------------------------------------------------------------------------------------*/ 2713 2714var articleHeader = { 2715 2716 // í¤ë ë¤ë¹ê²ì´ì ìì± 2717 setScroll:function(){ 2718 jQuery(window).scroll(function() { 2719 if (jQuery(this).scrollTop() > 300) { 2720 jQuery('#article-header-title').addClass('scroll'); 2721 } else { 2722 jQuery('#article-header-title').removeClass('scroll'); 2723 } 2724 }); 2725 }, 2726 2727 2728 // 기ì¬ì´ë 2729 move:function(mod, order_type, order_value, section_code, sub_section_code, serial_code){ 2730 jQuery.post( "ajaxGetForwardIdxno.php", { mod: mod, order_type:order_type, order_value: order_value, section_code: section_code, sub_section_code: sub_section_code, serial_code: serial_code }, function( f_idxno ) { 2731 2732 if(f_idxno){ 2733 location.href = '/news/articleView.html?idxno='+f_idxno 2734 }else{ 2735 alert('기ì¬ê° ì¡´ì¬íì§ ììµëë¤'); 2736 } 2737 2738 }); 2739 } 2740 2741} 2742 2743 2744/*--------------------------------------------------------------------------------------------- 2745 JAVASCRIPT CODE 2746 --------------------------------------------------------------------------------------------- 2747 function name | description | use process 2748 --------------------------------------------------------------------------------------------- 2749 bbsPrint(idxno) | ê²ì물 ì¸ìì°½ ì¤í | ê²ì물 ì¸ìì°½ ì¤í 2750 articlePrint(idxno) | ì¸ìì°½ ì¤í | ì¸ìì°½ ì¤í 2751 articleMail(idxno) | ë©ì¼ë³´ë´ê¸°ì°½ ì¤í | ë©ì¼ë³´ë´ê¸°ì°½ ì¤í 2752 articleErr(idxno) | ì¤ë¥ì ê³ ì°½ ì¤í | ì¤ë¥ì ê³ ì°½ ì¤í 2753 articleSingo(idxno) | ëê¸ì ê³ ì°½ ì¤í | ëê¸ì ê³ ì°½ ì¤í
2754 fn_guid() | (ëë¤)ê³ ì ìì´ë ìì± | (ëë¤)ê³ ì ìì´ë ìì± 2755 ---------------------------------------------------------------------------------------------*/ 2756 2757//ì¸ìì°½ ì¤í 2758function bbsPrint( idxno, ps ) { 2759 var ps_str = ""; 2760 if(ps != "") ps_str = "&ps="+ps; 2761 window.open('/bbs/bbsPrint.html?idxno='+idxno+ps_str, 'bbsPrint', 'width=660,height=500,scrollbars=yes'); 2762} 2763 2764// ì¸ìì°½ ì¤í 2765function articlePrint( idxno ) { 2766 window.open('/news/articlePrint.html?idxno='+idxno, 'articlePrint', 'width=660,height=500,scrollbars=yes'); 2767} 2768 2769// ë©ì¼ë³´ë´ê¸°ì°½ ì¤í 2770function articleMail( idxno ) { 2771 window.open('/news/articleMail.html?idxno='+idxno, 'articleMail', 'width=660,height=500,scrollbars=yes'); 2772} 2773 2774// ì¤ë¥ì ê³ ì°½ ì¤í 2775function articleErr( idxno ) { 2776 window.open('/news/articleErr.html?idxno='+idxno, 'articleErr', 'width=660,height=500,scrollbars=yes'); 2777} 2778 2779// ëê¸ì ê³ ì°½ ì¤í 2780function articleSingo( idxno ) { 2781 window.open('/news/articleSingo.html?idxno='+idxno, 'articleSingo', 'width=660,height=500,scrollbars=yes'); 2782} 2783 2784//ê³ ì ê°ìì± (기ì¬ë±ë¡ ê´ë ¨ê¸°ì¬ ëì¸ë ì¬ì©) 2785function fn_guid() { 2786 function s4() { 2787 return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); 2788 } 2789 return s4() + s4() + s4() + s4() + s4() + s4() + s4() + s4(); 2790} 2791 2792/* ****************************************** */ 2793/* /script/app.js (íì´ë°ì´ì ì¤ííì¼ */ 2794/* ****************************************** */ 2795 2796$(function(){ 2797 $(document).foundation(); 2798 2799 /* editì¬ì´ì¦ ì¡°ì ì¶ê° */ 2800 $('input:checkbox[name="editMode"]').on('change', function(e) { 2801 2802 var editModeChecked = ($(this).is(':checked'))? "checked":""; 2803 var savebool = false; 2804 if($('.user-content').length) { 2805 if(editModeChecked == "checked") $('.user-content').removeClass('active').addClass('active'); 2806 else $('.user-content').removeClass('active'); 2807 savebool = true; 2808 }else if($('.editmode').length){ 2809 if(editModeChecked == "checked") $('.editmode').removeClass('active').addClass('active'); 2810 else $('.editmode').removeClass('active'); 2811 savebool = true; 2812 } 2813 2814 if(savebool) { 2815 $.get("/news/articleEditMode.ajax.php", {'editModeChecked':editModeChecked}, function( data ) { 2816 //console.log(data); 2817 }); 2818 } 2819 }); 2820 2821});
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.