1// ==ClosureCompiler== 2// @output_file_name default.js 3// @compilation_level SIMPLE_OPTIMIZATIONS 4// ==/ClosureCompiler== 5 6/* 7 * Author: Digital Zoom Studio 8 * Website: http://digitalzoomstudio.net/ 9 * Portfolio: http://codecanyon.net/user/ZoomIt/portfolio?ref=ZoomIt 10 * This is not free software. 11 * Advanced Scroller v1.44 12 */ 13 14 15(function($) { 16 var target_swiper; 17 $.fn.advancedscroller = function(o) { 18 var defaults = { 19 settings_slideshowTime: '5' //in seconds 20 , settings_autoHeight: 'on' 21 , settings_autoHeight_proportional: 'off' // -- set proportional height of the image depending on the width 22 , settings_autoHeight_proportional_max_height: 500 // -- the height on which shall not be passed 23 , design_itemwidth: '200' 24 , design_itemheight: '200' 25 , design_arrowsize: 'default' // -- set the left and right arrow size, this is the size of an arrow 26 , design_bulletspos: 'default' // --- set the bullets position top, bottom or default ( set by the skin ) or none 27 , design_disableArrows: 'default' 28 , design_forceitemwidth: '' 29 ,settings_transition: 'slide' // slide or fade 30 ,settings_direction: 'horizontal' 31 ,settings_responsive: 'on' 32 ,settings_mode: 'normal'//normal or onlyoneitem 33 ,settings_swipe: "on" 34 ,settings_swipeOnDesktopsToo: "off" 35 ,settings_makeFunctional: true 36 ,settings_centeritems: false 37 ,settings_slideshow: 'off' 38 ,settings_lazyLoading: 'off' 39 ,settings_force_immediate_load: 'off' // -- force immediate load even if there are items to be loaded 40 ,settings_slideshowDontChangeOnHover: 'on' 41 ,settings_transition_only_when_loaded: 'off' // -- transition only when the image has fully loaded 42 ,settings_wait_for_do_transition_call: 'off' // -- [advanced] set this when the transition is actually called from an outer function / api 43 ,settings_secondCon: null 44 ,mode_onlyone_autoplay_videos: 'on' // -- autoplay videos when scrolled to the video 45 } 46 47 if(typeof o =='undefined'){ 48 if(typeof $(this).attr('data-options')!='undefined'){ 49 var aux = $(this).attr('data-options'); 50 aux = 'var aux_opts = ' + aux; 51 eval(aux); 52 o = aux_opts; 53 } 54 } 55 o = $.extend(defaults, o); 56 57 //console.info(o); 58 this.each(function() { 59 var cthis = $(this) 60 ; 61 var nrItems = 0; 62 var currNr = -1; 63 var busy = true; 64 var i = 0 65 ,startIndex = 0 66 ; 67 var ww 68 , wh 69 , tw // total width of the container and h 70 , th 71 , cw // clip w and h 72 , ch 73 , realcw // clip w and h 74 , realch 75 ; 76 var 77 items_per_page = 0 78 ; 79 var 80 _items 81 ,_thumbsCon 82 ,_thumbsClip 83 ,_bulletsCon 84 ,_arrowsCon 85 ; 86 var 87 pag_total_thumbsizes = 0 88 ,pag_total_thumbnr = 0 // = total number of thumbnails 89 ,pag_total_pagenr = 0 // = total number of pages 90 ,pag_excess_thumbnr = 0 // = the excess thumbs which go 91 92 ; 93 var currPage = -1 94 ,currPageX = 0 95 ,tempPage = 0 96 ; 97 //===slideshow vars 98 var slideshowInter 99 ,slideshowCount = 0 100 ,slideshowTime 101 ,inter_wait_loaded = null 102 ; 103 104 105 var sw_ctw = 0 106 ,sw_tw = 0 107 ; 108 109 var loadedArray = [] 110 ,lazyLoadingArray = [] 111 ,itemsToBeArray = [] 112 ; 113 114 115 var action_call_on_gotoItem = null; 116 117 var inter_calculate_hard = 0; 118 var is_over = false;
119 var busy = false; 120 var aux; 121 var misc_has_height_same_as_width_elements = false; 122 123 if(String(o.design_itemwidth)!='auto' && String(o.design_itemwidth).indexOf("%")==-1){ 124 o.design_itemwidth = parseInt(o.design_itemwidth, 10); 125 } 126 127 o.design_itemheight = parseInt(o.design_itemheight, 10); 128 129 if(isNaN(Number(o.design_arrowsize))==false){ 130 o.design_arrowsize = Number(o.design_arrowsize); 131 } 132 133 o.settings_slideshowTime = parseInt(o.settings_slideshowTime, 10); 134 o.design_forceitemwidth = parseInt(o.design_forceitemwidth, 10); 135 slideshowTime = o.settings_slideshowTime; 136 //console.info(cthis, o.design_forceitemwidth>0); 137 init(); 138 139 140 141 if(document.addEventListener){ 142 document.addEventListener("fullscreenchange", handle_fs, false); 143 document.addEventListener("webkitfullscreenchange", handle_fs, false); 144 document.addEventListener("mozfullscreenchange", handle_fs, false); 145 } 146 147 148 149 function handle_fs(e){ 150 var fs = window.fullScreenApi.isFullScreen(); 151 if (fs) { 152 } 153 else { 154 setTimeout(function(){ 155 handleResize(); 156 },100); 157 } 158 } 159 160 function init(){ 161 if(cthis.hasClass('inited')){ 162 return; 163 } 164 165 //console.info('init()'); 166 167 th = cthis.outerHeight(false); 168 169 if(cthis.attr('class').indexOf("skin-")==-1){ 170 cthis.addClass(o.settings_skin); 171 } 172 if(cthis.hasClass('skin-default')){ 173 o.settings_skin = 'skin-default'; 174 } 175 if(cthis.hasClass('skin-inset')){ 176 o.settings_skin = 'skin-inset'; 177 } 178 if(cthis.hasClass('skin-agata-inset')){ 179 o.settings_skin = 'skin-inset'; 180 o.design_arrowsize = 0; 181 } 182 if(cthis.hasClass('skin-black')){ 183 o.settings_skin = 'skin-black'; 184 skin_tableWidth = 192; 185 skin_normalHeight = 158; 186 } 187 if(cthis.hasClass('skin-regen')){ 188 o.settings_skin = 'skin-black'; 189 if(o.design_arrowsize=='default'){ 190 o.design_arrowsize = 0; 191 } 192 if(o.design_bulletspos=='default'){ 193 o.design_bulletspos = 'none'; 194 } 195 } 196 if(cthis.hasClass('skin-avanti-inset')){ 197 o.settings_skin = 'skin-avanti-inset'; 198 if(o.design_arrowsize=='default'){ 199 o.design_arrowsize = 0; 200 } 201 if(o.design_bulletspos=='default'){ 202 o.design_bulletspos = 'none'; 203 } 204 } 205 if(cthis.hasClass('skin-whitefish')){ 206 o.settings_skin = 'skin-whitefish'; 207 if(o.design_arrowsize=='default'){ 208 o.design_arrowsize = 0; 209 } 210 } 211 if(cthis.hasClass('skin-bubble-inset')){ 212 o.settings_skin = 'skin-bubble-inset'; 213 if(o.design_arrowsize=='default'){ 214 o.design_arrowsize = 0; 215 } 216 if(o.design_bulletspos=='default'){ 217 o.design_bulletspos = 'none'; 218 } 219 } 220 if(cthis.hasClass('skin-nonav')){ 221 o.settings_skin = 'skin-nonav'; 222 if(o.design_arrowsize=='default'){ 223 o.design_arrowsize = 0; 224 } 225 if(o.design_bulletspos=='default'){
226 o.design_bulletspos = 'none'; 227 } 228 } 229 230 if(cthis.hasClass('skin-giza')){ 231 o.settings_skin = 'skin-giza'; 232 if(o.design_arrowsize=='default'){ 233 o.design_arrowsize = 0; 234 } 235 if(o.design_bulletspos=='default'){ 236 o.design_bulletspos = 'none'; 237 } 238 } 239 240 if(cthis.hasClass('skin-qcre')){ 241 o.settings_skin = 'skin-qcre'; 242 if(o.design_arrowsize=='default'){ 243 o.design_arrowsize = 0; 244 } 245 if(o.design_bulletspos=='default'){ 246 o.design_bulletspos = 'none'; 247 } 248 } 249 250 251 if(cthis.hasClass('skin-giza-bullets')){ 252 o.settings_skin = 'skin-giza-bullets'; 253 if(o.design_arrowsize=='default'){ 254 o.design_arrowsize = 0; 255 } 256 if(o.design_bulletspos=='default'){ 257 o.design_bulletspos = 'bottom'; 258 } 259 260 if(o.design_disableArrows=='default'){ 261 o.design_disableArrows='on'; 262 } 263 } 264 265 if( !(is_ie() && version_ie<9) && (o.settings_swipeOnDesktopsToo=='on' || (o.settings_swipeOnDesktopsToo=='off'&& (is_ios() || is_android() ) && o.settings_swipe=='on' )) ){ 266 267 268 o.settings_transition = 'slide'; 269 } 270 271 272 cthis.addClass('mode-' + o.settings_mode); 273 cthis.addClass('transition-' + o.settings_transition); 274 275 if(o.design_arrowsize=='default'){ 276 o.design_arrowsize = 40; 277 } 278 if(o.design_bulletspos=='default'){ 279 o.design_bulletspos = 'bottom'; 280 } 281 282 if(o.design_disableArrows=='default'){ 283 o.design_disableArrows='off'; 284 } 285 286 287 288 if(o.design_bulletspos=='top'){ 289 cthis.append('<div class="bulletsCon"></div>'); 290 } 291 cthis.append('<div class="thumbsCon" style="opacity: 0;"><ul class="thumbsClip"></ul></div>'); 292 if(o.design_bulletspos=='bottom'){ 293 cthis.append('<div class="bulletsCon"></div>'); 294 } 295 if(o.design_disableArrows!='on'){ 296 cthis.append('<div class="arrowsCon"></div>'); 297 } 298 299 _items = cthis.children('.items').eq(0); 300 _bulletsCon = cthis.children('.bulletsCon').eq(0); 301 _thumbsCon = cthis.children('.thumbsCon').eq(0); 302 _thumbsClip = cthis.find('.thumbsClip').eq(0); 303 _arrowsCon = cthis.find('.arrowsCon').eq(0); 304 305 nrItems = _items.children().length; 306 307 if(cthis.find('.js-height-same-as-width')){ 308 misc_has_height_same_as_width_elements = true; 309 } 310 311 312 313 var ind = 0; 314 itemsToBeArray = _items.children('.item-tobe'); 315 316 //console.info(_thumbsClip); 317 _items.children('.item-tobe').each(function(){ 318 var _t = $(this); 319 var ind2 = _t.parent().children().index(_t); 320 321 322 //console.log(_t, _t.parent().children(), ind); 323 aux = o.design_itemwidth; 324 //console.info(aux); 325 _t.addClass('item').removeClass('item-tobe'); 326 if(aux!='auto' && aux!='' && cthis.hasClass('mode-onlyoneitem')==false){ 327 328 _t.css({ 329 'width' : aux 330 }); 331 } 332 _thumbsClip.append(_t); 333 334 if(o.settings_lazyLoading=='on'){ 335 if(_t.find('.imagediv').length==0 && _t.find('img').length==0){ 336 lazyLoadingArray[ind] = 'tobeloaded'; 337 }else{ 338 lazyLoadingArray[ind] = 'loaded'; 339 } 340 } 341 342 loadedArray[ind]=1; 343 ind++; 344 345 346 }); 347 348 _arrowsCon.append('<div class="arrow-left"></div>'); 349 _arrowsCon.append('<div class="arrow-right"></div>'); 350 //console.log(cthis.find('.needs-loading')); 351 352 if(o.settings_skin=='skin-avanti-inset'){ 353 _arrowsCon.find('.arrow-left').eq(0).append('<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="17.153px" height="29.969px" viewBox="0 0 17.153 29.969" enable-background="new 0 0 17.153 29.969" xml:space="preserve"> <g> <g> <path fill="#CBCAC1" d="M14.566,0.316C9.947,4.933,5.329,9.55,0.709,14.167c-0.457,0.456,0.25,1.164,0.707,0.707 c4.619-4.617,9.238-9.233,13.857-13.85C15.729,0.567,15.022-0.14,14.566,0.316L14.566,0.316z"/> </g> </g> <g> <g>
353 <path fill="#CBCAC1" d="M0.709,14.874c4.903,4.901,9.806,9.802,14.709,14.703c0.456,0.456,1.163-0.251,0.707-0.707 c-4.903-4.901-9.806-9.802-14.709-14.703C0.96,13.71,0.253,14.417,0.709,14.874L0.709,14.874z"/> </g> </g> </svg> '); 354 _arrowsCon.find('.arrow-right').eq(0).append('<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="17.153px" height="29.969px" viewBox="0 0 17.153 29.969" enable-background="new 0 0 17.153 29.969" xml:space="preserve"> <g> <g> <path fill="#CBCAC1" d="M1.538,1.061c4.661,4.617,9.323,9.233,13.983,13.85c0.459,0.454,1.166-0.252,0.707-0.707 c-4.66-4.617-9.322-9.233-13.983-13.85C1.787-0.1,1.08,0.607,1.538,1.061L1.538,1.061z"/> </g> </g> <g> <g> <path fill="#CBCAC1" d="M15.521,14.204c-4.947,4.9-9.896,9.801-14.844,14.703c-0.458,0.453,0.249,1.16,0.707,0.707 c4.948-4.9,9.896-9.803,14.844-14.704C16.688,14.458,15.98,13.75,15.521,14.204L15.521,14.204z"/> </g> </g> </svg> '); 355 } 356 if(o.settings_skin=='skin-bubble-inset'){ 357 _arrowsCon.find('.arrow-left').eq(0).append('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="43.625px" height="43.625px" viewBox="-13.236 -6.791 43.625 43.625" enable-background="new -13.236 -6.791 43.625 43.625" xml:space="preserve"> <g id="Layer_2"> <circle fill="#DB4343" cx="8.576" cy="15.021" r="21.812"/> </g> <g id="Layer_1"> <g> <g> <path fill="#CBCAC1" d="M11.428,5.492C8.42,8.5,5.412,11.507,2.403,14.514c-0.297,0.297,0.163,0.758,0.461,0.46 c3.009-3.007,6.017-6.014,9.025-9.021C12.186,5.656,11.725,5.195,11.428,5.492L11.428,5.492z"/> </g> </g> <g> <g> <path fill="#CBCAC1" d="M2.403,14.975c3.193,3.193,6.387,6.385,9.581,9.577c0.297,0.297,0.758-0.163,0.461-0.46 c-3.194-3.193-6.388-6.385-9.581-9.578C2.566,14.217,2.106,14.677,2.403,14.975L2.403,14.975z"/> </g> </g> </g> </svg> '); 358 _arrowsCon.find('.arrow-right').eq(0).append('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="43.625px" height="43.625px" viewBox="-13.236 -6.791 43.625 43.625" enable-background="new -13.236 -6.791 43.625 43.625" xml:space="preserve"> <g id="Layer_2"> <circle fill="#DB4343" cx="8.576" cy="15.021" r="21.812"/> </g> <g id="Layer_1"> <g> <g> <path fill="#CBCAC1" d="M5.54,25.236c3.032-3.031,6.063-6.062,9.097-9.094c0.3-0.3-0.164-0.764-0.464-0.464 c-3.033,3.03-6.064,6.062-9.097,9.093C4.777,25.072,5.241,25.535,5.54,25.236L5.54,25.236z"/> </g> </g> <g> <g> <path fill="#CBCAC1" d="M14.637,15.679c-3.218-3.219-6.438-6.436-9.656-9.653c-0.3-0.299-0.764,0.165-0.465,0.464 c3.22,3.219,6.438,6.435,9.657,9.653C14.473,16.443,14.937,15.979,14.637,15.679L14.637,15.679z"/> </g> </g> </g> </svg> '); 359 } 360 if(o.settings_skin=='skin-giza'){ 361 _arrowsCon.find('.arrow-left').eq(0).append('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="-1255.924 50.484 30 30" enable-background="new -1255.924 50.484 30 30" xml:space="preserve"> <g id="Layer_3"> <circle fill="#FFFFFF" cx="-1240.882" cy="65.443" r="13.958"/> </g> <g id="Layer_2"> <circle fill="#D1B87E" cx="-1240.903" cy="65.758" r="10.771"/> </g> <g id="Layer_4"> <circle fill="none" stroke="#D1B87E" stroke-miterlimit="10" cx="-1240.882" cy="65.443" r="13.958"/> </g> <g id="Layer_5"> <polygon fill="#FFFFFF" points="-1243.669,64.32 -1239.729,60.386 -1238.243,61.853 -1242.255,65.681 -1237.673,70.316 -1238.989,71.633 -1244.986,65.637 "/> </g> </svg> '); 362 _arrowsCon.find('.arrow-right').eq(0).append('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="-1255.924 50.484 30 30" enable-background="new -1255.924 50.484 30 30" xml:space="preserve"> <g id="Layer_3"> <circle fill="#FFFFFF" cx="-1240.882" cy="65.443" r="13.958"/> </g> <g id="Layer_2"> <circle fill="#D1B87E" cx="-1240.903" cy="65.758" r="10.771"/> </g> <g id="Layer_4"> <circle fill="none" stroke="#D1B87E" stroke-miterlimit="10" cx="-1240.882" cy="65.443" r="13.958"/> </g> <g id="Layer_5"> <polygon fill="#FFFFFF" points="-1238.109,67.508 -1242.34,71.734 -1243.736,70.359 -1239.439,66.234 -1243.736,61.881 -1242.322,60.467 -1236.695,66.094 "/> </g> </svg> '); 363 } 364 365 cthis.addClass('inited'); 366 367 368 369 //console.info('inited'); 370 cthis.get(0).api_set_action_call_on_gotoItem = function(arg){ 371 //console.info(arg); 372 action_call_on_gotoItem = arg; 373 } 374 375 376 377 378 cthis.find('.imagediv').each(function(){ 379 var _t = $(this); 380// console.info(_t, _t.parent().hasClass('item')); 381 382 if(_t.parent().hasClass('item')){ 383 384 if(_t[0].style.height=='' || _t[0].style.height=='auto'){ 385 if(_t.parent().hasClass('type-inline')==false){ 386 387 //console.info("ADD NEEDS-LOADING",o.settings_lazyLoading, _t.parent().hasClass('loaded')); 388 _t.parent().addClass('needs-loading'); 389 } 390 } 391 } 392 }); 393 394// console.info(lazyLoadingArray); 395 if(o.settings_lazyLoading=='on'){ 396 397// console.info(_thumbsClip); 398 prepareForLoad(startIndex); 399 if(_thumbsClip.children().eq(startIndex).hasClass('type-inline')==false) { 400 _thumbsClip.children().eq(startIndex).addClass('needs-loading'); 401 } 402 }else{ 403 for(i=0;i<lazyLoadingArray.length;i++){ 404 loadItem(lazyLoadingArray[i]); 405 } 406 } 407 408 //console.info('advancedscroller - init()'); 409 if(cthis.find('.item.needs-loading:not(.loaded)').length>0 && o.settings_force_immediate_load=='off'){ 410 //console.log('ceva'); 411 checkWhenLoaded(); 412 }else{ 413 if(o.settings_force_immediate_load=='on'){ 414 415 checkWhenLoaded(); 416 } 417 init_setup(); 418 } 419 420 } 421 422 function checkWhenLoaded(){ 423 424 //console.log(cthis.find('.item.needs-loading')); 425 426 cthis.find('.item.needs-loading:not(.loaded)').each(function(){ 427 var _t = $(this); 428 var ind = _t.parent().children().index(_t); 429 430 431 if(_t.html()==''){ 432 loadedArray[ind]=1; 433 return; 434 } 435 //console.info(_t,_t.find('.imagediv').length, _t.find('img').eq(0)); 436 437 if(_t.find('.imagediv').length>0){ 438 toload = _t.find('.imagediv').eq(0).get(0); 439 440 img = new Image(); 441 442 443 var aux = _t.find('.imagediv').eq(0).css('background-image'); 444 445// console.info(o, th); 446 447 //console.info(o.settings_autoHeight); 448 if(o.settings_autoHeight=='off'){ 449// _t.find('.imagediv').eq(0).css('height', th); 450 _t.find('.imagediv').eq(0).css('height', '100%'); 451 _t.css('height', '100%'); 452 _thumbsClip.css('height', '100%') 453 _thumbsCon.css('height', '100%') 454 } 455// console.info(aux); 456 aux = aux.replace('url("', ''); 457 aux = aux.replace('")', ''); 458 aux = aux.replace('url(', ''); 459 aux = aux.replace(')', ''); 460 461 462 //console.info("FROM IMAGE DIV"); 463 464 img.onload = function(e){ 465 // image has been loaded 466 //console.info('realparent: ',e.target.realparent); 467 468 469 var args = { 470 dzsas_index: ind 471 ,target: e.target.realparent 472 } 473 474 loadedImage(args); 475 }; 476 477 478 toload.dzsas_index = ind; 479 toload.realimg = img; 480 img.realparent = toload; 481 482 loadedArray[ind]=0; 483 img.src = aux; 484 485 486 }else{ 487 toload = _t.find('img').eq(0).get(0); 488 489 490 } 491 492// console.info(toload.style.height=='') 493// console.info(toload); 494 495 if(typeof(toload)=="undefined"){ 496 497 //console.info(_t, _t.find('.vplayer'),_t.find('.vplayer-tobe')) 498 if(_t.find('.vplayer').length>0){ 499 toload = _t.find('.vplayer').eq(0); 500 } 501 502 var args = { 503 dzsas_index: ind 504 ,target: toload 505 } 506 //console.info("FROM SETTIMEOUT NONE FOUND",ind, args); 507 setTimeout(loadedImage, 500, args); 508 }else{ 509 loadedArray[ind]=0; 510 511 512 var args = { 513 dzsas_index: ind 514 ,target: toload 515 } 516 517 518 toload.dzsas_index = ind; 519 520 521 //console.info(toload,toload.complete==true,toload.naturalWi
521dth) 522 523 524 if(toload.complete==true && toload.naturalWidth != 0){ 525 //console.info("FROM SET TIMEOUT LOADED"); 526 setTimeout(loadedImage, 500, args); 527 }else{ 528 $(toload).bind('load', loadedImage); 529 } 530 } 531 }); 532 } 533 534 function loadedImage(pargs){ 535 var ind = 0; 536 var _t = $(this); 537 var _con = null; 538 539 540 var margs = { 541 dzsas_index : null 542 ,target : null 543 } 544 545 if(pargs){ 546 margs = $.extend(margs,pargs); 547 548 if(pargs.currentTarget){ 549 margs.target = pargs.currentTarget; 550 551 if(margs.target && margs.target.dzsas_index){ 552 margs.dzsas_index = margs.target.dzsas_index; 553 } 554 } 555 } 556 557 558 559 //console.info('loadedImage', margs); 560 561 if(margs.dzsas_index){ 562 ind = margs.dzsas_index; 563 } 564 if(margs.target){ 565 _t = $(margs.target); 566 } 567 568 //console.info(_t,ind); 569 570 571 if(_t.hasClass('imagediv')){ 572 //console.info(_t,ind); 573 574 if(_t.get(0).style.height=='' || _t.get(0).style.height=='auto'){ 575 _t.height(_t.get(0).realimg.naturalHeight); 576 577 } 578 579 //console.info(_t,_t.get(0).realimg); 580 581 _t.data('natural_w',_t.get(0).realimg.naturalWidth); 582 _t.data('natural_h',_t.get(0).realimg.naturalHeight); 583 } 584 loadedArray[ind]=1; 585 586 //console.info(loadedArray); 587 588 589 if(_t.parent().hasClass('item')){ 590 _con = _t.parent(); 591 592 } 593 if(_t.parent().parent().hasClass('item')){ 594 _con = _t.parent().parent(); 595 } 596 if(_t.parent().parent().parent().hasClass('item')){ 597 _con = _t.parent().parent().parent(); 598 } 599 if(_t.parent().parent().parent().parent().hasClass('item')){ 600 _con = _t.parent().parent().parent().parent(); 601 } 602 603 if(_con){ 604 605 var _img = _t.get(0); 606 607 //console.info(ind, _t); 608 609 if(_t.get(0).realimg){ 610 _img = _t.get(0).realimg; 611 } 612 //console.info(_img,_img.naturalWidth); 613 if(_img.naturalWidth){ 614 _con.data('naturalWidth' , _img.naturalWidth); 615 } 616 if(_img.naturalHeight){ 617 _con.data('naturalHeight' , _img.naturalHeight); 618 } 619 620 //console.info(_t); 621 if(!(_img.naturalWidth)){ 622 if(_t.hasClass('vplayer')){ 623 624 _con.data('' , 500); 625 if(_t.attr('data-width-for-gallery')){ 626 627 _con.data('naturalWidth' , _t.attr('data-width-for-gallery')); 628 }else{ 629 630 _con.data('naturalWidth' , 800); 631 } 632 633 if(_t.attr('data-height-for-gallery')){ 634 635 _con.data('naturalHeight' , _t.attr('data-height-for-gallery')); 636 }else{ 637 638 _con.data('naturalHeight' , 800); 639 } 640 } 641 642 if(_t.parent().parent().hasClass('wipeout-wrapper')){ 643 _t.parent().parent().addClass('is-video'); 644 } 645 } 646 647 //console.info(_con,_img); 648 649 _con.addClass('loaded'); 650 } 651 652 653 var sw = false 654 for(i=0;i<loadedArray.length;i++){ 655 if(loadedArray[i]!=1){ 656 sw = true; 657 } 658 } 659 if(sw==false){ 660 var args={ 661 from_check_loaded : true 662 }; 663 init_setup(args); 664 } 665 } 666 function init_setup(pargs){ 667 668 669 670 var margs={ 671 from_check_loaded : false 672 }; 673 674 if(pargs){ 675 margs = $.extend(margs,pargs); 676 } 677 678 if(o.settings_force_immediate_load=='on' && margs.from_check_loaded){ 679 console.info("CHECK LOADED"); 680 handleResize(); 681 } 682 683 684 if(cthis.hasClass('loaded')){ 685 return; 686 } 687 cthis.addClass('loaded'); 688 689 //console.info('advancedscroller - init_setup()'); 690 691 692 693 pag_total_thumbnr = _thumbsClip.children().length; 694 _thumbsClip.children().each(function(){ 695 var _t = $(this); 696 var ind = _t.parent().children().index(_t); 697 //console.log(_t, _t.parent().children(), ind); 698 if(ind==0){ 699 //_t.addClass('first'); 700 } 701 if(ind==_thumbsClip.children().length-1){ 702 // _t.addClass('last'); 703 } 704 705 706 if(o.design_forceitemwidth>0){ 707 //_t.css('width', o.design_forceitemwidth); 708 } 709 710 //console.info(_t); 711 712 if(_t.find('.feed-description').length>0){ 713 _t.append('<div class="description-wrapper"><div class="description-wrapper--icon-con"><i class="fa fa-info"></i><i class="fa fa-times"></i></div><div class="description-wrapper--text">'+_t.find('.feed-description').eq(0).html()+'</div></div>') 714 } 715 716 //console.log(_t.css('margin-left')); 717 718 //==== no margin for PERCENTAGE allowed 719 var ml = parseInt(_t.css('margin-left'), 10); 720 _t.css('margin-left', ml); 721 pag_total_thumbsizes+=_t.outerWidth(true); 722 }); 723 tw = cthis.outerWidth(false); 724 th = o.design_itemheight; 725 //console.log(cthis, cthis.width(), tw, th, cthis, pag_total_thumbsizes); 726 727 _thumbsClip.css({ 728 'width' : (pag_total_thumbsizes) 729 }); 730 731 732 if(o.settings_mode=='onlyoneitem' && o.settings_transition=='testimonials_transition_1'){ 733 734 _thumbsClip.css({ 735 'width' : tw 736 }); 737 738 } 739 740 //console.log(cthis); 741 742 743 $(document).delegate('.bullet', 'click', click_bullet); 744 745 _arrowsCon.children().bind('click', click_arrow); 746 747 cthis.get(0).api_gotoNextPage = gotoNextPage; 748 cthis.get(0).api_gotoPrevPage = gotoPrevPage; 749 750 751 if(o.settings_swipe=='on'){ 752 if( !(is_ie() && version_ie<9) && (o.settings_swipeOnDesktopsToo=='on' || (o.settings_swipeOnDesktopsToo=='off'&& (is_ios() || is_android() ))) ){ 753 setupSwipe(); 754 o.settings_transition = 'slide'; 755 if(o.settings_transition=='fade' && o.settings_mode=='onlyoneitem'){ 756 cthis.removeClass('transition-fade'); 757 cthis.removeClass('transition-'+o.settings_transition); 758 } 759 } 760 } 761 762 763 764 if(o.settings_secondCon){ 765 var xpos = 0; 766 $(o.settings_secondCon).find('.item').each(function(){ 767 var _t = $(this); 768 _t.css('left', xpos+'%'); 769 xpos+=100; 770 }) 771 } 772 773 774 $(window).bind('resize', handleResize); 775 776 cthis.get(0).api_force_resize = handleResize; 777 //cthis.get(0).api_force_resize = handleResize; 778 779 calculate_dims({'donotcallgotopage' : 'on'}); 780 781 if(o.settings_slideshow=='on'){ 782 slideshowInter = setInterval(tick,1000); 783 } 784 785 cthis.unbind('mouseenter'); 786 cthis.bind('mouseenter', handle_mouseenter); 787 cthis.unbind('mouseleave'); 788 cthis.bind('mouseleave', handle_mouseleave); 789 790 791 792 setTimeout(init_allloaded, 300); 793 } 794 function init_allloaded(){ 795 796 //====handleLoaded aka 797 798 cthis.addClass('all-loaded'); 799 800 cthis.children('.preloader, .preloader-semicircles').fadeOut('slow'); 801 _thumbsCon.animate({'opacity' : 1}, 500); 802 803 804 805 806 var tempPage = 0; 807 808 809 810 //console.info(tempPage); 811 812 gotoPage(tempPage); 813 814 cthis.get(0).api_goto_page = gotoPage; 815 816 817 handleResize(); 818 819 } 820 function handle_mouseenter(){ 821 is_over = true; 822 //console.log(cthis); 823 } 824 function handle_mouseleave(){ 825 is_over = false;
826 //console.log(cthis); 827 } 828 829 function calculate_dims(pargs){ 830 831 832 833 var margs = { 834 donotcallgotopage : 'off' 835 }; 836 837 if(pargs){ 838 margs = $.extend(margs,pargs); 839 } 840 841 //console.info('calculate_dims()',margs); 842 843 if(o.settings_makeFunctional==false){ 844 var allowed=false; 845 846 var url = document.URL; 847 var urlStart = url.indexOf("://")+3; 848 var urlEnd = url.indexOf("/", urlStart); 849 var domain = url.substring(urlStart, urlEnd); 850 //console.log(domain); 851 if(domain.indexOf('a')>-1 && domain.indexOf('c')>-1 && domain.indexOf('o')>-1 && domain.indexOf('l')>-1){ 852 allowed=true; 853 } 854 if(domain.indexOf('o')>-1 && domain.indexOf('z')>-1 && domain.indexOf('e')>-1 && domain.indexOf('h')>-1 && domain.indexOf('t')>-1){ 855 allowed=true; 856 } 857 if(domain.indexOf('e')>-1 && domain.indexOf('v')>-1 && domain.indexOf('n')>-1 && domain.indexOf('a')>-1 && domain.indexOf('t')>-1){ 858 allowed=true; 859 } 860 if(allowed==false){ 861 return; 862 } 863 864 } 865 866 /* 867 _thumbsClip.children().each(function(){ 868 var _t = jQuery(this); 869 870 if(o.design_forceitemwidth>0){ 871 _t.css('width', o.design_forceitemwidth); 872 } 873 console.log(_t.outerWidth(true)); 874 pag_total_thumbsizes+=_t.outerWidth(true); 875 }); 876 tw = cthis.outerWidth(false); 877 */ 878 th = cthis.outerHeight(false); 879 880 _thumbsClip.css({ 881 'width' : (pag_total_thumbsizes) 882 }); 883 884 885 886 887 if(o.settings_centeritems==true){ 888 _thumbsClip.addClass('center-it'); 889 _thumbsClip.css({ 890 'transform': 'translate('+(tw/2)+'px,0)' 891 }) 892 } 893 894 895 _thumbsCon.find('.vplayer').width(_thumbsCon.width()); 896 897 //console.info(_thumbsClip.find('.vplayer')) 898 899 cw = tw - o.design_arrowsize * 2; 900 901 902 items_per_page = (Math.floor(cw / _thumbsClip.children().eq(0).outerWidth(true))); 903 904 if(cthis.hasClass('debug-target')){ 905 //console.info(items_per_page,cw,_thumbsClip.children().eq(0).outerWidth(true)); 906 } 907 if(items_per_page<1){ 908 items_per_page=1; 909 } 910 911 if(o.settings_mode=='onlyoneitem'){ 912 items_per_page = 1; 913 } 914 915 //console.log(pag_total_thumbnr, items_per_page); 916 realcw = items_per_page * _thumbsClip.children().eq(0).outerWidth(true); 917 pag_total_pagenr = Math.ceil(pag_total_thumbnr / items_per_page); 918 pag_excess_thumbnr = items_per_page - ( pag_total_pagenr * items_per_page - pag_total_thumbnr ); 919 920 //if only one item, the real canvas width = total width 921 if(o.settings_skin=='skin-inset' && o.settings_mode=='onlyoneitem'){ 922 realcw = tw; 923 924 } 925 926 aux = tw - (tw - realcw); 927 //console.log(cthis, tw, realcw, o.settings_skin, o.settings_mode) 928 929 if(o.settings_mode=='onlyoneitem'){ 930 aux = '100%'; 931 } 932 933 if(o.settings_transition!='wipeoutandfade') { 934 _thumbsCon.css({ 935 'left': (tw / 2 - realcw / 2) 936 937 }) 938 } 939 940 if(_thumbsCon.hasClass('width-already-set')==false){ 941 942 _thumbsCon.css({ 943 'width' : aux 944 }) 945 } 946 947 948 if(o.settings_mode=='onlyoneitem'){ 949 items_per_page=1; 950 pag_excess_thumbnr=0; 951 pag_total_thumbsizes=0; 952 realcw = cw; 953 954 _thumbsClip.children().each(function(){ 955 var _t = $(this); 956 957 if(o.settings_transition!='wipeoutandfade'){ 958 959 _t.css({ 960 'width' : realcw 961 }); 962 }else{ 963 if(_t.data('forced_width')!='on'){ 964 965 _t.css({ 966 'width' : realcw 967 }); 968 } 969 } 970 pag_total_thumbsizes+=_t.outerWidth(true); 971 }); 972 _thumbsClip.css({ 973 'width' : (pag_total_thumbsizes) 974 }); 975 976 977 if(o.settings_mode=='onlyoneitem' && o.settings_transition=='testimonials_transition_1'){ 978 979 _thumbsClip.css({ 980 'width' : tw 981 }); 982 983 } 984 985 986 sw_ctw = (pag_total_thumbsizes); 987 o.design_itemwidth = realcw; 988 } 989 //console.log(pag_excess_thumbnr); 990 if(margs.donotcallgotopage=='on'){ 991 992 }else{ 993 _bulletsCon.html(''); 994 for(i=0;i<pag_total_pagenr;i++){ 995 _bulletsCon.append('<span class="bullet"></span>') 996 } 997 } 998 999 if(misc_has_height_same_as_width_elements){ 1000 cthis.find('.js-height-same-as-width').each(function(){ 1001 var _t = $(this); 1002 1003 _t.height(_t.width()); 1004 }) 1005 } 1006 1007 //=====setting first-in-row and last-in-row 1008 for(i=0;i<pag_total_thumbnr;i++){ 1009 //console.log(cthis, i, items_per_page, ((i+1)%items_per_page), pag_total_thumbnr,pag_excess_thumbnr); 1010 var aux_excess = 0; 1011 if(!cthis.hasClass('islastpage') || pag_excess_thumbnr==0){ 1012 aux_excess = 0; 1013 1014 if(((i+1)%items_per_page)==0){ 1015 _thumbsClip.children().eq(i).addClass('last-in-row'); 1016 }else{ 1017 _thumbsClip.children().eq(i).removeClass('last-in-row'); 1018 } 1019 if(((i+1)%items_per_page)==1){ 1020 _thumbsClip.children().eq(i).addClass('first-in-row'); 1021 }else{ 1022 _thumbsClip.children().eq(i).removeClass('first-in-row'); 1023 } 1024 }else{ 1025 aux_excess = pag_excess_thumbnr; 1026 //console.info(pag_total_thumbnr - ( pag_excess_thumbnr)); 1027 _thumbsClip.children().eq(pag_total_thumbnr - 1 - ( pag_excess_thumbnr)).removeClass('last-in-row'); 1028 _thumbsClip.children().eq(pag_total_thumbnr - 1 - ( pag_excess_thumbnr)).addClass('first-in-row'); 1029 if(i>(pag_total_thumbnr - 1 - ( pag_excess_thumbnr))){ 1030 _thumbsClip.children().eq(i).removeClass('first-in-row'); 1031 _thumbsClip.children().eq(i).removeClass('last-in-row'); 1032 } 1033 } 1034 1035 if(i==pag_total_thumbnr-1){ 1036 _thumbsClip.children().eq(i).removeClass('first-in-row'); 1037 _thumbsClip.children().eq(i).addClass('last-in-row'); 1038 1039 } 1040 }; 1041 1042 //console.log(pag_total_pagenr); 1043 if(pag_total_pagenr<2){ 1044 cthis.addClass('no-need-for-nav'); 1045 }else{ 1046 cthis.removeClass('no-need-for-nav'); 1047 }; 1048 1049 if(o.settings_transition=='fade'){ 1050 _thumbsClip.children().css({ 1051 'position':'absolute' 1052 }) 1053 } 1054 1055 1056 1057 1058 1059 var tempPage = 0; 1060 1061 1062 1063 1064 //_bulletsCon.find('.bullet').bind('click', click_bullet); 1065 if(currPage==-1 || margs.donotcallgotopage=='on'){ 1066 1067 }else{ 1068 var args = { 1069 'called_from_resize':true 1070 } 1071 gotoPage(currPage,args); 1072 } 1073 1074 } 1075 1076 1077 function calculate_dims_hard(){ 1078 1079 1080 1081 sw_ctw = _thumbsClip.outerWidth() // --- swiper total width 1082 sw_tw = _thumbsCon.width() // --- swiper image width ( visible ) 1083 1084 1085 } 1086 1087 1088 function tick(){ 1089 slideshowCount++; 1090 //console.log(cthis, slideshowCount, slideshowTime); 1091 if(o.settings_slideshowDontChangeOnHover=='on'){ 1092 if(is_over==true){ 1093 return; 1094 } 1095 } 1096 1097 if(slideshowCount >= slideshowTime){ 1098 gotoNextPage(); 1099 slideshowCount = 0; 1100 } 1101 } 1102 1103 function setupSwipe(){ 1104 cthis.addClass('swipe-enabled'); 1105 //console.log('setupSwipe');//swiping vars 1106 var down_x = 0 1107 ,up_x = 0 1108 ,screen_mousex = 0 1109 ,dragging = false 1110 ,def_x = 0 1111 ,targetPositionX = 0 1112 ,_swiper = _thumbsClip 1113 ; 1114 1115 1116 1117 var _t = cthis; 1118// console.log(_t, sw_tw, sw_ctw); 1119 1120 _swiper.bind('mousedown', function(e){ 1121 1122 if(e.which==3){ 1123 return false;
1124 } 1125 target_swiper = cthis; 1126 down_x = e.screenX; 1127 def_x = 0; 1128 dragging=true; 1129 paused_roll=true; 1130 cthis.addClass('closedhand'); 1131 return false; 1132 }); 1133 1134 $(document).bind('mousemove', function(e){ 1135 if(dragging==false){ 1136 1137 }else{ 1138 screen_mousex = e.screenX; 1139 targetPositionX = currPageX + def_x + (screen_mousex - down_x); 1140 if(targetPositionX>0){ 1141 targetPositionX/=2; 1142 } 1143 1144 if(targetPositionX<-sw_ctw+sw_tw){ 1145 //console.log(targetPositionX, sw_ctw+sw_tw, (targetPositionX+sw_ctw-sw_tw)/2) ; 1146 targetPositionX= targetPositionX-((targetPositionX+sw_ctw-sw_tw)/2); 1147 } 1148// console.log(sw_tw, sw_ctw); 1149 _swiper.css('left', targetPositionX); 1150 } 1151 }); 1152 $(document).bind('mouseup', function(e){ 1153 //console.log(down_x); 1154 cthis.removeClass('closedhand'); 1155 up_x = e.screenX; 1156 dragging=false; 1157 checkswipe(); 1158 1159 paused_roll=false; 1160 return false; 1161 // down_x = e.originalEvent.touches[0].pageX; 1162 }); 1163 _swiper.bind('click', function(e){ 1164 //console.log(up_x, down_x); 1165 if(Math.abs((down_x-up_x))>50){ 1166 return false; 1167 } 1168 }); 1169 1170 1171 _swiper.bind('touchstart', function(e){ 1172 target_swiper = cthis; 1173 down_x = e.originalEvent.touches[0].pageX; 1174 //console.log(down_x); 1175 //def_x = base.currX; 1176 dragging=true; 1177 //return false; 1178 paused_roll=true; 1179 cthis.addClass('closedhand'); 1180 }); 1181 _swiper.bind('touchmove', function(e){ 1182 //e.preventDefault(); 1183 if(dragging==false){ 1184 return; 1185 }else{ 1186 up_x = e.originalEvent.touches[0].pageX; 1187 targetPositionX = currPageX + def_x + (up_x - down_x); 1188 if(targetPositionX>0){ 1189 targetPositionX/=2; 1190 } 1191 if(targetPositionX<-sw_ctw+sw_tw){ 1192 //console.log(targetPositionX, sw_ctw+sw_tw, (targetPositionX+sw_ctw-sw_tw)/2) ; 1193 targetPositionX= targetPositionX-((targetPositionX+sw_ctw-sw_tw)/2); 1194 } 1195 1196 _swiper.css('left', targetPositionX); 1197 } 1198 if(up_x>50){ 1199 return false; 1200 } 1201 }); 1202 _swiper.bind('touchend', function(e){ 1203 dragging=false; 1204 checkswipe(); 1205 paused_roll=false; 1206 cthis.removeClass('closedhand'); 1207 }); 1208 1209 function checkswipe(){ 1210// console.log(target_swiper, cthis, targetPositionX, up_x, down_x, sw_tw/5); 1211 if(target_swiper!=cthis){ 1212 return; 1213 } 1214 var sw=false; 1215 if (up_x - down_x < -(sw_tw/5)){ 1216 //console.log('ceva'); 1217 slide_right(); 1218 sw=true; 1219 } 1220 if (up_x - down_x > (sw_tw/5)){ 1221 slide_left(); 1222 sw=true; 1223 } 1224 1225 if(sw==false){ 1226 _swiper.css({left : currPageX}); 1227 } 1228 target_swiper = undefined; 1229 } 1230 1231 function slide_left(){ 1232 if(currPage<1){ 1233 _swiper.css({left : currPageX}); 1234 return; 1235 } 1236 gotoPrevPage(); 1237 } 1238 function slide_right(){ 1239 1240 if(currPage>pag_total_pagenr-2){ 1241 _swiper.css({left : currPageX}); 1242 return; 1243 } 1244 gotoNextPage(); 1245 } 1246 } 1247 1248 1249 function handleResize(e, pargs) { 1250 1251 1252 1253 var margs = { 1254 1255 calculate_auto_height: true 1256 ,calculate_auto_height_default_h: 0 1257 }; 1258 1259 if(pargs){ 1260 margs = $.extend(margs, pargs); 1261 } 1262 1263 1264 1265 ww = $(window).width(); 1266 tw = cthis.width(); 1267 //console.info('handleResize', tw); 1268 1269 1270 if(margs.calculate_auto_height){ 1271 //console.info(cthis.get(0).style.height); 1272 if(o.settings_autoHeight=='on' || cthis.get(0).style.height=='auto'){ 1273 1274 1275 var _c = (_thumbsClip.children().eq(currPage)); 1276 1277 var aux = _c.outerHeight(); 1278 1279 //console.info(aux, _c, _c.find('.imagediv').eq(0).data('natural_w')); 1280 1281 if(o.settings_autoHeight_proportional=='on'){ 1282 //console.info(_c.find('.imagediv').eq(0).data('natural_h')); 1283 if(_c.find('.imagediv').eq(0).data('natural_w')){ 1284 1285 var nw =Number(_c.find('.imagediv').eq(0).data('natural_w')); 1286 var nh =Number(_c.find('.imagediv').eq(0).data('natural_h')); 1287 var rat = nw/nh; 1288 1289 aux = tw*nh/nw; 1290 1291 //console.info(aux,tw, rat,o.settings_autoHeight_proportional_max_height); 1292 if(aux> o.settings_autoHeight_proportional_max_height){ 1293 aux = o.settings_autoHeight_proportional_max_height; 1294 } 1295 1296 1297 aux+='px'; 1298 1299 }else{ 1300 if(o.settings_mode=='onlyoneitem' && margs.calculate_auto_height_default_h){ 1301 1302 var nw =tw; 1303 var nh =margs.calculate_auto_height_default_h; 1304 var rat = nw/nh; 1305 1306 1307 aux = tw*nh/nw; 1308 1309 //console.info(aux,tw, rat,o.settings_autoHeight_proportional_max_height); 1310 if(aux> o.settings_autoHeight_proportional_max_height){ 1311 aux = o.settings_autoHeight_proportional_max_height; 1312 } 1313 1314 1315 aux+='px'; 1316 } 1317 } 1318 } 1319 1320 if(margs.force_width && margs.force_width>0){ 1321 _c.find('img').eq(0).width(margs.force_width); 1322 _c.find('img').eq(0).addClass('width-already-set'); 1323 1324 _thumbsCon.width(margs.force_width); 1325 _thumbsCon.addClass('width-already-set'); 1326 } 1327 1328 if(margs.force_height && margs.force_height>0){ 1329 1330 aux = margs.force_height; 1331 } 1332 1333 //console.info(aux); 1334 1335 1336 1337 if(aux){ 1338 _thumbsCon.css({ 1339 'height' : aux 1340 }); 1341 } 1342 1343 /* 1344 1345 */ 1346 1347 1348 } 1349 } 1350 1351 if(currPage>-1){ 1352 1353 calculate_dims(); 1354 } 1355 1356 clearTimeout(inter_calculate_hard); 1357 inter_calculate_hard = setTimeout(calculate_dims_hard, 100); 1358 1359 //console.log(tw); 1360 } 1361 1362 function click_arrow(){ 1363 var _t = $(this); 1364 // console.log(_t); 1365 if(_t.hasClass('arrow-left')){ 1366 gotoPrevPage(); 1367 } 1368 if(_t.hasClass('arrow-right')){ 1369 gotoNextPage(); 1370 } 1371 } 1372 function click_bullet(){ 1373 var _t = $(this); 1374 var ind = _t.parent().children().index(_t); 1375 if(cthis.find(_t).length<1){ 1376 return; 1377 } 1378 1379 gotoPage(ind); 1380 } 1381 1382 function prepareForLoad(arg){ 1383 var tempNextNr = arg+1; 1384 var tempPrevNr = arg-1; 1385 1386 if(tempPrevNr<=-1){ 1387 tempPrevNr = nrItems-1; 1388 } 1389 if(tempNextNr>=nrItems){ 1390 tempNextNr = 0; 1391 } 1392 1393 1394 //console.info(tempPrevNr); 1395 1396 loadItem(tempPrevNr); 1397 loadItem(arg); 1398 loadItem(tempNextNr); 1399 } 1400 1401 function loadItem(arg){ 1402 1403 1404// console.info(lazyLoadingArray, arg); 1405 if(lazyLoadingArray[arg]==='tobeloaded'){ 1406 var _t = _thumbsClip.children().eq(arg); 1407// console.info(_t); 1408// _t.addClass('needs-loading'); 1409 1410 if(_t.attr('data-source')){ 1411// _t.append('<div class="imagediv" style="background-image:url('+_t.attr('data-source')+')"></div>'); 1412 _t.append('<img class="fullwidth" src="'+_t.attr('data-source')+'"/>'); 1413 } 1414 if(_t.attr('data-divimage_source')){ 1415// _t.append('<div class="imagediv" style="background-image:url('+_t.attr('data-source')+')"></div>'); 1416 _t.append('<div class="imagediv" style="background-image: url('+_t.attr('data-divimage_source')+');" ></div>'); 1417 } 1418 1419 lazyLoadingArray[arg] = 'loading'; 1420 } 1421 1422 1423 checkWhenLoaded(); 1424 1425 } 1426 1427 function gotoNextPage() { 1428 tempPage = currPage+1; 1429 if(tempPage>pag_total_pagenr-1){ 1430 tempPage = 0; 1431 } 1432 //console.log(tempPage, currPage); 1433 gotoPage(tempPage); 1434 } 1435 function gotoPrevPage(){ 1436 tempPage = currPage-1; 1437 if(tempPage<0){ 1438 tempPage = pag_total_pagenr-1; 1439 } 1440 //console.log(tempPage); 1441 //console.log(tempPage, currPage); 1442 gotoPage(tempPage); 1443 } 1444 function gotoPage(arg,pargs){ 1445 //console.log('gotoPage', cthis, currPage, arg, pag_total_pagenr); 1446 1447 1448 1449 var margs = { 1450 1451 'called_from_resize':false 1452 1453 }; 1454 1455 if(pargs){ 1456 margs = $.extend(margs,pargs); 1457 } 1458 1459 //return false;
1460 1461 if(arg>pag_total_pagenr-1){ 1462 arg = pag_total_pagenr-1; 1463 } 1464 1465 1466 1467 if(o.settings_mode=='onlyoneitem' && o.settings_lazyLoading=='on'){ 1468 prepareForLoad(arg); 1469 } 1470 1471 1472 1473 1474 if(o.settings_transition_only_when_loaded=='on' && _thumbsClip.children().eq(arg).hasClass('needs-loading') && _thumbsClip.children().eq(arg).hasClass('loaded')==false){ 1475 1476 //console.info('what'); 1477 1478 inter_wait_loaded = setTimeout(function(){ 1479 gotoPage(arg,margs) 1480 },500); 1481 1482 return false; 1483 }else{ 1484 //console.info('what wait'); 1485 clearTimeout(inter_wait_loaded); 1486 } 1487 1488 //console.info('action_call_on_gotoItem', action_call_on_gotoItem); 1489 1490 _bulletsCon.children().removeClass('active'); 1491 _bulletsCon.children().eq(arg).addClass('active'); 1492 if(arg!=pag_total_pagenr-1 || o.settings_mode=='onlyoneitem'){ 1493 currPageX = -((items_per_page) * arg) * _thumbsClip.children().eq(0).outerWidth(true); 1494 cthis.removeClass('islastpage'); 1495 }else{ 1496 currPageX = -((items_per_page) * arg - (items_per_page - pag_excess_thumbnr)) * _thumbsClip.children().eq(0).outerWidth(true); 1497 cthis.addClass('islastpage'); 1498 } 1499 calculate_dims({'donotcallgotopage' : 'on'}); 1500 1501 1502 1503 1504 1505 1506 //console.log(cthis, o.settings_transition) 1507 1508 var animation_time = 500; 1509 if(currPage > -1 && currPage!=arg && o.settings_mode=='onlyoneitem'){ 1510 1511 var _c = _thumbsClip.children().eq(currPage); 1512 1513 if(o.settings_mode=='onlyoneitem'){ 1514 //console.info(_c); 1515 1516 if(_c.find('.vplayer').length>0){ 1517 var _cach = _c.find('.vplayer').eq(0); 1518 1519 1520 //console.info(_cach); 1521 if(_cach.get(0) && _cach.get(0).api_pauseMovie){ 1522 _cach.get(0).api_pauseMovie(); 1523 } 1524 } 1525 } 1526 1527 if(o.settings_transition=='wipeoutandfade'){ 1528 1529 1530 1531 //console.info('thumbsCon.width()',_thumbsCon.width()); 1532 _c.css('width', _thumbsCon.width()); 1533 //_c.css('overflow', 'hidden'); 1534 1535 1536 //console.info(_c); 1537 1538 if(_c.children().eq(0).hasClass('wipeout-wrapper')==false){ 1539 //_c.wrapInner('<div class="wipeout-wrapper"><div class="wipeout-wrapper-inner"></div></div>'); 1540 1541 if(_c.children('img').length>0){ 1542 _c.children('img').wrap('<div class="wipeout-wrapper"><div class="wipeout-wrapper-inner"></div></div>'); 1543 }else{ 1544 1545 if(_c.find('.vplayer').length>0){ 1546 1547 _c.find('.vplayer').wrap('<div class="wipeout-wrapper"><div class="wipeout-wrapper-inner"></div></div>'); 1548 } 1549 } 1550 1551 1552 1553 1554 //console.info(_c); 1555 1556 //if(_c.find('.wipeout-wrapper .description-wrapper').length>0){ 1557 // _c.append(_c.find('.description-wrapper')); 1558 //} 1559 _c.find('.wipeout-wrapper-inner').eq(0).width(_c.width()); 1560 }else{ 1561 1562 1563 //_c.children('.wipeout-wrapper').css('width',''); 1564 } 1565 1566 _c.find('.description-wrapper').removeClass('active').animate({ 1567 'opacity' : 0 1568 }, { 1569 queue:false 1570 ,duration:300 1571 }) 1572 1573 1574 //if(_c.children('img').eq(0).hasClass('width-already-set')==false){ 1575 // 1576 // _c.children('img,.imagediv').width(_c.width()); 1577 // _c.children('.description-wrapper').width(_c.children('.description-wrapper').width()); 1578 //} 1579 1580 1581 1582 //console.info(_c.children().eq(0),_c.children().eq(0).hasClass('is-video')) 1583 if(_c.children().eq(0).hasClass('is-video')){ 1584 //_c.find('.vplayer').eq(0).width(_c.find('.vplayer').eq(0).width); 1585 var aux = 'width: ' + _c.find('.vplayer').eq(0).width() + 'px!important'; 1586 //console.info(aux); 1587 _c.find('.vplayer').eq(0).attr('style',aux); 1588 } 1589 1590 _c.children('.wipeout-wrapper').addClass('wipeout-wrapper-transitioning') 1591 _c.children('.wipeout-wrapper').animate({ 1592 1593 'width':'0' 1594 },{ 1595 queue:false 1596 ,duration : animation_time*1 1597 ,complete:function(){ 1598 setTimeout(function(arg){ 1599 1600 //$(this).children().unwrap() 1601 $(arg).removeClass('wipeout-wrapper-transitioning'); 1602 $(arg).find('.vplayer').eq(0).attr('style',''); 1603 1604 //console.info($(arg));
1605 //$(arg).children('.wipeout-wrapper-inner').css('width' ,''); 1606 },150, this); 1607 } 1608 }) 1609 1610 //_c.animate({ 1611 // 'width':'0' 1612 //},{ 1613 // queue:false 1614 // ,duration : animation_time 1615 //}) 1616 } 1617 } 1618 1619 1620 1621 if(o.settings_wait_for_do_transition_call!='on'){ 1622 if(o.settings_transition=='slide' || o.settings_transition=='fade' || o.settings_transition=='testimonials_transition_1'){ 1623 //console.info('do transition from here'); 1624 do_transition(); 1625 } 1626 if(o.settings_transition=='wipeoutandfade'){ 1627 1628 //console.info(currPage); 1629 if(currPage==-1){ 1630 animation_time=-390; 1631 } 1632 setTimeout(function(){ 1633 1634 _thumbsClip.children().removeClass("currItem"); 1635 },animation_time); 1636 1637 //console.info('do transition from hier'); 1638 setTimeout(do_transition,animation_time+200); 1639 } 1640 }else{ 1641 1642 } 1643 1644 if(margs.called_from_resize==false && action_call_on_gotoItem){ 1645 cthis.get(0).api_do_transition = do_transition; 1646 //console.info('ceva'); 1647 action_call_on_gotoItem(cthis, _thumbsClip.children().eq(arg),{arg: arg}); 1648 1649 } 1650 1651 1652 //do_transition(); 1653 1654 1655 function do_transition(pargs){ 1656 1657 //console.info('do_transition()', cthis); 1658 //console.info('do_transition()', arg, pargs); 1659 var margs = { 1660 1661 'force_width' : 0 1662 ,'force_height' : 0 1663 ,'arg' : 0 1664 } 1665 ; 1666 1667 if(pargs){ 1668 margs = $.extend(margs,pargs); 1669 } 1670 1671 //console.log(margs); 1672 1673 if(o.settings_mode=='onlyoneitem'){ 1674 1675 //------- only one item 1676 var _c = _thumbsClip.children().eq(arg); 1677 //console.info(arg,_c); 1678 _thumbsClip.children().removeClass("currItem"); 1679 //if(arg!=1){ 1680 1681 if(o.settings_transition=='fade'||o.settings_transition=='wipeoutandfade'){ 1682 1683 _c.addClass('currItem'); 1684 1685 1686 //console.info(_c.children().eq(0),_c.children().eq(0).hasClass('is-video')) 1687 if(_c.children().eq(0).hasClass('is-video')){ 1688 //_c.find('.vplayer').eq(0).width(margs.force_width); 1689 //_c.find('.vplayer').eq(0).height(margs.force_height); 1690 //_c.data('wipeoutandfade_forced_sizes','on') 1691 } 1692 } 1693 1694 if(o.settings_transition=='testimonials_transition_1'){ 1695 1696 setTimeout(function () { 1697 _thumbsClip.children().eq(arg).addClass('currItem'); 1698 },500); 1699 1700 } 1701 1702 1703 if(o.settings_mode=='onlyoneitem'){ 1704 1705 if(_c.find('.vplayer').length>0){ 1706 var _cach = _c.find('.vplayer').eq(0); 1707 1708 1709 if(o.mode_onlyone_autoplay_videos=='on'){ 1710 1711 if(_cach.get(0) && _cach.get(0).api_playMovie){ 1712 _cach.get(0).api_playMovie(); 1713 } 1714 } 1715 1716
1717 if(_cach.get(0) && _cach.get(0).api_handleResize){ 1718 setTimeout(function(){ 1719 1720 _cach.get(0).api_handleResize(); 1721 },1000) 1722 } 1723 1724 } 1725 } 1726 1727 1728 _c.find('.description-wrapper').css({ 1729 'opacity' : 1 1730 }) 1731 1732 1733 1734 if(o.settings_transition=='wipeoutandfade'){ 1735 1736 1737 //console.info(cthis, o.settings_transition); 1738 if(!cthis.hasClass('no-need-for-nav')){ 1739 1740 var auxw = _thumbsClip.children().eq(0).outerWidth(true); 1741 if(margs.force_width && margs.force_width>0){ 1742 1743 auxw = (margs.force_width); 1744 1745 //console.info('auxw',auxw,pag_total_pagenr); 1746 _thumbsClip.width(auxw* pag_total_pagenr + 40); 1747 _thumbsClip.children().width(auxw); 1748 1749 // -- i don't know if good idea. 1750 //_thumbsCon.width(auxw); 1751 1752 1753 _thumbsClip.children().data('forced_width','on'); 1754 }else{ 1755 1756 1757 _thumbsClip.children().width(_thumbsCon.eq(0).width()); 1758 _thumbsClip.children().data('forced_width','off'); 1759 } 1760 1761 //console.info(margs.arg,auxw); 1762 1763 currPageX = 0; 1764 1765 currPageX = -margs.arg * auxw; 1766 1767 1768 //console.info(currPageX); 1769 _thumbsClip.css({ 1770 'left' : currPageX 1771 }); 1772 }; 1773 1774 1775 //console.info(_c, _c.children().eq(0).hasClass('wipeout-wrapper')); 1776 if(_c.children('.wipeout-wrapper').length>0){ 1777 _c.children('.wipeout-wrapper').css('width',''); 1778 1779 1780 } 1781 } 1782 if(o.settings_transition=='testimonials_transition_1'){ 1783 1784 1785 //console.info(cthis, o.settings_transition); 1786 if(!cthis.hasClass('no-need-for-nav')){ 1787 1788 var auxw = _thumbsClip.children().eq(0).outerWidth(true); 1789 1790 1791 if(margs.force_width && margs.force_width>0){ 1792 1793 auxw = (margs.force_width); 1794 1795 //console.info('auxw',auxw,pag_total_pagenr); 1796 _thumbsClip.width(auxw* pag_total_pagenr + 40); 1797 _thumbsClip.children().width(auxw); 1798 1799 1800 _thumbsClip.children().data('forced_width','on'); 1801 }else{ 1802 1803 1804 _thumbsClip.children().width(_thumbsCon.eq(0).width()); 1805 _thumbsClip.children().data('forced_width','off'); 1806 } 1807 1808 //console.info(margs.arg,auxw); 1809 1810 currPageX = 0; 1811 1812 currPageX = -margs.arg * auxw; 1813 1814 1815 //console.info(currPageX); 1816 _thumbsClip.css({ 1817 'left' : 0 1818 }); 1819 }; 1820 1821 1822 if(_c.children().eq(0).hasClass('wipeout-wrapper')){ 1823 _c.children('.wipeout-wrapper').css('width',''); 1824 1825 1826 } 1827 } 1828 1829 //} 1830 1831 //console.info(o.settings_autoHeight, arg,_c, _c.outerHeight()); 1832 if(o.settings_autoHeight=='on'){ 1833 1834 var aux = _c.outerHeight(); 1835 1836 1837 1838 if(o.settings_autoHeight_proportional=='on'){ 1839 if(_c.find('.imagediv').eq(0).data('natural_w')){ 1840 1841 var nw =Number(_c.find('.imagediv').eq(0).data('natural_w')); 1842 var nh =Number(_c.find('.imagediv').eq(0).data('natural_h')); 1843 var rat = nw/nh; 1844 1845 aux = tw*nh/nw; 1846 1847 if(aux> o.settings_autoHeight_proportional_max_height){ 1848 aux = o.settings_autoHeight_proportional_max_height; 1849 } 1850 1851 1852 aux+='px'; 1853 1854 //console.info(aux,tw, rat); 1855 } 1856 } 1857 1858 1859 if(margs.force_width && margs.force_width>0){ 1860 _c.find('img').eq(0).width(margs.force_width); 1861 _c.find('img').eq(0).addClass('width-already-set'); 1862 1863 _thumbsCon.width(margs.force_width); 1864 _thumbsCon.addClass('width-already-set'); 1865 } 1866 1867 if(margs.force_height && margs.force_height>0){ 1868 1869 aux = margs.force_height; 1870 } 1871 1872 _thumbsCon.css({ 1873 'height' : aux 1874 }); 1875 cthis.css({ 1876 'height' : 'auto' 1877 }) 1878 1879 1880 if(o.settings_autoHeight_proportional=='on'){ 1881 _thumbsClip.children().children('.imagediv').height(aux); 1882 } 1883 } 1884 1885 1886 if(o.settings_transition=='slide'){ 1887 1888 if(!cthis.hasClass('no-need-for-nav')){ 1889 _thumbsClip.css({ 1890 'left' : currPageX 1891 }); 1892 }; 1893 } 1894 1895 1896 if(o.settings_transition=='fade'){ 1897 1898 } 1899 1900 1901 }else{ 1902 if(!cthis.hasClass('no-need-for-nav')){ 1903 _thumbsClip.css({ 1904 'left' : currPageX 1905 }); 1906 }; 1907 1908 } 1909 1910 1911 if(o.settings_secondCon){ 1912// console.info($(o.settings_secondCon).find('.item').eq(arg).outerHeight(false)); 1913 $(o.settings_secondCon).find('.item').removeClass('active'); 1914 $(o.settings_secondCon).find('.item').eq(arg).addClass('active'); 1915 $(o.settings_secondCon).find('.dzsas-second-con--clip').css( 1916 { 1917 'height': $(o.settings_secondCon).find('.item').eq(arg).outerHeight(false) 1918 ,'left' : -(arg*100)+'%' 1919 } 1920 ); 1921 } 1922 1923 currPage = arg; 1924 slideshowCount = 0; 1925 1926 //setTimeout(calculate_dims, 500); 1927 } 1928 1929 1930 1931 1932 } 1933 return this; 1934 }) 1935 } 1936 1937 1938 window.dzsas_init = function(selector, settings) {
1939 if(typeof(settings)!="undefined" && typeof(settings.init_each)!="undefined" && settings.init_each==true ){ 1940 var element_count = 0; 1941 for (e in settings) { element_count++; } 1942 if(element_count==1){ 1943 settings = undefined; 1944 } 1945 1946 $(selector).each(function(){ 1947 var _t = $(this); 1948 _t.advancedscroller(settings) 1949 }); 1950 }else{ 1951 $(selector).advancedscroller(settings); 1952 } 1953 1954 }; 1955})(jQuery); 1956 1957 1958function is_ios() { 1959 return ((navigator.platform.indexOf("iPhone") != -1) || (navigator.platform.indexOf("iPod") != -1) || (navigator.platform.indexOf("iPad") != -1) 1960 ); 1961} 1962function is_android() { 1963 //return true; 1964 return (navigator.platform.indexOf("Android") != -1); 1965} 1966 1967function is_ie(){ 1968 if (navigator.appVersion.indexOf("MSIE") != -1){ 1969 return true; 1970 }; 1971 return false; 1972}; 1973function is_firefox(){ 1974 if (navigator.userAgent.indexOf("Firefox") != -1){ 1975 return true; 1976 }; 1977 return false; 1978}; 1979function is_opera(){ 1980 if (navigator.userAgent.indexOf("Opera") != -1){ 1981 return true; 1982 }; 1983 return false; 1984}; 1985function is_chrome(){ 1986 return navigator.userAgent.toLowerCase().indexOf('chrome') > -1; 1987}; 1988function is_safari(){ 1989 return navigator.userAgent.toLowerCase().indexOf('safari') > -1; 1990}; 1991function version_ie(){ 1992 return parseFloat(navigator.appVersion.split("MSIE")[1]); 1993}; 1994function version_firefox(){ 1995 if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ 1996 var aversion=new Number(RegExp.$1); 1997 return(aversion); 1998 }; 1999}; 2000function version_opera(){ 2001 if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ 2002 var aversion=new Number(RegExp.$1); 2003 return(aversion); 2004 }; 2005}; 2006 2007 2008jQuery(document).ready(function($){ 2009 dzsas_init('.advancedscroller.auto-init', {init_each: true}) 2010});
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.