1var $iBoxTotalOpen = 0; 2var $iCurrentZIndex = 1; 3var $aBoxHistory = {}; 4var iImageIterationCount = 0; 5var iCurrentImageIterationCount = 0; 6var $sCurrentId = null; 7var sLastOpenUrl = null; 8var bIsPhotoImage = false; 9 10 11function js_box_remove($oObj, $bResetCloseWarning) { 12 var closeBoxFunc = function ($oObj) { 13 $('#main_core_body_holder').show(); 14 15 $('.feed_share_on_item a').removeClass('active'); 16 17 var $oParent = $($oObj).parents('.js_box:first'), 18 boxImageHolderFull = $($oObj).parents('.js_box_image_holder_full:first'), 19 boxImageHolder = $($oObj).parents('.js_box_image_holder:first'), 20 boxHolder = $($oObj).parents('.js_box_holder:first'), 21 $sLink = $oParent.find('.js_box_history:first').html(); 22 23 if (isset($aBoxHistory[$sLink])) { 24 delete $aBoxHistory[$sLink]; 25 } 26 27 boxImageHolderFull.fadeOut(100, function () { 28 $(this).remove(); 29 }); 30 boxImageHolder.fadeOut(100, function () { 31 $(this).remove(); 32 if ($('.js_box_image_holder:visible, .js_box_holder:visible').length == 0) { 33 if (typeof $Core.enableScroll !== 'undefined') { 34 $Core.enableScroll(); 35 } 36 } 37 }); 38 boxHolder.fadeOut(100, function () { 39 $(this).remove(); 40 if ($('.js_box_image_holder:visible, .js_box_holder:visible').length == 0) { 41 if (typeof $Core.enableScroll !== 'undefined') { 42 $Core.enableScroll(); 43 } 44 } 45 }); 46 $oParent.fadeOut(100, function () { 47 $(this).remove(); 48 }); 49 50 $('#global_attachment_list_inline').hide(); 51 52 if (bIsPhotoImage) { 53 bIsPhotoImage = false; 54 } 55 $(document).trigger('jsbox.closed'); 56 } 57 58 let oJsBox = $($oObj).closest('.js_box'); 59 if (oJsBox.length) { 60 if (!bUsingConfirmPopupForPreventingReload) { 61 var oForm = $($oObj).closest('.js_box').find('form:first'); 62 if (oForm.length) { 63 var parentObjectId = oForm.attr('id'); 64 $Core.reloadValidation.preventReload(parentObjectId); 65 66 function closePopupForPreventReload() { 67 $Core.reloadValidation.reset(true, parentObjectId, true); 68 $Core.reloadValidation.preventReload(); 69 closeBoxFunc($oObj); 70 bUsingConfirmPopupForPreventingReload = false; 71 } 72 73 if (close_warning_checked === true) { 74 if ($bResetCloseWarning) { 75 closePopupForPreventReload(); 76 } else { 77 $Core.jsConfirm({title: null, message: oTranslations['changes_you_made_may_not_be_saved'], is_prevent_reload: true}, closePopupForPreventReload, function() { 78 bUsingConfirmPopupForPreventingReload = false; 79 }); 80 } 81 } else { 82 $Core.reloadValidation.preventReload(); 83 closeBoxFunc($oObj); 84 } 85 } else { 86 closeBoxFunc($oObj); 87 } 88 } else { 89 bUsingConfirmPopupForPreventingReload = false; 90 } 91 } 92 93 return false; 94} 95 96function tb_show_new_image( 97 thisObject, sSrc, imageWidth, imageHeight, iCurrentIte) { 98 $('.js_box_image_gallery img').removeClass('is_active'); 99 $(thisObject).find('img').addClass('is_active'); 100 101 iCurrentImageIterationCount = iCurrentIte; 102 103 $('#js_thickbox_core_image').attr({ 104 'src': sSrc, 105 'width': imageWidth, 106 'height': imageHeight, 107 }); 108} 109 110function js_box_next_image() { 111 iCurrentImageIterationCount++; 112 113 var thisObject = $('#js_next_image_thumb_' + iCurrentImageIterationCount); 114 115 if (thisObject.length <= 0) { 116 iCurrentImageIterationCount = 0; 117 118 return js_box_next_image(); 119 } 120 121 var aParts = explode('|', thisObject.attr('rel')); 122 123 tb_show_new_image('#js_next_image_thumb_' + iCurrentImageIterationCount, '' + 124 thisObject.attr('href') + '', aParts[0], aParts[1], 125 iCurrentImageIterationCount); 126 127 return false; 128} 129 130function tb_show(caption, url, thisObject, sForceMessage, bForceNoClick, sType, hidden, holderId) { 131 $('.js_box').unbind('click'); 132 var baseURL; 133 if (url.indexOf('?') !== -1) { 134 baseURL = url.substr(0, url.indexOf('?')); 135 } else { 136 baseURL = url; 137 } 138 139 var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/, 140 urlType = baseURL.toLowerCase().match(urlString); 141 142 if (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || 143 urlType == '.gif' || urlType == '.bmp') { 144 imgPreloader = new Image(); 145 imgPreloader.onload = function () { 146 imgPreloader.onload = null; 147 148 var pagesize = tb_getPageSize(); 149 var x = pagesize[0] - 150; 150 var y = pagesize[1] - 150; 151 var imageWidth = imgPreloader.width; 152 var imageHeight = imgPreloader.height; 153 154 if (imageWidth > x) { 155 imageHeight = imageHeight * (x / imageWidth); 156 imageWidth = x; 157 if (imageHeight > y) { 158 imageWidth = imageWidth * (y / imageHeight); 159 imageHeight = y; 160 } 161 } else if (imageHeight > y) { 162 imageWidth = imageWidth * (y / imageHeight); 163 imageHeight = y; 164 if (imageWidth > x) { 165 imageHeight = imageHeight * (x / imageWidth); 166 imageWidth = x; 167 } 168 } 169 170 TB_WIDTH = imageWidth + 30; 171 TB_HEIGHT = imageHeight + 60; 172 173 $('.js_box_image_holder').remove(); 174 $('.js_box_image_holder').unbind('click'); 175 176 var $aAllBoxIndex = new Array(); 177 $('.js_box_holder').each(function () { 178 $aAllBoxIndex.push(parseInt($(this).css('z-index'))); 179 }); 180 181 var sHtml = ''; 182 sHtml += '<div class="js_box_image_holder" style="z-index: ' + (parseInt(Math.max.apply(Math, $aAllBoxIndex)) + 1) + ';"><div class="js_box ' + 183 (oParams['bJsIsMobile'] ? 'mobile_js_box' : '') + 184 ' js_box_image" style="display:block;"><div class="js_box_content">'; 185 186 if ($(thisObject).parents('.js_box_thumbs_holder').length > 0) { 187 var sCurrentSource = $(thisObject).find('img:first').attr('src'); 188 var sNewSource = ''; 189 var SubimgPreloaderImageWidth = ''; 190 var SubimgPreloaderImageHeight = ''; 191 var SubArrayWidth = new Array(); 192 var SubArrayHeight = new Array(); 193 var sSubHtml = ''; 194 var aUrlParts = new Array();
195 var aUrlPartsNew = new Array(); 196 // p('Current: ' + sCurrentSource); 197 198 iImageIterationCount = 0; 199 iCurrentImageIterationCount = 0; 200 201 sHtml += '<div>'; 202 $(thisObject).parents('.js_box_thumbs_holder').find('.js_box_image_holder_thumbs').find('.thickbox').each(function () { 203 iImageIterationCount++; 204 sNewSource = $(this).find('img').attr('src'); 205 206 aUrlParts = explode('_', sCurrentSource); 207 aUrlPartsNew = explode('_', sNewSource); 208 209 if (aUrlParts[0] == aUrlPartsNew[0]) { 210 iCurrentImageIterationCount = iImageIterationCount; 211 } 212 213 // if (sCurrentSource != sNewSource) 214 { 215 SubimgPreloader = new Image(); 216 217 SubimgPreloader.src = $(this).attr('href'); 218 219 SubimgPreloaderImageWidth = SubimgPreloader.width; 220 SubimgPreloaderImageHeight = SubimgPreloader.height; 221 222 if (SubimgPreloaderImageWidth > x) { 223 SubimgPreloaderImageHeight = SubimgPreloaderImageHeight * 224 (x / SubimgPreloaderImageWidth); 225 SubimgPreloaderImageWidth = x; 226 if (imageHeight > y) { 227 SubimgPreloaderImageWidth = SubimgPreloaderImageWidth * 228 (y / SubimgPreloaderImageHeight); 229 imageHeight = y; 230 } 231 } else if (imageHeight > y) { 232 SubimgPreloaderImageWidth = SubimgPreloaderImageWidth * 233 (y / SubimgPreloaderImageHeight); 234 SubimgPreloaderImageHeight = y; 235 if (SubimgPreloaderImageWidth > x) { 236 SubimgPreloaderImageHeight = SubimgPreloaderImageHeight * 237 (x / SubimgPreloaderImageWidth); 238 SubimgPreloaderImageWidth = x; 239 } 240 } 241 242 SubArrayWidth.push(SubimgPreloaderImageWidth); 243 SubArrayHeight.push(SubimgPreloaderImageHeight); 244 245 sSubHtml += '<a rel="' + SubimgPreloaderImageWidth + '|' + 246 SubimgPreloaderImageHeight + '" id="js_next_image_thumb_' + 247 iImageIterationCount + '" href="' + $(this).attr('href') + 248 '" onclick="tb_show_new_image(this, \'' + 249 $(this).attr('href') + '\', ' + SubimgPreloaderImageWidth + 250 ', ' + SubimgPreloaderImageHeight + ', ' + 251 iImageIterationCount + '); return false;"><img src="' + 252 sNewSource + '" alt="" ' + (aUrlParts[0] == aUrlPartsNew[0] 253 ? ' class="is_active" ' 254 : '') + ' /></a>'; 255 } 256 }); 257 258 TB_WIDTH = ((Math.max.apply(Math, SubArrayWidth)) + 30); 259 TB_HEIGHT = ((Math.max.apply(Math, SubArrayHeight))); 260 261 sHtml += '<div class="js_box_image_holder_browse">'; 262 sHtml += '<div class="js_box_image_gallery_display" style="height:' + 263 TB_HEIGHT + 'px; line-height:' + TB_HEIGHT + 'px;">'; 264 sHtml += '<a href="#" onclick="return js_box_next_image();"><img src="' + 265 url + '" width="' + imageWidth + '" height="' + imageHeight + 266 '" alt="" id="js_thickbox_core_image" /></a>'; 267 sHtml += '</div>'; 268 sHtml += '<div class="js_box_image_gallery">' + sSubHtml + '</div>'; 269 sHtml += '</div>'; 270 271 sHtml += '</div>'; 272 } else { 273 sHtml += '<a href="#" onclick="js_box_remove($(this).closest(\'.js_box_content\')); return false;"><img src="' + 274 url + '" width="' + imageWidth + '" height="' + imageHeight + 275 '" alt="" id="js_thickbox_core_image" style="min-width: ' + 276 imageWidth + 'px;min-height:' + imageHeight + 'px;"/></a>'; 277 } 278 279 sHtml += '</div></div></div>'; 280 if (typeof $Core.disableScroll !== 'undefined' && (typeof hidden === 'undefined' || !hidden)) { 281 $Core.disableScroll(); 282 } 283 $('body').prepend(sHtml); 284 285 $('.js_box_image').css( 286 { 287 top: (($(window).height() - $('.js_box_image').outerHeight()) / 2) + 288 'px', 289 left: (($(window).width() - $('.js_box_image').outerWidth()) / 2) + 290 'px', 291 display: 'block', 292 }); 293 294 var bCanCloseImageBox = true; 295 296 $('.js_box').click(function () { 297 bCanCloseImageBox = false;
298 }); 299 300 $('.js_box_image_holder').click(function () { 301 if (!bCanCloseImageBox) { 302 bCanCloseImageBox = true; 303 } else { 304 js_box_remove($(this).find('.js_box_content')); 305 } 306 }); 307 308 if ($.browser.msie && $.browser.version == '7.0') { 309 $Behavior.ie7FixZindex(); 310 } 311 }; 312 imgPreloader.src = url; 313 314 return false; 315 } 316 317 var bIsAlreadyOpen = false; 318 if ($(thisObject).hasClass('photo_holder_image') && 319 !empty($(thisObject).attr('rel'))) { 320 return; 321 } else { 322 if ($Core.exists('.js_box_image_holder_full')) { 323 js_box_remove( 324 $('.js_box_image_holder_full').find('.js_box_content:first')); 325 } 326 327 if (url.indexOf('#') != -1) { 328 var aParams = url.split('#'); 329 url = '#' + aParams[1]; 330 } 331 332 var queryString = url.replace(/^[^\?]+\??/, ''); 333 var params = tb_parseQuery(queryString); 334 335 } 336 if (!bIsPhotoImage && isset( 337 $aBoxHistory[params['' + getParam('sGlobalTokenName') + '[call]']])) { 338 return false; 339 } 340 341 if (!bIsAlreadyOpen) { 342 $iBoxTotalOpen++; 343 $iCurrentZIndex++; 344 if (typeof params[getParam('sGlobalTokenName') + '[call]'] != 'undefined' && (typeof hidden === 'undefined' || !hidden)) { 345 $aBoxHistory[params[getParam('sGlobalTokenName') + '[call]']] = true; 346 } 347 348 $sCurrentId = 'js_box_id_' + $iBoxTotalOpen; 349 } 350 351 if (caption === null) { 352 caption = ''; 353 } 354 355 var bIsFullMode = false, 356 _w = $(window).width(), 357 _h = $(window).height(); 358 359 if (params['width'] == 'full') { 360 params['width'] = _w; 361 params['height'] = _h; 362 bIsFullMode = true; 363 } else if (params['width'] == 'scan') { 364 params['width'] = (_w - (oCore['core.is_admincp'] ? 100 : 150)); 365 params['height'] = (_h - (oCore['core.is_admincp'] ? 100 : 150)); 366 } 367 368 if (_w < 600) { 369 params['width'] = _w - 20; 370 } 371 372 TB_WIDTH = (!empty(params['width']) ? ((params['width'] * 1) + 30) : 630); 373 TB_HEIGHT = (params['height'] * 1) + 40 || 440; 374 375 var pagesize = tb_getPageSize(); 376 if (TB_HEIGHT > pagesize[1]) { 377 TB_HEIGHT = (pagesize[1] - 75); 378 } 379 380 if (TB_WIDTH > pagesize[0]) { 381 TB_WIDTH = (pagesize[0] - 75); 382 } 383 384 var ajaxContentW = TB_WIDTH - 30, 385 ajaxContentH = TB_HEIGHT - 45; 386 387 if (_w < 600) { 388 TB_WIDTH = _w - 20; 389 ajaxContentW = TB_WIDTH - 10; 390 } 391 392 if (!bIsAlreadyOpen) { 393 var sHtml = ''; 394 395 if (bIsPhotoImage) { 396 $('.js_box_image_holder').remove(); 397 $('.js_box_image_holder').unbind('click'); 398 sHtml += '<div class="js_box_image_holder_full">'; 399 sHtml += '<div class="js_box_image_holder_full_loader" style="position:absolute; top:50%; left:50%;"><img src="' + 400 oJsImages['loading_animation'] + '" alt="" /></div>'; 401 sHtml += '<div style="display:none;" id="' + $sCurrentId + 402 '" class="js_box' + 403 (oParams['bJsIsMobile'] ? ' mobile_js_box' : ' ') + 404 (isset(params['no_remove_box']) ? ' js_box_no_remove' : '') + 405 '" style="width:' + ajaxContentW + 'px;">'; 406 sHtml += '<div class="js_box_content"></div>'; 407 sHtml += '<div class="js_box_close"><a href="#" onclick="return js_box_remove(this);">' + 408 oTranslations['close'] + '</a><span class="js_box_history">' + 409 params[getParam('sGlobalTokenName') + '[call]'] + '</span></div>'; 410 sHtml += '</div>'; 411 sHtml += '</div>'; 412 } else { 413 sHtml += '<div class="js_box_holder' + ((typeof hidden !== 'undefined' && hidden) ? ' hidden' : '') + '" '; 414 if (typeof holderId !== 'undefined' && holderId) { 415 sHtml += 'id="' + holderId + '" '; 416 } 417 sHtml += '>'; 418 419 if (bForceNoClick) { 420 sHtml += '<div class="js_box_image_holder">'; 421 } 422 423 var extraClass = ($(thisObject).attr('rel')) ? ' ' + 424 $(thisObject).attr('rel') : ' '; 425 sHtml += '<div id="' + $sCurrentId + '" class="js_box ' + extraClass + 426 (oParams['bJsIsMobile'] ? ' mobile_js_box' : ' ') + 427 (params['fullmode'] ? ' js_box_fullmode' : ' ') + 428 (isset(params['no_remove_box']) ? ' js_box_no_remove' : '') + 429 '" style="width:' + ajaxContentW + 'px;">'; 430 431 if (!bIsPhotoImage) { 432 sHtml += '<div class="js_box_title"><div class="js_box_title_content">' + caption + '</div>'; 433 sHtml += '</div>'; 434 } 435 436 if (typeof hidden !== 'undefined' && hidden) { 437 sHtml += '<div class="js_box_close"><a role="button"><i class="fa fa-close"></i></a><span class="js_box_history"></span></div>'; 438 } else { 439 sHtml += '<div class="js_box_close"><a href="#" onclick="return js_box_remove(this);"><i class="fa fa-close"></i></a><span class="js_box_history">' + 440 params[getParam('sGlobalTokenName') + '[call]'] + '</span></div>'; 441 } 442 sHtml += '<div class="js_box_content"><span class="js_box_loader"><i class="fa fa-spin fa-spinner"></i></span></div>'; 443 sHtml += '</div>'; 444 445 if (bForceNoClick) { 446 sHtml += '</div>'; 447 } 448 449 if (bIsPhotoImage) { 450 sHtml += '</div>'; 451 } else { 452 sHtml += '</div>'; 453 } 454 } 455 456 if (typeof $Core.disableScroll !== 'undefined' && (typeof hidden === 'undefined' || !hidden)) { 457 $Core.disableScroll(); 458 } 459 $('body').prepend(sHtml); 460 461 var $oNew = $('#' + $sCurrentId + ''); 462 463 tb_position($oNew, (bIsFullMode ? bIsFullMode : '')); 464 465 if (!bIsPhotoImage) { 466 $oNew.show(); 467 } else { 468 $('.js_box_image_holder_full_loader').css({ 469 'margin-left': '-' + 470 ($('.js_box_image_holder_full_loader').find('img:first').width() / 2) + 471 'px', 472 'margin-top': '-' + 473 ($('.js_box_image_holder_full_loader').find('img:first').height() / 2) + 474 'px', 475 }); 476 } 477 } else { 478 $oNew = $('.js_box_image_holder_full').find('.js_box:first'); 479 } 480 481 if (getParam('bJsIsMobile')) { 482 queryString += '&js_mobile_version=true'; 483 } 484 if (url.indexOf('TB_inline') != -1) { 485 486 if (params['type']) { 487 switch (params['type']) { 488 case 'delete': 489 var sHtml = ''; 490 var sMainUrl = url + '&do_delete=true'; 491 sHtml += '<div id="js_inline_delete">'; 492 if (!params['call']) { 493 sHtml += '<form method="post" action="' + sMainUrl + '">'; 494 sHtml += '<div><input type="hidden" name="' + 495 getParam('sGlobalTokenName') + '[security_token]" value="' + 496 getParam('sSecurityToken') + '" />'; 497 } 498 sHtml += '<div>'; 499 sHtml += getPhrase('are_you_sure'); 500 sHtml += '<div class="t_center p_4">'; 501 sHtml += ' <input type="hidden" name="item_id" value="' + 502 params['itemId'] + '" id="js_inline_delete_id" /> '; 503 504 if ($Core.exists('.admincp-fixed-menu')) { 505 sHtml += '<div class="js_box_buttonpane">'; 506 } 507 508 if (!params['call']) { 509 sHtml += ' <input class="btn btn-primary" type="submit" value="' + 510 getPhrase('yes') + '" class="btn" /> '; 511 } else { 512 sHtml += ' <input class="btn btn-primary" type="button" value="' + 513 getPhrase('yes') + 514 '" onclick="$(\'#js_inline_delete_id\').ajaxCall(\'' + 515 params['call'] + '\', \'' + queryString + 516 '\'); tb_remove();" /> '; 517 } 518 sHtml += ' <input class="btn btn-default" type="button" value="' + 519 getPhrase('no') + '" class="btn" onclick="tb_remove();" /> '; 520 521 if ($Core.exists('.admincp-fixed-menu')) { 522 sHtml += '</div>'; 523 } 524 525 sHtml += '</div>'; 526 sHtml += '</div>'; 527 if (!params['call']) { 528 sHtml += '</form>'; 529 } 530 sHtml += '</div>'; 531 532 break; 533 } 534 535 $oNew.find('.js_box_content').html(''); 536 $oNew.find('.js_box_content').html(sHtml); 537 } else { 538 var sHtml = $('#' + params['inlineId']).children(); 539 } 540 541 $oNew.find('.js_box_content').html(''); 542 $oNew.find('.js_box_content').html(sHtml); 543 544 return; 545 } else if (isset(params['TB_iframe'])) { 546 var sIframe = ''; 547 $oNew.find('.js_box_content').html(''); 548 $oNew.find('.js_box_content').html(sIframe); 549 } else { 550 if (!empty(sForceMessage)) { 551 $oNew.find('.js_box_content').html(''); 552 $oNew.find('.js_box_content').html(sForceMessage); 553 return; 554 } 555 556 var sAjaxType = 'GET'; 557 if ((params['' + getParam('sGlobalTokenName') + '[call]'] == 558 'share.popup') || sType == 'POST') { 559 sAjaxType = 'POST'; 560 } 561 562 if (thisObject instanceof jQuery && thisObject.hasClass('popup')) { 563 if (thisObject.data('custom-class')) { 564 $oNew.addClass(thisObject.data('custom-class')); 565 $oNew.attr('style', ''); 566 } 567 568 $.ajax({ 569 url: thisObject.attr('href'), 570 contentType: 'application/json', 571 headers: {popup: 'on'}, 572 success: function (e) { 573 if (typeof (e.goto) == 'string') { 574 window.location.href = e.goto; 575 return; 576 } 577 578 if (typeof (e.error) == 'string' && typeof (e.content) != 'string') { 579 $oNew.find('.js_box_content').html('<div class="error_message">' + e.error + '</div>'); 580 return; 581 } 582 583 if (typeof (e.iNumberRequest) != 'undefined' && 584 typeof (e.iNumberNotification) != 'undefined' && 585 typeof (e.iNumberMessage) != 'undefined') { 586 $Core.refresh_counter(e.iNumberRequest, e.iNumberNotification, 587 e.iNumberMessage); 588 } 589 590 $oNew.find('.js_box_title:first').html(((e.h1_clean && e.h1_clean.length) 591 ? e.h1_clean 592 : e.actual_title)); 593 $oNew.find('.js_box_content').html(''); 594 $oNew.find('.js_box_content').html(e.content); 595 $oNew.find('.js_box_title:first').show(); 596 $oNew.find('.js_box_close:first').show(); 597 if (typeof e.files !== 'undefined') { 598 $Core.loadStaticFiles(e.files); 599 } 600 $Core.loadInit(); 601 $Core.reloadValidation.initClosePopupWithForm($oNew); 602 }, 603 }); 604 605 return; 606 } 607 608 $.ajax( 609 { 610 type: sAjaxType, 611 dataType: 'html', 612 url: getParam('sJsAjax'), 613 data: queryString, 614 success: function (sMsg) { 615 $oNew.find('.js_box_content').html(''); 616 $oNew.find('.js_box_content').html(sMsg); 617 if (!empty($oNew.find('.js_box_title_store:first').html())) { 618 $oNew.find('.js_box_title:first').html($oNew.find('.js_box_title_store:first').html()); 619 } 620 $oNew.find('.js_box_title:first').show(); 621 $oNew.find('.js_box_close:first').show(); 622 623 if (bIsFullMode) { 624 $oNew.find('.js_box_content').height(ajaxContentH); 625 } 626 $Core.loadInit(); 627 $Core.reloadValidation.initClosePopupWithForm($oNew); 628 }, 629 }); 630 } 631} 632 633$Behavior.thickboxBrowser = function () { 634 $(document).off('keyup.thickboxBrowser').on('keyup.thickboxBrowser', function (e) { 635 if (e.keyCode === 27) { 636 var boxHolders = ['.js_box_image_holder_full', '.js_box_holder']; 637 for (var i in boxHolders) {
638 if ($Core.exists(boxHolders[i])) { 639 const eleTarget = $(boxHolders[i]).first(); 640 if (eleTarget.data('callback')) { 641 eval(eleTarget.data('callback')); 642 } 643 if (eleTarget.hasClass('no_delete')) { 644 eleTarget.addClass('hidden'); 645 } else { 646 js_box_remove(eleTarget.find('.js_box_content')); 647 } 648 } 649 } 650 } 651 }); 652}; 653 654function tb_get_active() { 655 var $aAllBoxIndex = new Array(); 656 var $aAllBoxIndexHolder = new Array(); 657 $('.js_box').each(function () { 658 $aAllBoxIndex[parseInt($(this).css('z-index'))] = $(this).attr('id'); 659 $aAllBoxIndexHolder.push(parseInt($(this).css('z-index'))); 660 }); 661 662 var $iFocusBox = parseInt(Math.max.apply(Math, $aAllBoxIndexHolder)); 663 664 if (isset($aAllBoxIndex[$iFocusBox]) && 665 $('#' + $aAllBoxIndex[$iFocusBox]).length > 0) { 666 return $aAllBoxIndex[$iFocusBox]; 667 } 668 669 return null; 670} 671 672function tb_remove() { 673 $('#main_core_body_holder').show(); 674 675 var $aAllBoxIndex = new Array(); 676 var $aAllBoxIndexHolder = new Array(); 677 $('.js_box').each(function () { 678 $aAllBoxIndex[parseInt($(this).css('z-index'))] = $(this).attr('id'); 679 $aAllBoxIndexHolder.push(parseInt($(this).css('z-index'))); 680 }); 681 682 var $iFocusBox = parseInt(Math.max.apply(Math, $aAllBoxIndexHolder)); 683 684 if (isset($aAllBoxIndex[$iFocusBox]) && 685 $('#' + $aAllBoxIndex[$iFocusBox]).length > 0) { 686 var $sLink = $('#' + $aAllBoxIndex[$iFocusBox]).find('.js_box_history:first').html(); 687 var holder = $('#' + $aAllBoxIndex[$iFocusBox]).closest('.js_box_holder'); 688 $('#' + $aAllBoxIndex[$iFocusBox]).fadeOut('100', function () { 689 $(this).remove(); 690 }); 691 $('#' + $aAllBoxIndex[$iFocusBox]).parent('.js_box_image_holder').fadeOut('100', function () { 692 $(this).remove(); 693 }); 694 695 delete $aBoxHistory[$sLink]; 696 697 holder.fadeOut(100, function () { 698 $(this).remove(); 699 if (typeof $Core.enableScroll !== 'undefined') { 700 $Core.enableScroll(); 701 } 702 }); 703 704 } 705 706 $('#global_attachment_list_inline').hide(); 707 708 return false; 709} 710 711function tb_draggable($oObj) { 712 if ($($oObj).parent().hasClass('js_box_image_holder_full')) { 713 return false; 714 } 715 716 $($oObj).draggable( 717 { 718 handle: '.js_box_title', 719 opacity: 0.35, 720 zIndex: 3000, 721 start: function (event, ui) { 722 if ($('#global_attachment_list_inline').length > 0) { 723 $('#global_attachment_list_inline').hide(); 724 } 725 }, 726 stop: function (event, ui) { 727 if ($('#global_attachment_list_inline').length > 0) { 728 $Core.updateInlineBox(); 729 $('#global_attachment_list_inline').show(); 730 } 731 }, 732 }); 733} 734 735function tb_position($oObj, bFull) { 736 if (bFull !== true) { 737 if (!$.ui) { 738 $Core.loadStaticFile(getParam('sJsHome') + 'static/jscript/jquery/ui.js'); 739 } 740 741 tb_draggable('.js_box'); 742 } 743 744 var $aAllBoxIndex = new Array(); 745 $('.js_box').each(function () { 746 $aAllBoxIndex.push(parseInt($(this).css('z-index'))); 747 }); 748 749 if (bFull === true) { 750 $($oObj).css( 751 { 752 top: '20%', 753 left: '50%', 754 'margin-left': '-' + (($($oObj).width() / 2) + 12) + 'px', 755 'z-index': (parseInt(Math.max.apply(Math, $aAllBoxIndex)) + 1), 756 'max-height': $(window).height() - $(window).height() * 0.2 - 10, 757 // 'overflow': 'auto' 758 }); 759 } else { 760 $($oObj).css( 761 { 762 top: '20%', 763 left: '50%', 764 'margin-left': '-' + (($($oObj).width() / 2) + 0) + 'px', 765 'z-index': (parseInt(Math.max.apply(Math, $aAllBoxIndex)) + 1), 766 'max-height': $(window).height() - $(window).height() * 0.2 - 10, 767 // 'overflow': 'auto' 768 }); 769 } 770 771 $($oObj).parent().css({'z-index': (parseInt(Math.max.apply(Math, $aAllBoxIndex)) + 1)}); 772 773 if ($.browser.msie && $.browser.version == '7.0') { 774 $Behavior.ie7FixZindex(); 775 } 776} 777 778function tb_parseQuery(query) { 779 var Params = {}; 780 if (!query) { 781 return Params; 782 } 783 784 var Pairs = query.split(/[;&]/); 785 for (var i = 0; i < Pairs.length; i++) { 786 var KeyVal = Pairs[i].split('='); 787 if (!KeyVal || KeyVal.length != 2) { 788 continue; 789 } 790 var key = unescape(KeyVal[0]); 791 var val = unescape(KeyVal[1]); 792 val = val.replace(/\+/g, ' '); 793 794 Params[key] = val; 795 } 796 797 return Params; 798} 799 800function tb_getPageSize() { 801 var de = document.documentElement; 802 var w = window.innerWidth || self.innerWidth || (de && de.clientWidth) || 803 document.body.clientWidth;
804 var h = window.innerHeight || self.innerHeight || (de && de.clientHeight) || 805 document.body.clientHeight; 806 arrayPageSize = [w, h]; 807 808 return arrayPageSize; 809}
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.