1/****************************************************************************** 2 íì¼ëª : lightbox3.js 3 ****************************************************************************** 4 ë´ ì© : lightbox3 5 ìì±ì : samE 6 ìì±ì¼ : 2008-06-18 7 ìì ì¼ : 8 ë² ì : 1.0 9*******************************************************************************/ 10 11 12var _lightboxObj; 13 14/** Lightbox를 íë©´ì íìíë¤. */ 15function showLightbox() { 16 var lightboxDiv = document.getElementById('lightbox_div_layout'); 17 if(lightboxDiv == null) { 18 _lightboxObj = new _lightbox3(); 19 } 20 _lightboxObj.isLoading = true; 21 _lightboxObj.loadLightbox(); 22} 23 24/** Lightbox를 íë©´ìì ì ê±°íë¤. */ 25function hideLightbox() { 26 //DHTMLX 27 try{ 28 if(typeof(parent._dhtmlxWin) != "undefined"){ 29 var win = parent._dhtmlxWin.window(_entityWin); 30 if (win != null && win.getId() == _entityWin) { 31 win.detachObject(); 32 win.hide(); 33 win.setModal(false); 34 return; 35 } 36 } 37 }catch(err){} 38 39 if(_lightboxObj != null) { 40 _lightboxObj.hideLightbox(); 41 } 42} 43 44 45/** Lightbox ìì±ì */ 46function _lightbox3() { 47 this.layoutObjectId = "main_td_content"; // layoutDivì 기ì¤ì´ ë ìµìì ê°ì²´ì id 48 49 this.layoutDiv = null; 50 this.boxFrame = null; 51 this.resizeDiv = null; 52 this.targetName = "lightbox3"; 53 this.isDisplay = false; 54 this.isLoading = false; // 2009-04-15(samE), loading ì¤ì¸ì§ ì¬ë¶ (exception ì²ë¦¬ë¥¼ ìí¨) 55 this.level = 1; // lightbox level (ì¬ë¬ê° ëì ì ëì 구ë¶ì ìí´) 56 57 // for resize 58 this.eventWinObj = null; 59 this.eventTdObj = null; 60 this.mousedownX = 0; 61 this.mousedownY = 0; 62 63 // config setting 64 var DEFAULT_MOVE_LEFT = -5; // layoutDiv left ìì¹ ì¡°ì ê° 65 var DEFAULT_MOVE_TOP = -8; // layoutDiv top ìì¹ ì¡°ì ê° 66 var DEFAULT_RESIZE_LAYOUT_WIDTH = 5; // layoutDiv width ê¸¸ì´ ì¡°ì ê° (íìë ìì¹ì layout object(td) ëë¹ í¬ê¸° ì¡°ì ) 67 var DEFAULT_RESIZE_LAYOUT_HEIGHT = 5; // layoutDiv height ê¸¸ì´ ì¡°ì ê° (íìë ìì¹ì layout object(td) ëë¹ í¬ê¸° ì¡°ì ) 68 var DEFAULT_RESIZE_BOX_WIDTH = -25; // box iframe width ê¸¸ì´ ì¡°ì ê° (layoutDiv ëë¹ í¬ê¸° ì¡°ì ) 69 var DEFAULT_RESIZE_BOX_HEIGHT = -25; // box iframe height ê¸¸ì´ ì¡°ì ê° (layoutDiv ëë¹ í¬ê¸° ì¡°ì ) 70 var DEFAULT_RESIZE_TD_THICK = 10; // lightbox í¬ê¸° ì¡°ì ì ìí´ ë§ë ì¤ì td ëê» 71 var DEFAULT_RESIZE_LINE_THICK = 2; // lightbox í¬ê¸° ì¡°ì ì ìí´ ë³´ì¬ì§ line ëê» 72 var DEFAULT_MINIMUM_BOX_WIDTH = 250; // box iframe width ìµì ê° 73 var DEFAULT_MINIMUM_BOX_HEIGHT = 250; // box iframe height ìµì ê° 74 75 this.config = { 76 moveLeft : DEFAULT_MOVE_LEFT, 77 moveTop : DEFAULT_MOVE_TOP, 78 resizeLayoutWidth : DEFAULT_RESIZE_LAYOUT_WIDTH, 79 resizeLayoutHeight: DEFAULT_RESIZE_LAYOUT_HEIGHT, 80 resizeBoxWidth : DEFAULT_RESIZE_BOX_WIDTH, 81 resizeBoxHeight : DEFAULT_RESIZE_BOX_HEIGHT, 82 resizeTdThick : DEFAULT_RESIZE_TD_THICK, 83 resizeLineThick : DEFAULT_RESIZE_LINE_THICK, 84 minimumBoxWidth : DEFAULT_MINIMUM_BOX_WIDTH, 85 minimumBoxHeight : DEFAULT_MINIMUM_BOX_HEIGHT 86 }; 87} 88 89/** Lightbox를 Load íë¤. */ 90_lightbox3.prototype.loadLightbox = function() { 91 this.createLightbox(); 92 93 // page loadê° ëëë©´ showLightbox 94 this.boxFrame.onreadystatechange = function() { 95 if(document.readyState == "complete") { 96 _lightboxObj.showLightbox(); 97 } 98 }; 99 100 _hideOverlapObject("select", this.layoutDiv); // For IE6, selectbox ì¶©ë 문ì 101} 102 103/** Lightbox를 íë©´ì íìíë¤. */ 104_lightbox3.prototype.showLightbox = function() { 105 if(this.level != 1) { 106 document.body.scroll = "no"; 107 window.scrollTo(0, 0); 108 109 // 기존 resize tdì resize eventë ì ê±°íë¤. 110 if(parent._lightboxObj != null) { 111 //parent._lightboxObj.detachResizeEvent(); 112 } 113 } 114 115 this.isDisplay = true; 116 this.layoutDiv.style.display = ""; 117 this.boxFrame.style.display = ""; 118 //this.resizeDiv.style.display = ""; 119 this.resizeLightbox(); 120 this.positionLightbox(); 121} 122 123/** Lightbox를 íë©´ìì ì ê±°íë¤. */ 124_lightbox3.prototype.hideLightbox = function() { 125 if(this.level != 1) { 126 document.body.scroll = ""; 127 128 // 기존 resize tdì resize event를 ì¶ê°íë¤. 129 if(parent._lightboxObj != null) { 130 //parent._lightboxObj.attachResizeEvent(); 131 } 132 } 133 134 this.isDisplay = false; 135 //this.resizeDiv.style.display = "none"; 136 this.boxFrame.style.display = "none"; 137 this.layoutDiv.style.display = "none"; 138 139 _showOverlapObject(this.layoutDiv); // For IE6, selectbox ì¶©ë 문ì 140} 141 142/** Lightboxê° íë©´ì íìëì´ ìë ê²½ì° ì ê±°íê³ , íìëì´ ìì§ ìì ê²½ì° íë©´ì íìíë¤. */ 143_lightbox3.prototype.toggleLightbox = function() { 144 if(this._lightbox3.style.display == "none") { 145 this.showLightbox(); 146 } else { 147 this.hideLightbox(); 148 } 149} 150 151/** LightBox í¬ê¸°ë¥¼ ì¡°ì íë¤. */ 152_lightbox3.prototype.resizeLightbox = function() { 153 var offsetHeight = document.body.offsetHeight; 154 if(this.level == 1) { 155 var targetRect = getBounds(document.getElementById(this.layoutObjectId)); 156 this.layoutDiv.style.width = targetRect.width + this.config.resizeLayoutWidth; 157 if(new Number(this.layoutDiv.style.height.replace("px", "")) < offsetHeight) { 158 this.layoutDiv.style.height = targetRect.height + (this.level == 1 ? this.config.resizeLayoutHeight - 2 : this.config.resizeLayoutHeight); 159 } else { 160 this.layoutDiv.style.height = (offsetHeight - 100) + (this.level == 1 ? this.config.resizeLayoutHeight - 2 : this.config.resizeLayoutHeight); 161 } 162 } else { 163 this.layoutDiv.style.width = document.body.offsetWidth + this.config.resizeLayoutWidth ; 164 this.layoutDiv.style.height = document.body.offsetHeight + (this.level == 1 ? this.config.resizeLayoutHeight - 2 : this.config.resizeLayoutHeight); 165 } 166 167 var layoutDivRect = getBounds(this.layoutDiv); 168 this.boxFrame.style.width = (layoutDivRect.width + this.config.resizeBoxWidth ); 169 this.boxFrame.style.height = (layoutDivRect.height + this.config.resizeBoxHeight); 170 //this.resizeResizeDiv(); 171} 172 173/** box frame ëë¹ resize div í¬ê¸°ë¥¼ ì¡°ì íë¤. */ 174_lightbox3.prototype.resizeResizeDiv = function() { 175 var boxFrameRect = getBounds(this.boxFrame); 176 var resizeTable = this.resizeDiv.firstChild; 177 178 var middleWidth = boxFrameRect.width - (this.config.resizeTdThick * 2) + (this.config.resizeLineThick * 2); 179 var middleHeight = boxFrameRect.height - (this.config.resizeTdThick * 2) + (this.config.resizeLineThick * 2); 180 resizeTable.rows[0].cells[1].style.width = middleWidth; 181 resizeTable.rows[1].cells[0].style.height = middleHeight; 182 resizeTable.style.width = middleWidth + (this.config.resizeTdThick * 2); 183 resizeTable.style.height = middleHeight + (this.config.resizeTdThick * 2); 184 185 var resizeTableRect = getBounds(resizeTable); 186 this.resizeDiv.style.width = resizeTableRect.width ; 187 this.resizeDiv.style.height = resizeTableRect.height; 188} 189 190/** LightBox ìì¹ë¥¼ ì¡°ì íë¤. */ 191_lightbox3.prototype.positionLightbox = function() { 192 var targetRect = getBounds(document.getElementById(this.layoutObjectId)); 193 this.layoutDiv.style.left = targetRect.left + this.config.moveLeft + this.config.resizeLineThick; 194 this.layoutDiv.style.top = targetRect.top + this.config.moveTop + this.config.resizeLineThick; 195 196 var layoutDivRect = getBounds(this.layoutDiv); 197 var boxFrameRect = getBounds(this.boxFrame); 198 this.boxFrame.style.left = layoutDivRect.left + Math.floor((layoutDivRect.width - boxFrameRect.width ) / 2); 199 this.boxFrame.style.top = layoutDivRect.top + Math.floor((layoutDivRect.height - boxFrameRect.height) / 2); 200 //this.positionResizeDiv(); 201} 202 203/** box frame ëë¹ resize div ìì¹ë¥¼ ì¡°ì íë¤. */ 204_lightbox3.prototype.positionResizeDiv = function() { 205 boxFrameRect = getBounds(this.boxFrame); 206 this.resizeDiv.style.left = boxFrameRect.left - this.config.resizeLineThick - (this.level == 1 ? this.config.resizeLineThick : 0); 207 this.resizeDiv.style.top = boxFrameRect.top - this.config.resizeLineThick - (this.level == 1 ? this.config.resizeLineThick : 0); 208} 209 210/** Lightbox를 ìì±íë¤. */ 211_lightbox3.prototype.createLightbox = function() { 212 213 // leveltì ì¤ì íë¤. 214 this.setLevel(); 215 216 this.layoutDiv = document.getElementById("lightbox_div_layout"); 217 this.boxFrame = document.getElementById("lightbox_iframe_box"); 218 //this.resizeDiv = document.getElementById("lightbox_div_resize"); 219 220 var layoutDiv, boxFrame, resizeDiv; 221 222 // ìµì´ ìì±ì 223 //if(this.layoutDiv == null || this.boxFrame == null || this.resizeDiv == null) { 224 if(this.layoutDiv == null || this.boxFrame == null) { 225 var layoutDiv = this.createLayoutDiv(); 226 var boxFrame = this.createBoxFrame (); 227 //var resizeDiv = this.createResizeDiv(); 228 229 this.layoutDiv = layoutDiv; 230 this.boxFrame = boxFrame; 231 //this.resizeDiv = resizeDiv; 232 //this.attachResizeEvent(); 233 234 // body 맨 ë¤ì append íë©´ scrollì´ ë°ìíì¬ ìì 235 //document.body.appendChild(layoutDiv); 236 //document.body.appendChild(boxFrame ); 237 //document.body.appendChild(resizeDiv); 238 document.body.insertBefore(layoutDiv, document.body.lastChild); 239 document.body.insertBefore(boxFrame , document.body.lastChild); 240 //document.body.insertBefore(resizeDiv, document.body.lastChild); 241 242 // iframe elementì name ìì±ì´ ì 먹ì´ì, frame elementë¡ ê°ì ¸ìì name ìì± ì ì© 243 window.frames["lightbox_iframe_box"].name = this.getTarget(); 244 } 245} 246 247/** layout div ê°ì²´ë¥¼ ìì±íë¤. */ 248_lightbox3.prototype.createLayoutDiv = function() { 249 var divObj = document.createElement("div"); 250 divObj.id = "lightbox_div_layout"; 251 divObj.style.display = "none"; 252 divObj.style.filter = "Alpha(opacity=" + (this.level * 20) + "); opacity:" + (this.level * 0.1) + "; -moz-opacity:" + (this.level * 0.1); 253 divObj.onclick = function() { event.cancelBubble = true; } 254 return divObj; 255} 256 257/** box iframe ê°ì²´ë¥¼ ìì±íë¤. */ 258_lightbox3.prototype.createBoxFrame = function() { 259 var iframeObj = document.createElement("iframe"); 260 iframeObj.id = "lightbox_iframe_box"; 261 iframeObj.style.display = "none"; 262 iframeObj.frameBorder = "0"; 263 return iframeObj; 264} 265 266/** lightbox í¬ê¸° ì¡°ì ì ìí í ë리를 ê°ì§ div ê°ì²´ë¥¼ ìì±íë¤. */ 267_lightbox3.prototype.createResizeDiv = function() { 268 var divObj = document.createElement("div"); 269 divObj.id = "lightbox_div_resize"; 270 divObj.style.display = "none"; 271 divObj.style.filter = "Alpha(opacity=" + (this.level * 20) + "); opacity:" + (this.level * 0.1) + "; -moz-opacity:" + (this.level * 0.1); 272 273 var tableObj, trObj, tdObj; 274 tableObj = document.createElement("table"); 275 tableObj.border = "0"; 276 tableObj.cellSpacing = "0"; 277 tableObj.cellPadding = "0"; 278 279 var resizeTdThick = this.config.resizeTdThick; 280 281 // top row 282 trObj = tableObj.insertRow(-1); 283 284 // nw 285 tdObj = trObj.insertCell(0); 286 tdObj.style.width = resizeTdThick; 287 tdObj.style.height = resizeTdThick; 288 tdObj.style.cursor = "nw-resize"; 289 290 // n 291 tdObj = trObj.insertCell(1); 292 tdObj.style.width = "auto"; 293 tdObj.style.height = resizeTdThick; 294 tdObj.style.cursor = "n-resize"; 295 296 // ne 297 tdObj = trObj.insertCell(2); 298 tdObj.style.width = resizeTdThick; 299 tdObj.style.height = resizeTdThick; 300 tdObj.style.cursor = "ne-resize"; 301 302 303 // middle row 304 trObj = tableObj.insertRow(-1); 305 306 // w 307 tdObj = trObj.insertCell(0); 308 tdObj.style.width = resizeTdThick; 309 tdObj.style.height = "auto"; 310 tdObj.style.cursor = "w-resize"; 311 312 // c 313 tdObj = trObj.insertCell(1); 314 tdObj.style.width = "auto"; 315 tdObj.style.height = "auto"; 316 317 // e 318 tdObj = trObj.insertCell(2); 319 tdObj.style.width = resizeTdThick; 320 tdObj.style.height = "auto"; 321 tdObj.style.cursor = "e-resize"; 322 323 324 // bottom row 325 trObj = tableObj.insertRow(-1); 326 327 // sw 328 tdObj = trObj.insertCell(0); 329 tdObj.style.width = resizeTdThick; 330 tdObj.style.height = resizeTdThick; 331 tdObj.style.cursor = "sw-resize"; 332 333 // s 334 tdObj = trObj.insertCell(1); 335 tdObj.style.width = "auto"; 336 tdObj.style.height = resizeTdThick; 337 tdObj.style.cursor = "s-resize"; 338 339 // se 340 tdObj = trObj.insertCell(2); 341 tdObj.style.width = resizeTdThick; 342 tdObj.style.height = resizeTdThick; 343 tdObj.style.cursor = "se-resize"; 344 345 divObj.appendChild(tableObj); 346 347 return divObj; 348} 349 350/** resize div - tableì td ê°ì²´ì resize event를 ë¶ì¬íë¤ */ 351_lightbox3.prototype.attachResizeEvent = function() { 352 var tdCursors = ["nw", "n", "ne", "w", "", "e", "sw", "s", "se"]; 353 var tdObjs = this.resizeDiv.firstChild.getElementsByTagName("td"); 354 var tdObjCnt = tdObjs.length; 355 for(var i=0; i<tdObjCnt; i++) { 356 tdObjs[i].onmousedown = lightboxResizeMouseDown; 357 tdObjs[i].style.cursor = tdCursors[i] + "-resize"; 358 } 359} 360 361/** resize div - tableì td ê°ì²´ìì resize event를 ì ê±°íë¤. */ 362_lightbox3.prototype.detachResizeEvent = function() { 363 var tdObjs = this.resizeDiv.firstChild.getElementsByTagName("td"); 364 var tdObjCnt = tdObjs.length; 365 for(var i=0; i<tdObjCnt; i++) { 366 tdObjs[i].onmousedown = null; 367 tdObjs[i].style.cursor = ""; 368 } 369} 370 371/** lightbox levelì ì¤ì íë¤ */ 372_lightbox3.prototype.setLevel = function() { 373 if(window.name == "mwfRootWindow") { 374 this.level = 1; 375 } else {
376 this.level = new Number(window.name.replace(this.targetName + ":", "")) + 1; 377 // IE6, Web Server 거쳤ì ì Window Nameì´ ë¤ë¥´ê² ëìì ìì¸ ì²ë¦¬ 378 if(isNaN(this.level)) { 379 this.level = 1; 380 } 381 } 382} 383 384/** target nameì ê°ì ¸ì¨ë¤ */ 385_lightbox3.prototype.getTarget = function() { 386 return this.targetName + ":" + this.level; 387} 388 389 390 391//////////////////////////////////////////////////////////////// 392// Resize // 393//////////////////////////////////////////////////////////////// 394 395 396/** lightbox í¬ê¸° ì¡°ì mousedown event */ 397function lightboxResizeMouseDown() { 398 var rootWindow = getRootWindow(); 399 rootWindow._lightboxObj.eventWinObj = window; 400 rootWindow._lightboxObj.eventTdObj = window.event.srcElement; 401 rootWindow._lightboxObj.mousedownX = window.event.screenX; 402 rootWindow._lightboxObj.mousedownY = window.event.screenY; 403 404 var win = rootWindow; 405 while(true) { 406 if(win == null) { 407 break; 408 } 409 win.document.onselectstart = function() { return false; }; 410 win.document.onmouseup = win.lightboxResizeMouseUp; 411 412 // Release íë©´ê³¼ ê°ì´ iframeì ì°ë ê²½ì° 413 var iframeObjs = win.document.getElementsByTagName("iframe"); 414 var iframeCnt = iframeObjs.length; 415 for(var i=0; i<iframeCnt; i++) { 416 if(iframeObjs[i].id.indexOf("table_") == 0) { 417 var iframeWin = win.frames[iframeObjs[i].id]; 418 iframeWin.document.onselectstart = function() { return false; }; 419 iframeWin.document.onmouseup = iframeWin.lightboxResizeMouseUp; 420 } 421 } 422 win = win.frames["lightbox_iframe_box"]; 423 } 424} 425 426/** lightbox í¬ê¸° ì¡°ì mouseup event */ 427function lightboxResizeMouseUp() { 428 var rootWindow = getRootWindow(); 429 var rootLightboxObj = rootWindow._lightboxObj; 430 431 var eventWinObj = rootLightboxObj.eventWinObj; 432 var eventTdObj = rootLightboxObj.eventTdObj; 433 var direction = eventTdObj.style.cursor.replace("-resize", ""); 434 435 var mouseupX = window.event.screenX; 436 var mouseupY = window.event.screenY; 437 438 var diffX = mouseupX - rootLightboxObj.mousedownX; 439 var diffY = mouseupY - rootLightboxObj.mousedownY; 440 441 var changeWidth = 0; 442 var changeHeight = 0; 443 var changeLeft = 0; 444 var changeTop = 0; 445 switch(direction) { 446 case "nw": 447 changeWidth = -diffX; 448 changeHeight = -diffY; 449 changeLeft = +diffX; 450 changeTop = +diffY; 451 break; 452 453 case "n" : 454 changeHeight = -diffY; 455 changeTop = +diffY; 456 break; 457 458 case "ne": 459 changeWidth = +diffX; 460 changeHeight = -diffY; 461 changeTop = +diffY; 462 break; 463 464 case "e" : 465 changeWidth = +diffX; 466 break; 467 468 case "w" : 469 changeWidth = -diffX; 470 changeLeft = +diffX; 471 break; 472 473 case "sw": 474 changeWidth = -diffX; 475 changeHeight = +diffY; 476 changeLeft = +diffX; 477 break; 478 479 case "s" : 480 changeHeight = +diffY; 481 break; 482 483 case "se": 484 changeWidth = +diffX; 485 changeHeight = +diffY; 486 break; 487 488 default: 489 break; 490 } 491 492 var winLightboxObj = eventWinObj._lightboxObj; 493 494 var layoutDivRect = getBounds(winLightboxObj.layoutDiv); 495 var boxFrameObj = winLightboxObj.boxFrame; 496 var boxFrameRect = getBounds(boxFrameObj); 497 498 var calWidth = boxFrameRect.width + changeWidth - (winLightboxObj.config.resizeLineThick * 2); 499 var calHeight = boxFrameRect.height + changeHeight - (winLightboxObj.config.resizeLineThick * 2); 500 var calLeft = boxFrameRect.left + changeLeft; 501 var calTop = boxFrameRect.top + changeTop; 502 503 var minLeft = layoutDivRect.left - Math.floor(winLightboxObj.config.resizeBoxWidth / 2); 504 var maxLeft = layoutDivRect.left + layoutDivRect.width + Math.floor(winLightboxObj.config.resizeBoxWidth / 2); 505 var minTop = layoutDivRect.top - Math.floor(winLightboxObj.config.resizeBoxWidth / 2); 506 var maxTop = layoutDivRect.top + layoutDivRect.height + Math.floor(winLightboxObj.config.resizeBoxWidth / 2); 507 508 // width 509 if(changeWidth != 0) { 510 var minWidth = winLightboxObj.config.minimumBoxWidth; 511 var maxWidth = layoutDivRect.width + winLightboxObj.config.resizeBoxWidth; 512 513 // width ê°ì´ ìµìê°ë³´ë¤ ìì ê²½ì° 514 if(calWidth < minWidth) { 515 calLeft = calLeft + (calWidth - minWidth); 516 calWidth = minWidth; 517 518 // width ê°ì´ ìµëê°ë³´ë¤ í´ ê²½ì° 519 } else if(calWidth > maxWidth) { 520 calLeft = calLeft + (calWidth - maxWidth); 521 calWidth = maxWidth; 522 } 523 524 // left ê°ì´ ìµìê°ë³´ë¤ ìì ê²½ì° 525 if(calLeft < minLeft) { 526 calWidth = calWidth + (calLeft - minLeft); 527 calLeft = minLeft; 528 529 // left + width ê°ì´ ìµëê°ë³´ë¤ í´ ê²½ì° 530 } else if(calLeft + calWidth > maxLeft) { 531 var rWidth = maxLeft - (calLeft + calWidth);
532 calLeft = calLeft + rWidth; 533 calWidth = calWidth + rWidth; 534 } 535 536 // leftê°ì ìí´ widthê°ì´ ë³í ì ìì¼ë¯ë¡, ë¤ì íë² ì²´í¬íë¤. 537 // width ê°ì´ ìµìê°ë³´ë¤ ìì ê²½ì° 538 if(calWidth < minWidth) { 539 calLeft = calLeft + (calWidth - minWidth); 540 calWidth = minWidth; 541 542 // width ê°ì´ ìµëê°ë³´ë¤ í´ ê²½ì° 543 } else if(calWidth > maxWidth) { 544 calLeft = calLeft + (calWidth - maxWidth); 545 calWidth = maxWidth; 546 } 547 boxFrameObj.style.width = calWidth; 548 } 549 550 // height 551 if(changeHeight != 0) { 552 var minHeight = winLightboxObj.config.minimumBoxHeight; 553 var maxHeight = layoutDivRect.height + winLightboxObj.config.resizeBoxHeight; 554 555 // height ê°ì´ ìµìê°ë³´ë¤ ìì ê²½ì° 556 if(calHeight < minHeight) { 557 calTop = calTop + (calHeight - minHeight); 558 calHeight = minHeight; 559 560 // height ê°ì´ ìµëê°ë³´ë¤ í´ ê²½ì° 561 } else if(calHeight > maxHeight) { 562 calTop = calTop + (calHeight - maxHeight); 563 calHeight = maxHeight; 564 } 565 566 // top ê°ì´ ìµìê°ë³´ë¤ ìì ê²½ì° 567 if(calTop < minTop) { 568 calHeight = calHeight + (calTop - minTop); 569 calTop = minTop; 570 571 // top + height ê°ì´ ìµëê°ë³´ë¤ í´ ê²½ì° 572 } else if(calTop + calHeight > maxTop) { 573 var rHeight = maxTop - (calTop + calHeight); 574 calTop = calTop + rHeight; 575 calHeight = calHeight + rHeight; 576 } 577 578 // topê°ì ìí´ heightê°ì´ ë³í ì ìì¼ë¯ë¡, ë¤ì íë² ì²´í¬íë¤. 579 // height ê°ì´ ìµìê°ë³´ë¤ ìì ê²½ì° 580 if(calHeight < minHeight) { 581 calTop = calTop + (calHeight - minHeight); 582 calHeight = minHeight; 583 584 // height ê°ì´ ìµëê°ë³´ë¤ í´ ê²½ì° 585 } else if(calHeight > maxHeight) { 586 calTop = calTop + (calHeight - maxHeight); 587 calHeight = maxHeight; 588 } 589 boxFrameObj.style.height = calHeight; 590 } 591 592 // left 593 if(changeLeft != 0) { 594 boxFrameObj.style.left = calLeft; 595 } 596 597 // top 598 if(changeTop != 0) { 599 boxFrameObj.style.top = calTop; 600 } 601 602 winLightboxObj.resizeResizeDiv (); 603 winLightboxObj.positionResizeDiv(); 604 605 var win = rootWindow; 606 while(true) { 607 if(win == null) { 608 break; 609 } 610 win.document.onselectstart = null; 611 win.document.onmouseup = null; 612 613 // Release íë©´ê³¼ ê°ì´ iframeì ì°ë ê²½ì° 614 var iframeObjs = win.document.getElementsByTagName("iframe"); 615 var iframeCnt = iframeObjs.length; 616 for(var i=0; i<iframeCnt; i++) { 617 if(iframeObjs[i].id.indexOf("table_") == 0) { 618 var iframeWin = win.frames[iframeObjs[i].id]; 619 iframeWin.document.onselectstart = null; 620 iframeWin.document.onmouseup = null; 621 } 622 } 623 win = win.frames["lightbox_iframe_box"]; 624 } 625} 626 627 628 629//////////////////////////////////////////////////////////////// 630// Move (ëìíì§ ìì, ë¤ìì..) // 631//////////////////////////////////////////////////////////////// 632 633/** lightbox ì´ë mousedown event */ 634function lightboxMoveMouseDown() { 635 var rootWindow = getRootWindow(); 636 var rootLightboxObj = rootWindow._lightboxObj; 637 638 rootLightboxObj.mousedownX = window.event.screenX; 639 rootLightboxObj.mousedownY = window.event.screenY; 640 641 document.onselectstart = function() { return false; }; 642 document.onmousemove = lightboxMoveMouseMove; 643 document.onmouseup = lightboxMoveMouseUp; 644} 645 646/** lightbox ì´ë mousemove event */ 647function lightboxMoveMouseMove() { 648 var rootWindow = getRootWindow(); 649 var rootLightboxObj = rootWindow._lightboxObj; 650 651 var mouseupX = window.event.screenX; 652 var mouseupY = window.event.screenY; 653 654 var diffX = mouseupX - rootLightboxObj.mousedownX; 655 var diffY = mouseupY - rootLightboxObj.mousedownY; 656 657 rootLightboxObj.mousedownX = mouseupX; 658 rootLightboxObj.mousedownY = mouseupY; 659 660 var boxFrameObj = parent._lightboxObj.boxFrame 661 var boxFrameRect = getBounds(boxFrameObj); 662 boxFrameObj.style.left = boxFrameRect.left + diffX; 663 boxFrameObj.style.top = boxFrameRect.top + diffY; 664} 665 666/** lightbox ì´ë mouseup event */ 667function lightboxMoveMouseUp() { 668 document.onselectstart = null; 669 document.onmousemove = null; 670 document.onmouseup = null; 671} 672 673 674
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.