1if(typeof isELVIEW == 'undefined') isELVIEW = false; 2var elDefaultClass = (isELVIEW) ? 'el_viewblock' : 'element'; 3var elGalleryJS = {}; 4 5// $('body').removeClass('off-config overflow-hidden'); 6 7var setGalleryJS = function(callPointStatus,gEL) { 8 // console.log('set gallery js') 9 /* 10 0. gjs00SetBody() - body 11 gjs01SetFixedscroll(gEL)- fixedscroll block 12 13 // REMOVE (2024-10-22) 14 1. gjs10Load(gEL,g_js,g_js_code) - Load CSS / Javacript File 15 16 2. gjs20Load(gEL,g_js,g_js_code) - Load gjs 17 */ 18 19 if(gEL && gEL instanceof jQuery) gEL = gEL.get(0); 20 var g_js = $(gEL).find('.gjs').attr('data-js'); 21 if(typeof g_js == 'undefined' || !g_js) return false; 22 23 var g_js_code = $(gEL).find('.gjs').attr('data-js-code'); 24 if(typeof g_js_code == 'undefined' || !g_js_code) return false; 25 26 if(g_js) $(gEL).attr('data-gjs',g_js+g_js_code); 27 gjs01SetFixedscroll(gEL); 28 29 var gjs = g_js+g_js_code, 30 // gjs_selector = $(gEL).find('.gjs').attr('data-js-selector'), 31 g_id = $(gEL).attr('data-id'), 32 // g_name = $(gEL).attr('data-name'), 33 // g_feature = $(gEL).attr('data-feature'), 34 isOnlySet = ($('#el-blockConfig').hasClass('open')) ? true : false, 35 isFirst = (typeof elGalleryJS[g_id] == 'undefined') ? true : false, 36 isStart = false, 37 isEmpty = ($(gEL).find('[data-loop="true"]').is('.empty') || $(gEL).find('[data-loop="true"] .grid.empty-txt').length > 0) ? true : false; 38 39 var move_gitem = '', 40 cookie_g = $.cookie('gallery'), 41 cookie_gitem = $.cookie('gallery-item'); 42 43 if( typeof cookie_g != 'undefined' && 44 $(gEL).attr('data-id') == cookie_g && 45 $(gEL).find('.gallery-item[data-seq='+cookie_gitem+']').length > 0 46 ) { 47 move_gitem = cookie_gitem; 48 $.removeCookie('gallery', { path: '/' }); 49 $.removeCookie('gallery-item', { path : '/' }); 50 } 51 52 if(typeof gEL == 'undefined' || $(gEL).length == 0 ) { 53 gjs00SetBody(); 54 return false; 55 } 56 if($(gEL).find('input.gjs').length == 0) { 57 $(gEL).removeAttr('data-gjs').removeAttr('data-fixedscroll'); 58 gjs00SetBody(); 59 return false; 60 } 61 // console.log('--[00: setGalleryJS(___'+callPointStatus+'____,' + $(gEL).attr('data-id') + ') ]-----------------------------------------------------------------------------------------------------'); 62 63 64 if(move_gitem != '') { 65 // console.log('gjs: '+gjs); 66 // console.log('g_id: '+g_id); 67 // console.log('move_gitem: '+move_gitem); 68 69 if($.inArray(gjs, ['touchslider1','fixedscroll3','fixedscroll4']) > -1) { 70 // console.log('moveGallery premium'); 71 setLoadmoreGalleryJS(gjs,g_id,true,move_gitem); 72 } else { 73 // console.log('moveGallery default'); 74 var mh = getMenuHeight(), 75 bh = $.siteBanner.getBandHeight(), 76 enh = getEditNavbarHeight(), 77 offset = ($('.dsgn-body').hasClass('sidebar')) ? ((bh > 0) ? -bh : 0) : -(mh+bh), 78 delay_time = 1000, 79 delay_time = 1000, 80 isAnimate = false; 81 $moveDiv = $('.dsgn-body'), 82 $moveGitem = $(gEL).find('.gallery-item[data-seq="'+move_gitem+'"]'); 83 84 if($moveGitem.length == 0) return false; 85 switch(gjs) { 86 case 'fixedscroll1': 87 $moveDiv = $(gEL); 88 offset = -parseInt($moveGitem.css('margin-top')); 89 break; 90 91 case 'fixedscroll2': 92 isAnimate = true; 93 delay_time = 1500; //body top ì리 ì¡ë ìê° ì¶ê° 94 $moveDiv = $('html'); 95 96 default: 97 break; 98 } 99 100 setTimeout(function() { 101 if(isAnimate) $moveDiv.animate({'scrollTop': $moveGitem.offset().top + offset}, 1000, 'easeInOutQuart'); 102 else $moveDiv.scrollTo($moveGitem, 1000,{offset: offset, easing: 'easeInOutQuart'}); 103 }, delay_time); 104 } 105 } 106 107 // console.log(elGalleryJS); 108 // console.log(elGalleryJS[g_id]); 109 110 // console.log('gjs: '+gjs); 111 // console.log('isOnlySet: '+isOnlySet); 112 // console.log('isFirst: '+isFirst); 113 // console.log('isEmpty: '+isEmpty); 114 115 if(isEmpty) { 116 if($.inArray(gjs, ['touchslider1','fixedscroll3']) > -1) { 117 if(typeof elGalleryJS[g_id] == 'object' && typeof elGalleryJS[g_id].gjs_destroy == 'function') elGalleryJS[g_id].gjs_destroy(); 118 } 119 if(gjs == 'fixedscroll1') isEmpty = false; 120 if(gjs == 'fixedscroll3') $(gEL).find('.ready').removeClass('ready'); 121 if(gjs == 'fixedscroll4') $(gEL).find('.fs-container').removeAttr('style'); 122 } 123 124 125 if(typeof callPointStatus == 'undefined') callPointStatus = ''; 126 switch(callPointStatus) { 127 case 'elview-block': 128 if(!isFirst) { 129 elGalleryJS[g_id] = false;
130 isOnlySet = true; 131 } 132 break; 133 case 'reorder-block': 134 // ModalPlugin.js - reorderModal 135 if($.inArray(gjs,['touchslider1','fixedscroll4']) > -1) elGalleryJS[g_id] = false; 136 if($.inArray(gjs,['fixedscroll1']) > -1) isOnlySet = true; 137 break; 138 139 case 'wait-block': 140 // gallery.js - gjs20Load() touchslider1 (íì´ì§ ë´ ê°ì ë¸ë ì¬ë¬ê° ììê²½ì°, ìì°¨ ì²ë¦¬) 141 case 'load-block': 142 // gallery.js - startGalleryJS() undefined 143 // config.js - elPush 144 if(!isFirst) { 145 if(isOnlySet) { 146 if($.inArray(gjs,['touchslider1','fixedscroll4']) > -1) elGalleryJS[g_id] = false; 147 if($.inArray(gjs,['touchslider1']) > -1) $(gEL).attr('data-gjs-status', 'wait'); 148 } 149 } 150 break; 151 152 case 'reload-block': 153 // gallery.js - startGalleryJS() boolean 154 // block_config.js - loadGalleryInitList 155 if($.inArray(gjs,['touchslider1','fixedscroll3','fixedscroll4']) > -1) elGalleryJS[g_id] = false; 156 if($.inArray(gjs,['touchslider1','fixedscroll3','fixedscroll4']) > -1) isOnlySet = false; 157 break; 158 159 case 'add-loop': 160 // config.js - gallery-loadmore click 161 // render.js - gallery-loadmore click 162 163 if(!isFirst) { 164 if($.inArray(gjs,['touchslider1','fixedscroll4']) > -1) elGalleryJS[g_id] = false; 165 } 166 if($.inArray(gjs,['fixedscroll1', 'fixedscroll2']) > -1) isOnlySet = true; 167 break; 168 169 case 'change-loop': 170 // config.js - cl-gcate-item, cl-gsort-item a click 171 // render.js - cl-gcate-item, cl-gsort-item a click 172 if(!isFirst) { 173 if($.inArray(gjs,['touchslider1','fixedscroll4']) > -1) elGalleryJS[g_id] = false; 174 if($.inArray(gjs,['fixedscroll1']) > -1) isOnlySet = true; 175 } 176 break; 177 178 case 'change-swiper': 179 if(gjs == 'fixedscroll3') isStart = true; 180 break; 181 182 default: 183 break; 184 } 185 186 // console.log('isFirst: '+isFirst); 187 // console.log('isEmpty: '+isEmpty); 188 // console.log('isStart: '+isStart); 189 // console.log('isOnlySet: '+isOnlySet); 190 191 // console.log('elGalleryJS: '); 192 // console.log(elGalleryJS); 193 194 if(isEmpty) return false; 195 if(isStart) { 196 startGalleryJS(gEL); 197 return false; 198 } 199 200 if(isOnlySet) { 201 // console.log('isOnlySet'); 202 } else { 203 gjs20Load(gEL,g_js,String(g_js_code)); 204 } 205} 206 207var gjs00SetBody = function(onclass,gjs) { 208 console.log('--[00: gjs00SetBody('+onclass+','+gjs+') ]----------------------'); 209 210 if(typeof gjs == 'undefined' && gjs != 'fixedscroll2') $('body').removeClass('off-config overflow-hidden'); 211 212 if( (typeof MODE != 'undefined' && $.inArray(MODE, ['config','demo']) > -1) && 213 (typeof onclass == 'string' && onclass) 214 ) { 215 $('body').addClass(onclass); 216 $('header.navbar').closest('.el-menu').css('z-index','126'); 217 if($('header.navbar').hasClass('sidebar')) { 218 } else { 219 $('header.navbar').css('width','100%'); 220 } 221 } 222 223 if(typeof gjs != 'undefined' && gjs) $('body').attr('data-gjs',gjs); 224 else $('body').removeAttr('data-gjs'); 225 226 if(isELVIEW) $('body').attr('data-viewer',true); 227 else $('body').removeAttr('data-viewer'); 228} 229 230var gjs01SetFixedscroll = function(gEL) { 231 // console.log('--[01: gjs01SetFixedscroll(gEL) ]----------------------'); 232 233 $('#goto-top').hide(); 234 235 if($(gEL).hasClass('reorderBlock')) elDefaultClass = 'reorderBlock'; 236 else elDefaultClass = (isELVIEW) ? 'el_viewblock' : 'element'; 237 238 var g_name = $(gEL).attr('data-name'), 239 g_js = ($(gEL).find('.gjs').length > 0) ? $(gEL).find('.gjs').attr('data-js') : '', 240 g_js_code = (g_js) ? $(gEL).find('.gjs').attr('data-js-code') : ''; 241 242 $(gEL).attr('data-fixedscroll',true); 243 244 if(g_js) $(gEL).attr('data-gjs',g_js+g_js_code); 245 246 if(isELVIEW) { 247 document.querySelector('.'+g_name).style.setProperty('--menu-height', '0px', null); 248 } else { 249 var __menu_height = getComputedStyle(document.querySelector('.'+g_name)).getPropertyValue('--menu-height'); 250 if(typeof __menu_height != 'undefined' && __menu_height) { 251 var mh = getMenuHeight(), 252 bh = $.siteBanner.getBandHeight(); 253 document.querySelector('.'+g_name).style.setProperty('--menu-height', (mh+bh)+'px', null); 254 } 255 } 256} 257 258var gjs20Load = function(gEL,g_js,g_js_code) { 259 if(typeof gEL == 'undefined' || $(gEL).length == 0) return false; 260 // console.log('--[02: gjs20Load(' + $(gEL).attr('data-id') + ','+g_js+','+g_js_code+') ]----------------------'); 261 262 var g_id = $(gEL).attr('data-id'), 263 g_name = $(gEL).attr('data-name'), 264 g_feature = $(gEL).attr('data-feature'), 265 selector = $(gEL).find('.gjs').attr('data-js-selector'); 266 267 if(typeof g_id == 'undefined' || $('.'+g_name).length == 0) return false;
268 269 var isFirst = (typeof elGalleryJS[g_id] == 'undefined') ? true : false, 270 isReruning = (typeof elGalleryJS[g_id] == 'boolean') ? true : false; 271 272 if(!isFirst) { 273 var checkReorderBlock = ($(gEL).is('.reorderBlock') || $(gEL).closest('.new-dsgn-body').length > 0 || $(gEL).closest('.reorderModal').length > 0) ? true : false, 274 checkReset = (isELVIEW && $.inArray(g_js+g_js_code, ['fixedscroll4']) > -1) ? true : false; 275 276 if(checkReorderBlock || checkReset || isReruning) { 277 isFirst = true; 278 delete elGalleryJS[g_id]; 279 } 280 } 281 282 switch(g_js) { 283 case 'touchslider': 284 if(g_js_code == '1') { 285 if($(gEL).is('[data-feature*=fixedscroll]')) { 286 gjs00SetBody(); 287 } 288 if(typeof Touchslider1 == 'undefined') $(gEL).attr('data-gjs-status', 'wait'); 289 else { 290 $(gEL).removeAttr('data-gjs-status'); 291 292 if(isFirst) { 293 elGalleryJS[g_id] = new Touchslider1(document.querySelector('.'+g_name+' '+selector)); 294 } else { 295 elGalleryJS[g_id].gjs_load(document.querySelector('.'+g_name+' '+selector)); 296 } 297 298 if($('.element[data-gjs][data-gjs-status="wait"]').length > 0) setGalleryJS('wait-block',$('.element[data-gjs][data-gjs-status="wait"]').eq(0)); 299 } 300 } 301 break; 302 303 case 'fixedscroll': 304 if(g_js_code == '1') { 305 if(typeof VisualImgShow == 'undefined' && typeof VisualVdoShow == 'undefined') return false; 306 307 if($(gEL).is('[data-feature*=fixedscroll]')) { 308 gjs00SetBody('',g_js+g_js_code); 309 } 310 311 if(isFirst) { 312 var visual_type = $(gEL).find('[data-visual="true"]').attr('data-visual-type'); 313 elGalleryJS[g_id] = (visual_type == 'image') ? new VisualImgShow(document.querySelector('.'+g_name)) : new VisualVdoShow(document.querySelector('.'+g_name)); 314 } else { 315 elGalleryJS[g_id].gjs_load(document.querySelector('.'+g_name)); 316 } 317 318 // ë´ë¶ ì¤í¬ë¡¤ì ê°ì§í ìì ì í 319 if($(gEL).find('.content-wrap').length) { 320 $(gEL).find('.content-wrap').get(0).addEventListener('wheel', function(event) { 321 event.stopPropagation(); 322 // ì¤í¬ë¡¤ì ìµìë¨ ëë ìµíë¨ì ëë¬íëì§ íì¸ 323 const atTop = this.scrollTop === 0; 324 const atBottom = this.scrollHeight - this.scrollTop === this.clientHeight; 325 326 var elem = typeof PAGE_MODE != 'undefined' && PAGE_MODE == 'c' ? document.querySelector('.dsgn-body') : window; 327 // ìµìë¨ ëë ìµíë¨ì ëë¬íì ë 328 if ((atTop && event.deltaY < 0) || (atBottom && event.deltaY > 0)) { 329 // HTMLë¡ ì¤í¬ë¡¤ ì´ë²¤í¸ ì ë¬ 330 event.preventDefault(); // 기본 ëìì ë§ì ë´ë¶ ììì ì¤í¬ë¡¤ì ë©ì¶¤ 331 elem.scrollBy({ 332 top: event.deltaY, // ì¤í¬ë¡¤ ë°©í¥ì ë°ë¼ ì¤í¬ë¡¤ ì´ë 333 // behavior: 'auto' // ë¶ëë¬ì´ ì¤í¬ë¡¤ í¨ê³¼ ì ì© 334 }); 335 } 336 }, {passive: false }); 337 } 338 } else if (g_js_code == '2') { 339 if(typeof Fixedscroll2 == 'undefined') return false; 340 341 if($(gEL).is('[data-feature*=fixedscroll]')) { 342 gjs00SetBody('off-config',g_js+g_js_code); 343 } 344 var scroll_target = (isELVIEW) ? $('.elviewwrap') : $(window); 345 if(isELVIEW) $('#element-display .elviewwrap').attr('data-addCSS','fixedscroll2'); 346 347 Fixedscroll2($(gEL)); 348 scroll_target.scroll(function(event) { 349 Fixedscroll2($(gEL)); 350 }); 351 scroll_target.resize(function(event) { 352 Fixedscroll2($(gEL)); 353 }); 354 355 // ë´ë¶ ì¤í¬ë¡¤ì ê°ì§í ìì ì í 356 if($(gEL).find('.content-wrap').length) { 357 $(gEL).find('.content-wrap').get(0).addEventListener('wheel', function(event) { 358 event.stopPropagation(); 359 // ì¤í¬ë¡¤ì ìµìë¨ ëë ìµíë¨ì ëë¬íëì§ íì¸ 360 const atTop = this.scrollTop === 0; 361 const atBottom = this.scrollHeight - this.scrollTop === this.clientHeight; 362 363 var elem = typeof PAGE_MODE != 'undefined' && PAGE_MODE == 'c' ? document.querySelector('.dsgn-body') : window; 364 // ìµìë¨ ëë ìµíë¨ì ëë¬íì ë 365 if ((atTop && event.deltaY < 0) || (atBottom && event.deltaY > 0)) { 366 // HTMLë¡ ì¤í¬ë¡¤ ì´ë²¤í¸ ì ë¬ 367 event.preventDefault(); // 기본 ëìì ë§ì ë´ë¶ ììì ì¤í¬ë¡¤ì ë©ì¶¤ 368 elem.scrollBy({ 369 top: event.deltaY, // ì¤í¬ë¡¤ ë°©í¥ì ë°ë¼ ì¤í¬ë¡¤ ì´ë 370 // behavior: 'auto' // ë¶ëë¬ì´ ì¤í¬ë¡¤ í¨ê³¼ ì ì©
371 }); 372 } 373 }, { passive: false }); 374 } 375 } else if(g_js_code == '3') { 376 if(typeof Fixedscroll3 == 'undefined') return false; 377 if($(gEL).is('[data-feature*=fixedscroll]')) { 378 gjs00SetBody('off-config overflow-hidden',g_js+g_js_code); 379 } 380 381 if(isFirst) { 382 elGalleryJS[g_id] = new Fixedscroll3(document.querySelector('.'+g_name+' '+selector)); 383 } else { 384 elGalleryJS[g_id].gjs_load(document.querySelector('.'+g_name+' '+selector)); 385 } 386 387 388 } else if(g_js_code == '4') { 389 if(typeof Fixedscroll4 == 'undefined') return false; 390 391 if($(gEL).is('[data-feature*=fixedscroll]')) { 392 gjs00SetBody('',g_js+g_js_code); 393 } 394 if(typeof elGalleryJS[g_id] == 'undefined') { 395 elGalleryJS[g_id] = new Fixedscroll4(document.querySelector('.'+g_name+' '+selector)); 396 } else { 397 elGalleryJS[g_id].gjs_load(document.querySelector('.'+g_name+' '+selector)); 398 } 399 400 401 } else { 402 gjs00SetBody(); 403 } 404 405 406 /* ë³´ë¥ */ 407 // if(g_js_code == 'hold1') { 408 // if(typeof Fixedscrollhold1 == 'undefined') return false; 409 410 // gjs00SetBody('off-config overflow-hidden'); 411 // var scroll_target = $(gEL).find(selector); 412 // Fixedscrollhold1($(gEL),selector); 413 // } 414 415 break; 416 417 default: 418 gjs00SetBody(); 419 break; 420 } 421 422} 423 424 425 426/* ---------------------------------------------------------------------------------------------------------------------------------------------- */ 427var stopGalleryJS = function(gEL) { 428 if(typeof gEL == 'undefined' || $(gEL).length == 0) return false; 429 // console.log('--[ stopGalleryJS(' + $(gEL).attr('data-id') + ') ]-----------------------------------------------------------------------------------------------------'); 430 431 var g_id = $(gEL).attr('data-id'), 432 g_name = $(gEL).attr('data-name'), 433 g_feature = $(gEL).attr('data-feature'), 434 selector = $(gEL).find('.gjs').attr('data-js-selector'); 435 436 if( typeof g_id == 'undefined' || typeof elGalleryJS[g_id] == 'undefined') return false; 437 438 if( typeof elGalleryJS[g_id].gjs_stop == 'function' && 439 typeof elGalleryJS[g_id].DOM != 'undefined' 440 ) { 441 elGalleryJS[g_id].gjs_stop(); 442 } else { 443 // console.log('gjs_stop none..........'+$(gEL).attr('data-gjs')); 444 } 445} 446 447var startGalleryJS = function(gEL) { 448 if(typeof gEL == 'undefined' || $(gEL).length == 0) return false; 449 450 // console.log('--[ startGalleryJS(' + $(gEL).attr('data-id') + ') ]-----------------------------------------------------------------------------------------------------'); 451 452 var g_id = $(gEL).attr('data-id'), 453 g_name = $(gEL).attr('data-name'), 454 g_feature = $(gEL).attr('data-feature'), 455 selector = $(gEL).find('.gjs').attr('data-js-selector'); 456 457 if(typeof g_id == 'undefined') return false; 458 459 if( typeof elGalleryJS[g_id] == 'undefined' || typeof elGalleryJS[g_id] == 'boolean') { 460 var gjs_status = (typeof elGalleryJS[g_id] == 'boolean') ? 'reload-block' : 'load-block'; 461 setGalleryJS(gjs_status,$(gEL)); 462 } else if(typeof elGalleryJS[g_id].gjs_start == 'function' && typeof elGalleryJS[g_id].DOM != 'undefined') { 463 elGalleryJS[g_id].gjs_start(); 464 } else { 465 } 466 // else if(typeof elGalleryJS[g_id].gjs_load == 'function' && typeof elGalleryJS[g_id].DOM != 'undefined') { 467 // loadGalleryJS(gEL); 468 // } 469 470} 471/* ---------------------------------------------------------------------------------------------------------------------------------------------- */ 472 473var setLoadmoreGalleryJS = function(gjs,id,onoff,move_gitem) { 474 // console.log('--[ setLoadmoreGalleryJS('+gjs+','+id+','+onoff+','+move_gitem+') ]-----------------------------------------------------------------------------------------------------'); 475 var isMove = (typeof move_gitem != 'undefined' && move_gitem) ? true : false; 476 477 if( typeof gjs != 'undefined' && gjs && typeof id != 'undefined' && id ) { 478 if(typeof onoff == 'undefined') onoff = false; 479 var cookie_val = onoff; 480 481 var checkLoadMore = ['touchslider1', 'fixedscroll3', 'fixedscroll4']; 482 if($.inArray(gjs,checkLoadMore) > -1) { 483 if(onoff) { 484 var $galleryEL = $('.element[data-id="' + id +'"]'), 485 $galleryItem = (isMove) ? $galleryEL.find('.gallery-item[data-seq="'+move_gitem+'"]') : null; 486 487 switch(gjs) { 488 case 'touchslider1' : 489 if(isMove) cookie_val = ($galleryItem.length > 0) ? -$galleryItem.position().left : null; 490 else cookie_val = $galleryEL.find('.draggable').css('left').replace('px',''); 491 break; 492 case 'fixedscroll3': 493 if(isMove) cookie_val = ($galleryItem.length > 0) ? Number($galleryItem.attr('data-index')) : null; 494 else cookie_val = null; // gallery-loadmore clickì 미ì ì©
495 break; 496 case 'fixedscroll4': 497 if(isMove) cookie_val = ($galleryItem.length > 0) ? Number($galleryItem.attr('data-index')) : null; 498 else cookie_val = Number($galleryEL.find('.grid.slide-left').attr('data-index')) + 1; 499 break; 500 501 default: 502 break; 503 } 504 505 if(cookie_val === null) return false; 506 else $.cookie('gallery-'+gjs+'-'+id, cookie_val, { path: '/', expires: 12 * 60 * 60 * 1000 }); 507 } else { 508 $.removeCookie('gallery-'+gjs+'-'+id, { path: '/' }); 509 } 510 } 511 } 512} 513 514var getEditNavbarHeight = function() { 515 if($('.editor-navbar').length == 0) return 0; 516 if(typeof MODE != 'undefined' && $.inArray(MODE, ['config','demo']) > -1) { 517 var en_h = document.querySelector('.editor-navbar').getBoundingClientRect().height; 518 return parseInt(en_h+0.5); 519 } else { 520 return 0; 521 } 522} 523var getMenuHeight = function() { 524 if($('.el-menu > header').length == 0) return 0; 525 526 var checkSidebar = $('.el-menu > header').hasClass('sidebar'); 527 if(checkSidebar && window.parent && window.parent != this && $('.el-menu').outerWidth() < 523) checkSidebar = false; 528 529 var m_c = getEditNavbarHeight(), 530 m_h = (checkSidebar) ? 0 : document.querySelector('.el-menu > header').getBoundingClientRect().height; 531 m_h = (typeof m_h == 'undefined') ? 60 : parseInt(m_h+0.5); 532 533 return m_h+m_c; 534} 535 536 537/* ---------------------------------------------------------------------------------------------------------------------------------------------- */ 538 539var galleryLikePosition = function(gid, slide, itemSeq) { 540 // console.log('galleryLikePosition'); 541 if($(slide).find('img').length > 0) { 542 var likeSvg = '\ 543 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28">\ 544 <path d="m22.76 14.7-8.74 8.97-8.75-8.97m0 0c-2.31-2.32-2.37-6.14-.13-8.53 2.24-2.4 5.93-2.46 8.24-.14.23.23.44.48.63.75 1.93-2.67 5.59-3.2 8.16-1.2s3.09 5.79 1.16 8.45c-.18.24-.37.47-.58.68"></path>\ 545 <path d="M14.01 24.57c-.24 0-.48-.1-.64-.27l-8.74-8.97c-2.64-2.66-2.71-7.04-.15-9.78a6.576 6.576 0 0 1 4.74-2.12c1.79-.01 3.5.67 4.8 1.96a6.576 6.576 0 0 1 3.74-1.86c1.77-.25 3.54.22 4.97 1.34 2.95 2.29 3.55 6.64 1.33 9.69-.2.28-.42.54-.66.78l-.06.06-8.68 8.9c-.17.17-.4.27-.65.27zm-8.1-10.51c0 .01.01.01 0 0l8.1 8.32 8.1-8.31.06-.06c.15-.16.3-.33.43-.52 1.65-2.27 1.21-5.51-.98-7.22a4.723 4.723 0 0 0-3.61-.97c-1.31.2-2.47.91-3.27 2a.91.91 0 0 1-.73.37c-.29 0-.56-.14-.73-.38-.16-.22-.34-.44-.54-.64a4.78 4.78 0 0 0-3.49-1.43A4.83 4.83 0 0 0 5.8 6.78c-1.91 2.04-1.86 5.31.11 7.28z"></path>\ 546 </svg>\ 547 '; 548 $(gid).find('a.gallery-like').removeClass('hide big-img fullscreen').removeAttr('style').attr('data-seq', itemSeq).html(likeSvg); 549 550 var screenSize = getScreen(); 551 if(screenSize >= 1200) { 552 var slideContent = $(slide).find('img.slide-content'); 553 var marginTop = Number(slideContent.css('margin-top').replace('px', '')); 554 var marginLeft = Number(slideContent.css('margin-left').replace('px', '')); 555 556 if(marginLeft >= 120) { 557 var positionTop = slideContent.height() + marginTop - 46; 558 var positionLeft = slideContent.width() + marginLeft + 20; 559 $(gid).find('a.gallery-like').css({ 560 'top': positionTop + 'px', 561 'left': positionLeft + 'px' 562 }); 563 } else { 564 $(gid).find('a.gallery-like').removeAttr('style').addClass('big-img'); 565 } 566 } 567 568 if(itemSeq !== undefined) { 569 var like = getLike(itemSeq); 570 like.done(function(data){ 571 if(typeof data.own != 'undefined' && data.own) { 572 like_id = data.view; 573 // console.log(like_id); 574 575 $(gid).find('a.gallery-like').addClass('active').attr('data-like', like_id); 576 } else { 577 $(gid).find('a.gallery-like').removeClass('active').removeAttr('data-like'); 578 } 579 }); 580 } 581 } 582} 583 584$('.gallery-item').die('click').live('click', function(e) { 585 if($(this).find('[attr-flink]').length > 0 ) { 586 e.preventDefault(); 587 return false;
588 } 589 590 if($(e.target).hasClass('like') || $(e.target).closest('.figure').hasClass('like')) { 591 e.preventDefault(); 592 return false; 593 } 594 595 $('.gallery-frame .blueimp-gallery').addClass('blueimp-gallery-controls'); 596 $('.gallery-frame .blueimp-gallery a.zoom-in, .gallery-frame .blueimp-gallery a.zoom-out, .gallery-frame .blueimp-gallery a.view-original').remove(); 597 $('.gallery-frame .blueimp-gallery a.gallery-like').addClass('hide').removeClass('active').removeAttr('data-like'); 598 599 var $galleryItem = $(this); 600 var $el = $galleryItem.parents('.element'); 601 var pid = (PAGE_MODE == 'c')? selectID : $el.attr('data-id'); 602 var gid = $galleryItem.find('a').attr('data-gallery'); 603 var eid = $galleryItem.closest('.element').attr('data-id'); 604 var parent = (PAGE_MODE == 'c')? PARENT:property.PARENT; 605 var slideIndex = 0; 606 607 // gallery images 608 var gallerySeqArr = $('.element[data-id="'+eid+'"] .gallery-item, .galleryPL'+eid+'.gallery-popup .gallery-item').map(function() { 609 return $(this).attr('data-seq'); 610 }).get(); 611 612 var images = gallerySeqArr.reduce(function(acc, item) { 613 if (acc.indexOf(item) === -1) { 614 acc.push(item); 615 } 616 return acc; 617 }, []); 618 619 var totalSlide = (images.length == 2)? 2 : $(gid).find('.slide').length; 620 // console.log('totalSlide', totalSlide); 621 // console.log('images', images); 622 $('.gallery-frame .blueimp-gallery .slide-index .total-slide').text(totalSlide); 623 if($('#gframe-' + eid + ' .gallery-top-button').length == 0) $('#gframe-' + eid + ' a.close').wrap('<div class="gallery-top-button"></div>'); 624 625 if($galleryItem.find('a').attr('data-img-original') == 'ON') { 626 var viewOriginal = '<a class="zoom-in" data-id="' + pid + '" data-toggle="tooltip" data-placement="bottom" data-html="true" data-original-title="íë"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M24 22.94l-6.42-6.42C19.08 14.76 20 12.49 20 10c0-5.52-4.48-10-10-10S0 4.48 0 10s4.48 10 10 10c2.49 0 4.76-0.92 6.52-2.42L22.94 24 24 22.94zM1.5 10c0-4.69 3.81-8.5 8.5-8.5 4.69 0 8.5 3.81 8.5 8.5s-3.81 8.5-8.5 8.5C5.31 18.5 1.5 14.69 1.5 10z"/><polygon points="10.75 6 9.25 6 9.25 9.25 6 9.25 6 10.75 9.25 10.75 9.25 14 10.75 14 10.75 10.75 14 10.75 14 9.25 10.75 9.25 "/></svg></a>\ 627 <a class="zoom-out disabled" data-id="' + pid + '" data-toggle="tooltip" data-placement="bottom" data-html="true" data-original-title="ì¶ì"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 23" width="23" height="23"><g><path d="m23 21.98-6.16-6.16a9.566 9.566 0 0 0 2.32-6.24C19.17 4.29 14.88 0 9.58 0S0 4.29 0 9.58s4.29 9.58 9.58 9.58c2.39 0 4.57-.88 6.24-2.32L21.98 23 23 21.98zM1.44 9.58c0-4.49 3.65-8.15 8.15-8.15 4.49 0 8.15 3.65 8.15 8.15s-3.65 8.15-8.15 8.15-8.15-3.66-8.15-8.15z"/><path d="M5.75 8.86h7.67v1.44H5.75z"/></g></svg></a>\ 628 <a class="view-original disabled" data-id="' + pid + '" data-toggle="tooltip" data-placement="bottom" data-html="true" data-original-title="íë©´ í¬ê¸°ì ë§ì¶° íë">\ 629 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 27" width="27" height="27"><g><path d="M1 4.12v18.75h25V4.12H1zm23.5 17.26h-22V5.62h22v15.76z"/><path d="M8.03 18.19h1.56V8.81H6.47v1.57h1.56zM12.72 10.38h1.56v1.56h-1.56zM12.72 15.06h1.56v1.56h-1.56zM18.19 18.19h1.56V8.81h-3.13v1.57h1.57z"/></g></svg>\ 630 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 27" width="27" height="27"><path d="M24.03 4.03 24 4V3h-1l-.03-.03-.03.03H13.5v1.5h7.94L4.5 21.44V13.5H3v9.44l-.03.03L3 23v1h1l.03.03.03-.03h9.44v-1.5H5.56L22.5 5.56v7.94H24V4.06z"/></svg>\ 631 </a>\ 632 '; 633 $('.gallery-frame .blueimp-gallery a.close').after(viewOriginal); 634 } 635 636 setSlideIconTooltip(gid); 637 638 $(gid).off('slide').off('slideend'); 639 $(gid).on('slide', function (event, index, slide) { 640 if(!$galleryItem.find('a').is('[data-gallery-like="N"]')) $('.gallery-frame .blueimp-gallery a.gallery-like').removeAttr('data-like').addClass('hide'); 641 $('.gallery-frame .blueimp-gallery a.zoom-out').addClass('disabled'); 642 $('.gallery-frame .blueimp-gallery a.view-original').removeClass('fullscreen'); 643 $(gid).find('.slide').removeClass('fullscreen'); 644 $(gid).find('h3.title').removeClass('long-title visible'); 645 $('.gallery-frame .zoomable').removeClass('visible').addClass('hide'); 646 $('.gallery-frame .zoomable').find('img').remove(); 647 }).on('slideend', function(event, index, slide){ 648 // console.log(index); 649 var itemSeq = $('.element[data-id="'+pid+'"] .gallery-item[data-index='+index+']').attr('data-seq'); 650 var slideNumber = index + 1; 651 652 if(itemSeq == undefined) { 653 itemSeq = $('.galleryPL'+pid+'.gallery-popup .gallery-item[data-index='+index+']').attr('data-seq'); 654 if(totalSlide == 2 && index >= 2) slideNumber = index - 1; 655 } 656 657 $('.gallery-frame .blueimp-gallery .slide-index .current-slide').text(slideNumber); 658 659 var setSlideIcon = function() { 660 var windowWidth = $(window).width(); 661 var $img = $(slide).find('.slide-content'); 662 663 var title = $img.attr('title'); 664 if(title) $img.attr('data-title', title); 665 666 $(gid).find('h3.title').html($img.attr('data-title')); 667 $img.removeAttr('title'); 668 669 if ($galleryItem.find('a').attr('data-img-original') === 'ON') { 670 var currentWidth = $img.width(); 671 if(currentWidth >= windowWidth) { 672 $(gid).find('.view-original').addClass('disabled'); 673 } else { 674 $(gid).find('.view-original').removeClass('disabled'); 675 } 676 } 677 678 if(!$galleryItem.find('a').is('[data-gallery-like="N"]')) { 679 galleryLikePosition(gid, slide, itemSeq); 680 } 681 682 if(windowWidth <= 480) { 683 var titleWidth = $(gid).find('h3.title').width(); 684 if(titleWidth >= (windowWidth - 207)) $(gid).find('h3.title').addClass('long-title'); 685 } 686 } 687 688 if(!$(slide).hasClass('slide-loading')) { 689 setSlideIcon(); 690 } else { 691 // ì´ë¯¸ì§ ë¡ë를 ë기íë ê²½ì° 692 var checkLoaded = function () { 693 if(!$(slide).hasClass('slide-loading')) { 694 setSlideIcon(); 695 } else { 696 // ì´ë¯¸ì§ê° ìì í ë¡ëëì§ ìì ê²½ì° ì¬ê· í¸ì¶ 697 setTimeout(checkLoaded, 100); 698 } 699 }; 700 setTimeout(checkLoaded, 100); 701 } 702 }); 703 704 $('.gallery-frame .blueimp-gallery').find('h3.title').html($galleryItem.find('a').attr('data-title')); 705 706 $.cookie('gallery-item', $galleryItem.attr('data-seq'), { path : '/', expires: 12 * 60 * 60 * 1000 });
707 if(parent.prev != null) $('.data-page-prev').addClass('active'); 708 if(parent.next != null) $('.data-page-next').addClass('active'); 709 e.stopPropagation(); 710 711 $('body').off('dblclick', '.gallery-frame .blueimp-gallery .slide-content').on('dblclick', '.gallery-frame .blueimp-gallery .slide-content', function(e) { 712 $('.gallery-frame .blueimp-gallery a.view-original').toggleClass('fullscreen'); 713 var idx = 0, 714 eid = $('.gallery-frame .blueimp-gallery a.view-original').attr('data-id'); 715 716 var gid = '#gframe-' + eid; 717 $(gid + ' .slide').each(function(i,v) { 718 var trans = $(v).attr('style'); 719 if(trans.indexOf('translate(0px, 0px)') > -1 || trans.indexOf('transform: translate(0px) translateZ(0px)') > -1) { 720 idx=i; 721 } 722 }); 723 724 var $slide = $(gid + ' .slide[data-index="' + idx + '"]'); 725 var $img = $slide.find('.slide-content'); 726 if($('.gallery-frame .blueimp-gallery a.view-original').hasClass('fullscreen')) { 727 var img = $img[0]; 728 729 var currentWidth = $img.width(); 730 var currentHeight = $img.height(); 731 var windowWidth = $(window).width()-8; 732 var windowHeight = $(window).height(); 733 var naturalWidth = img.naturalWidth, 734 naturalHeight = img.naturalHeight; 735 736 scale = (windowWidth / currentWidth).toFixed(15); 737 } else { 738 scale = 1; 739 } 740 741 setSlideIconTooltip(gid); 742 setSlideImgScale($slide, scale); 743 }); 744 745 $('body').off('click','.gallery-frame .blueimp-gallery a.view-original').on('click','.gallery-frame .blueimp-gallery a.view-original', function(e) { 746 e.preventDefault(); 747 e.stopPropagation(); 748 $(this).toggleClass('fullscreen'); 749 750 var idx = 0, 751 eid = $(this).attr('data-id'); 752 753 var gid = '#gframe-' + eid; 754 $(gid + ' .slide').each(function(i,v) { 755 var trans = $(v).attr('style'); 756 if(trans.indexOf('translate(0px, 0px)') > -1 || trans.indexOf('transform: translate(0px) translateZ(0px)') > -1) { 757 idx=i; 758 } 759 }); 760 setSlideIconTooltip(gid); 761 $(gid).find('.view-original[data-toggle="tooltip"]').tooltip('show'); 762 763 var $slide = $(gid + ' .slide[data-index="' + idx + '"]'); 764 var $img = $slide.find('.slide-content'); 765 if($(this).hasClass('fullscreen')) { 766 var img = $img[0]; 767 768 var currentWidth = $img.width(); 769 var currentHeight = $img.height(); 770 var windowWidth = $(window).width()-8; 771 var windowHeight = $(window).height(); 772 var naturalWidth = img.naturalWidth, 773 naturalHeight = img.naturalHeight; 774 775 scale = (windowWidth / currentWidth).toFixed(15); 776 } else { 777 scale = 1; 778 } 779 780 setSlideImgScale($slide, scale); 781 }); 782 783 $('body').on('click','.gallery-frame .blueimp-gallery a.zoom-in, .gallery-frame .blueimp-gallery a.zoom-out', function(e) { 784 var idx = 0, 785 eid = $(this).attr('data-id'); 786 787 var gid = '#gframe-' + eid; 788 $('#gframe-' + eid + ' .slide').each(function(i,v) { 789 var trans = $(v).attr('style'); 790 if(trans.indexOf('translate(0px, 0px)') > -1 || trans.indexOf('transform: translate(0px) translateZ(0px)') > -1) { 791 idx=i; 792 } 793 }); 794 795 var $slide = $(gid + ' .slide[data-index="' + idx + '"]'); 796 var scale = $('.gallery-frame .zoomable img').attr('data-scale'); 797 if(scale === undefined) scale = 1; 798 799 if($(this).hasClass('zoom-in')) { 800 $('.gallery-frame .blueimp-gallery a.gallery-like').addClass('fullscreen'); 801 $('.gallery-frame .blueimp-gallery a.view-original').removeClass('disabled').addClass('fullscreen'); 802 803 scale = Number(scale) + 0.5; 804 } else { 805 if(scale > 1) scale = Number(scale) - 0.5; 806 if(scale < 1) scale = 1; 807 if(scale == 1) { 808 $('.gallery-frame .blueimp-gallery a.gallery-like').removeClass('fullscreen'); 809 $('.gallery-frame .blueimp-gallery a.view-original').removeClass('fullscreen'); 810 } 811 } 812 813 setSlideIconTooltip(gid); 814 setSlideImgScale($slide, scale); 815 816 e.stopPropagation(); 817 }); 818 819 $('body').off('click','.gallery-frame .blueimp-gallery a.play-pause').on('click','.gallery-frame .blueimp-gallery a.play-pause', function(e) { 820 setSlideIconTooltip(gid); 821 $(this).tooltip(); 822 }); 823 824 $('body').off('click','.gallery-frame .blueimp-gallery .title.long-title').on('click','.gallery-frame .blueimp-gallery .title.long-title', function(e) { 825 $(this).toggleClass('visible'); 826 }); 827}); 828 829var setSlideImgScale = function($slide, scale) { 830 // used 01. gallery block gallery mode 831 // used 002. resourcebox image 832 833 var checkResourcebox = $slide.is('#rframe'), 834 $img = $slide.find('.slide-content'), 835 slideFrame = $slide.closest('.blueimp-gallery'), 836 slideZoomable = slideFrame.find('.zoomable'); 837 838 var currentWidth = $img.width(); 839 var currentHeight = $img.height(); 840 841 if(slideZoomable.find('img').length == 0 || checkResourcebox) { 842 if(checkResourcebox) slideZoomable.empty(); 843 844 var $cloneImg = $slide.find('.slide-content').clone(); 845 $cloneImg.addClass('clone').attr('data-width', currentWidth).attr('data-height', currentHeight); 846 slideZoomable.append($cloneImg); 847 } 848 849 var slideZoomableImg = slideZoomable.find('img'); 850 851 var windowWidth = $(window).width(); 852 var windowHeight = $(window).height(); 853 var scaledWidth = currentWidth * scale; 854 var scaledHeight = currentHeight * scale; 855 856 var offsetX = ((windowWidth - currentWidth) > 0) ? (windowWidth - currentWidth) * 0.5 : 0; 857 var offsetY = ((windowHeight - currentHeight) > 0) ? (windowHeight - currentHeight) * 0.5 : 0; 858 var scaledOffsetX = ((windowWidth - scaledWidth - 8) > 0) ? (windowWidth - scaledWidth - 8) * 0.5 : 0; 859 var scaledOffsetY = ((windowHeight - scaledHeight) > 0) ? (windowHeight - scaledHeight) * 0.5 : 0; 860 var offset = {top: scaledOffsetY + 'px', left: scaledOffsetX + 'px'}; 861 var isScroll = false;
862 var centerX = 0; 863 var centerY = 0; 864 var scrollPositionX = 0; 865 var scrollPositionY = 0; 866 867 slideZoomable.removeClass('scroll'); 868 869 if(scaledWidth > windowWidth) { 870 slideZoomable.css('width', scaledWidth); 871 isScroll = true; 872 offset = {top: scaledOffsetY+'px', left: 0}; 873 } 874 875 if(scaledHeight > windowHeight) { 876 slideZoomable.css('height', scaledHeight); 877 isScroll = true; 878 offset = {top: 0, left: scaledOffsetX+'px'}; 879 } 880 881 if(scaledWidth >= windowWidth && scaledHeight >= windowHeight) { 882 offset = {top: 0, left: 0}; 883 } 884 885 if(isScroll) { 886 slideZoomable.addClass('scroll'); 887 var scrollOffsetX = scaledWidth - windowWidth; 888 var scrollOffsetY = scaledHeight - windowHeight; 889 890 centerX = (scrollOffsetX - 8) * 0.5; 891 centerY = (scrollOffsetY - 8) * 0.5; 892 893 scrollPositionX = (slideZoomable.attr('data-scroll-left') !== undefined)? Number(slideZoomable.attr('data-scroll-left')) * scrollOffsetX : centerX; 894 scrollPositionY = (slideZoomable.attr('data-scroll-top') !== undefined)? Number(slideZoomable.attr('data-scroll-top')) * scrollOffsetY : centerY; 895 896 // console.log('scrollPosition', scrollPositionX, scrollPositionY); 897 // console.log('center', centerX, centerY); 898 } 899 900 if(slideFrame.hasClass('blueimp-gallery-playing')) { 901 slideFrame.find('.play-pause').click(); 902 } 903 904 var scaleAnimation = Object.assign({}, offset, {width: scaledWidth+'px', height: scaledHeight+'px', scrollLeft: scrollPositionX, scrollTop: scrollPositionY}); 905 906 if (scale > 1) { 907 slideFrame.find('.zoom-out').removeClass('disabled'); 908 slideFrame.find('.gallery-like').addClass('fullscreen'); 909 slideZoomable.removeClass('hide'); 910 var zoomWidth = slideZoomableImg.attr('data-width'); 911 // var zoomHeight = slideZoomableImg.attr('data-height'); 912 var initialWidth = slideZoomableImg.width(); 913 var initialHeight = slideZoomableImg.height(); 914 915 if(Number(zoomWidth) == currentWidth) { 916 slideZoomableImg.css({width: currentWidth+'px', height: currentHeight+'px', top: offsetY+'px', left: offsetX+'px'}); 917 } 918 919 slideZoomable.addClass('visible'); 920 setTimeout(function(){ 921 $slide.addClass('fullscreen'); 922 923 slideZoomableImg.animate(scaleAnimation, 200); 924 // console.log(initialWidth, scaledWidth); 925 if(initialWidth < windowWidth && scaledWidth > windowWidth) { 926 scrollPositionX = centerX; 927 var scrollLeft = centerX / (scaledWidth - windowWidth); 928 slideZoomable.attr({'data-scroll-left': scrollLeft}); 929 } 930 if(initialHeight < windowHeight && scaledHeight > windowHeight) { 931 scrollPositionY = centerY; 932 var scrollTop = centerY / (scaledHeight - windowHeight); 933 slideZoomable.attr({'data-scroll-top': scrollTop}); 934 } 935 936 slideZoomable.animate({scrollLeft: scrollPositionX, scrollTop: scrollPositionY}, 200); //scroll 937 938 // if(scaledWidth >= windowWidth && scaledHeight >= windowHeight) slideZoomable.animate({scrollLeft: scrollPositionX, scrollTop: scrollPositionY}, 500); 939 940 slideZoomableImg.attr('data-scale', scale).attr('data-width', scaledWidth).attr('data-height', scaledHeight); 941 942 var isDragging = false; 943 var lastX, lastY; 944 slideZoomable.off('mousedown mousemove mouseup scroll'); 945 slideZoomable.on("mousedown", function(e) { 946 isDragging = true; 947 lastX = e.clientX; 948 lastY = e.clientY; 949 $(this).addClass('dragging'); 950 e.preventDefault(); 951 e.stopPropagation(); 952 953 }).on("mousemove", function(e) { 954 if (isDragging) { 955 var deltaX = e.clientX - lastX; 956 var deltaY = e.clientY - lastY; 957 $(this).scrollLeft($(this).scrollLeft() - deltaX); 958 $(this).scrollTop($(this).scrollTop() - deltaY); 959 lastX = e.clientX; 960 lastY = e.clientY; 961 e.preventDefault(); 962 e.stopPropagation(); 963 } 964 }).on("mouseup", function() { 965 isDragging = false; 966 $(this).removeClass('dragging'); 967 var scrollLeft = (($(this)[0].scrollWidth - $(this)[0].clientWidth) >
967 0) ? $(this).scrollLeft() / ($(this)[0].scrollWidth - $(this)[0].clientWidth) : 0; // ê°ë¡ ì¤í¬ë¡¤ ì¢í 968 var scrollTop = (($(this)[0].scrollHeight - $(this)[0].clientHeight) > 0) ? $(this).scrollTop() / ($(this)[0].scrollHeight - $(this)[0].clientHeight) : 0; // ì¸ë¡ ì¤í¬ë¡¤ ì¢í 969 970 slideZoomable.attr({'data-scroll-top': scrollTop, 'data-scroll-left': scrollLeft}); 971 }); 972 973 slideZoomable.on('mousewheel', function(e){ 974 var scrollLeft = (($(this)[0].scrollWidth - $(this)[0].clientWidth) > 0) ? $(this).scrollLeft() / ($(this)[0].scrollWidth - $(this)[0].clientWidth) : 0; // ê°ë¡ ì¤í¬ë¡¤ ì¢í 975 var scrollTop = (($(this)[0].scrollHeight - $(this)[0].clientHeight) > 0) ? $(this).scrollTop() / ($(this)[0].scrollHeight - $(this)[0].clientHeight) : 0; // ì¸ë¡ ì¤í¬ë¡¤ ì¢í 976 977 slideZoomable.attr({'data-scroll-top': scrollTop, 'data-scroll-left': scrollLeft}); 978 }); 979 }, 100); 980 } else { //ì본 í¬ê¸° 981 slideZoomableImg.animate(scaleAnimation, 200); 982 slideZoomable.animate({scrollLeft: scrollPositionX, scrollTop: scrollPositionY}, 200); 983 984 slideFrame.find('.zoom-out').addClass('disabled'); 985 slideFrame.find('.view-original, .gallery-like').removeClass('fullscreen'); 986 987 if(scaledWidth == $(window).width()) { 988 slideFrame.find('.view-original').addClass('disabled'); 989 } 990 991 setTimeout(function(){ 992 $slide.removeClass('fullscreen'); 993 }, 100); 994 setTimeout(function(){ 995 slideZoomable.removeClass('visible').addClass('hide'); 996 slideZoomable.removeAttr('data-scroll-top data-scroll-left') 997 slideZoomableImg.remove(); 998 }, 200); 999 } 1000 1001} 1002 1003var setSlideIconTooltip = function(slideframe_selector){ 1004 // used 01. gallery block gallery mode 1005 // used 002. resourcebox image 1006 1007 $(slideframe_selector).find('.zoom-in, .zoom-out, .view-original, .view-original.fullscreen').attr({ 1008 'data-toggle': 'tooltip', 1009 'data-placement': 'bottom', 1010 'data-html': 'true', 1011 }); 1012 1013 $(slideframe_selector).find('.zoom-in').attr('data-original-title', $.lang[LANG]['gallery.slide.tooltip.zoom-in']); 1014 $(slideframe_selector).find('.zoom-out').attr('data-original-title', $.lang[LANG]['gallery.slide.tooltip.zoom-out']); 1015 1016 $(slideframe_selector).find('.view-original').attr('data-original-title', $.lang[LANG]['gallery.slide.view-fullscreen']); 1017 if($(slideframe_selector).find('.view-original').hasClass('fullscreen')) { 1018 $(slideframe_selector).find('.view-original').attr('data-original-title', $.lang[LANG]['gallery.slide.tooltip.view-original']); 1019 } else { 1020 $(slideframe_selector).find('.view-original').attr('data-original-title', $.lang[LANG]['gallery.slide.tooltip.view-fullscreen']); 1021 } 1022 1023 $(slideframe_selector).find('.play-pause').attr({ 1024 'data-toggle': 'tooltip', 1025 'data-placement': 'top', 1026 'data-html': 'true', 1027 'data-original-title': $.lang[LANG]['gallery.slide.tooltip.autoplay'] 1028 }); 1029 $(slideframe_selector+'.blueimp-gallery-playing').find('.play-pause').attr('data-original-title', $.lang[LANG]['gallery.slide.tooltip.pause']); 1030} 1031 1032$(function() { 1033 var elem = typeof PAGE_MODE != 'undefined' && PAGE_MODE == 'c' ? document.querySelector('.dsgn-body') : document.querySelector('html'); 1034 1035 elem.addEventListener('wheel', function(event) { 1036 // ë§ì°ì¤ ìì¹ë¥¼ 기ì¤ì¼ë¡ í´ë¹ ìì를 ì°¾ì 1037 const mouseX = event.clientX; 1038 const mouseY = event.clientY; 1039 const elementAtMouse = document.elementFromPoint(mouseX, mouseY); 1040 var target = elementAtMouse; 1041 1042 // í´ë¹ ìì¹ì ìë ììê° fixedscroll ë´ì content-wrapì¸ì§ë¥¼ íì¸ 1043 if ($(target).parents('[data-gjs*="fixedscroll"]').find('.content-wrap').length && $(target).closest('.content-wrap').length) { 1044 // í´ë¹ ìììì í ì´ë²¤í¸ê° ë°ìí ê²½ì° preventDefault í¸ì¶íì¬ ê¸°ë³¸ ì¤í¬ë¡¤ ì°¨ë¨ 1045 event.preventDefault(); 1046 1047 // í ì´ë²¤í¸ê° ë°ìí ìììì ìëì¼ë¡ ì¤í¬ë¡¤ ì²ë¦¬ 1048 var focus_elem = $(target).parents('[data-gjs*="fixedscroll"]').find('.content-wrap').get(0); 1049 const atTop = focus_elem.scrollTop === 0; 1050 const atBottom = focus_elem.scrollHeight - focus_elem.scrollTop === focus_elem.clientHeight; 1051 1052 // ìµìë¨ ëë ìµíë¨ì ëë¬íì§ ììì ëë§ ìë ì¤í¬ë¡¤ ì²ë¦¬ 1053 if ((!atBottom && event.deltaY > 0) || (!atTop && event.deltaY < 0)) { 1054 // ë´ë¶ ììììë§ ì¤í¬ë¡¤ ì´ë 1055 focus_elem.scrollBy({ 1056 top: event.deltaY, // ì¤í¬ë¡¤ ë°©í¥ì ë°ë¼ ì´ë 1057 behavior: 'auto' // ë¶ëë¬ì´ ì¤í¬ë¡¤ í¨ê³¼ ì ì© ê°ë¥, íìì 'smooth'ë¡ ë³ê²½ ê°ë¥ 1058 }); 1059 1060 // focus_elemì í¬ì»¤ì¤ ì¤ì 1061 focus_elem.focus(); 1062 } else { 1063 // ë´ë¶ìì ë ì´ì ì¤í¬ë¡¤ì´ ì§íëì§ ìì¼ë©´ elem ìììì ì¤í¬ë¡¤ì ì²ë¦¬ 1064 if(isELVIEW) elem = document.querySelector('.elviewwrap'); 1065 elem.scrollBy({ 1066 top: event.deltaY, 1067 behavior: 'auto' 1068 }); 1069 } 1070 } 1071 }, { passive: false, capture: true }); 1072 1073});
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.