1var $ = jQuery.noConflict(); 2 3jQuery(document).ready(function($){ 4 "use strict"; 5 6 otw_pm_responsive_videos(); 7 8 //Slider width fixing 9 jQuery('.otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-gallery').each(function(){ 10 var image = new Image(); 11 image.src = jQuery(this).find('.slides li img').attr("src"); 12 image.onload = function(){ 13 jQuery(this).css({'max-width': image.naturalWidth + 'px' }); 14 jQuery(this).find('.slides li').css({'max-width': image.naturalWidth + 'px' }); 15 } 16 }); 17 18 //Portfolio images slides 19 if(jQuery('.otw_portfolio_manager-format-gallery .slides').length > 0 ) { 20 jQuery('.otw_portfolio_manager-format-gallery').flexslider({ 21 animation: "slide" // slide or fade 22 }); 23 } 24 25 try { 26 27 jQuery('.otw_portfolio_manager-format-image:not(.without-popup) a:not(.otw_in_slider), .otw_portfolio_manager-carousel .slides .otw_portfolio_manager-portfolio-media a:not(.otw_in_slider), .otw_portfolio_manager-widget-carousel .otw-slider-image, .otw_portfolio_manager-slider .slides .otw_portfolio_manager-portfolio-media a:not(.otw_in_slider), .otw_portfolio_manager-widget-carousel .slider_item a').fancybox({ 28 nextEffect : 'fade', 29 prevEffect : 'fade', 30 openEffect : 'fade', 31 closeEffect : 'fade', 32 autoPlay : false, 33 playSpeed : 2000, 34 helpers: { 35 title : { 36 type : 'float' 37 } 38 } 39 }); 40 41 jQuery('.otw_portfolio_manager-format-image:not(.without-popup) a.otw_in_slider, .otw_portfolio_manager-format-gallery:not(.without-popup) .slides a, .otw_portfolio_manager-carousel .slides .otw_portfolio_manager-portfolio-media a.otw_in_slider, .otw_portfolio_manager-slider .slides .otw_portfolio_manager-portfolio-media a.otw_in_slider').fancybox({ 42 nextEffect : 'fade', 43 prevEffect : 'fade', 44 openEffect : 'fade', 45 closeEffect : 'fade', 46 autoPlay : true, 47 playSpeed : 2000, 48 helpers: { 49 title : { 50 type : 'float' 51 } 52 } 53 }); 54 } catch(err) {} 55 56 57 58 /* Fancybox Images */ 59 try { 60 jQuery(".otw_portfolio_manager-fancybox-img").fancybox({ 61 nextEffect : 'fade', 62 prevEffect : 'fade', 63 openEffect : 'fade', 64 closeEffect : 'fade', 65 helpers: { 66 title : { 67 type : 'float' 68 } 69 } 70 }); 71 } catch(err) { } 72 73 /* Fancybox Videos */ 74 try { 75 var videoLinks = jQuery('.otw_portfolio_manager-fancybox-movie-wrap'); 76 77 videoLinks.fancybox({ 78 type: 'ajax', 79 beforeLoad: function() { 80 this.href = jQuery(this.element).attr('rel'); 81 }, 82 closeClick : false, 83 openEffect : 'fade', 84 closeEffect : 'fade' 85 }); 86 87 var videoLinks = jQuery('.otw_portfolio_manager-fancybox-movie'); 88 89 videoLinks.fancybox({ 90 type: 'ajax', 91 beforeLoad: function() { 92 this.href = jQuery(this.element).attr('rel'); 93 }, 94 closeClick : false, 95 openEffect : 'fade', 96 closeEffect : 'fade' 97 }); 98 99 } catch(err) { } 100 try { 101 jQuery('.otw_portfolio_manager-fancybox-video').fancybox({ 102 maxWidth : 800, 103 maxHeight : 600, 104 fitToView : false, 105 width : '75%', 106 height : '75%', 107 type : 'iframe', 108 autoSize : false, 109 closeClick : false, 110 openEffect : 'fade', 111 closeEffect : 'fade' 112 }); 113 } catch(err) { } 114 115 //Accordion 116 try { 117 jQuery('.otw_portfolio_manager-accordion').accordion({ 118 heightStyle: "content" 119 }); 120 } catch(err) {} 121 122 jQuery(document).on('click', '.js-otw_portfolio_manager-load-more a', function(e) { 123 e.preventDefault(); 124 125 var $this = jQuery(this); 126 127 if( !$this.parent().hasClass('otw_portfolio_manager-load-more-newspapper') ) { 128 $this.html('<div class="preloader">' + otw_pm_js_labels.otw_pm_loading_text + '</div>'); 129 130 var url = $this.parent('.otw_portfolio_manager-load-more').parent().find('.otw_portfolio_manager-pagination.hide a').attr('href'); 131 132 if(url === 'undefined' || url === '#' || url === ''){ 133 $this.text($this.attr('data-empty')); 134 return false; 135 } 136 $this.attr( 'href', 'javascript:;' ); 137 138 $this.prop('disabled', true); 139 140 $container = $this.parents( '.otw-pm-list-section' ).first().find('.otw_portfolio_manager-portfolio-items-holder'); 141 142 var $mainContainer = $this.parents( '.otw-pm-list-section' ).first(); 143 144 jQuery.get(url, function(data) { 145 if( data.length > 1 ) { 146 var $pagination = jQuery(data).find('.js-pagination_container'); 147 148 $container.parents( '.otw-pm-list-section' ).find( '.js-pagination_container').remove(); 149 150 var $newElements = jQuery(data).find('.otw_portfolio_manager-portfolio-item-holder'); 151 $container.append( $newElements ); 152 153 $mainContainer.append( $pagination ); 154 155 otw_pm_hover_effects(); 156 otw_pm_responsive_videos(); 157 otw_pm_social_shares(); 158 otw_pm_enable_sliders(); 159 160 otw_portfolio_horizontal_layout('.otw_portfolio_manager-horizontal-layout-items'); 161 } else { 162 $this.attr( 'href', 'javascript:;' ); 163 $this.html( otw_pm_js_labels.otw_pm_no_more_posts_text ).animate({ opacity: 1 }, 2000, function () { 164 $this.fadeOut('fast'); 165 });
166 } 167 }); 168 } 169 }); 170 171 // Load More Widgets 172 jQuery(document).on('click', '.js-widget-otw_portfolio_manager-load-more a', function(e) { 173 e.preventDefault(); 174 var $this = jQuery(this); 175 176 var url = $this.parent('.js-widget-otw_portfolio_manager-load-more').parent().find('.otw_portfolio_manager-pagination.hide a').attr('href'); 177 178 if(url === 'undefined' || url === '#' || url === ''){ 179 $this.text($this.attr('data-empty')); 180 return false; 181 } 182 $this.html('<div class="preloader">' + otw_pm_js_labels.otw_pm_loading_text + '</div>'); 183 $this.prop('disabled', true); 184 185 $container = $this.parent().parent().parent().parent().find('.js-widget-list'); 186 187 jQuery.get(url, function(data) { 188 if( data.length > 1 ) { 189 var $pagination = jQuery(data).find('.js-otw_portfolio_manager-widget-pagination-holder').parent().parent(); 190 // Remove Load More 191 $this.parent().parent().remove(); 192 193 // Add new Load More BTN 194 $container.parents( '.otw-pm-list-section').first().find('.js-otw_portfolio_manager-widget-pagination-holder').html( jQuery(data).find('.js-widget-pagination_container') ); 195 196 $container.append( jQuery(data).find('.js-widget-list').children() ); 197 198 otw_pm_hover_effects(); 199 otw_pm_responsive_videos(); 200 otw_pm_social_shares(); 201 otw_pm_enable_sliders(); 202 } else { 203 $this.attr( 'href', 'javascript:;' ); 204 $this.html( otw_pm_js_labels.otw_pm_no_more_posts_text ).animate({ opacity: 1 }, 2000, function () { 205 $this.fadeOut('fast'); 206 }); 207 } 208 }); 209 }); 210 211 //Load More NewsPapper 212 jQuery(document).on("click", '.otw_portfolio_manager-load-more-newspapper a',function(e){ 213 e.preventDefault(); 214 215 var $this = jQuery(this); 216 217 var url = $this.attr('href'); 218 219 if(url === 'undefined' || url === '#' || url === ''){ 220 $this.text($this.attr('data-empty')); 221 return false; 222 } 223 $this.html('<div class="preloader">' + otw_pm_js_labels.otw_pm_loading_text + '</div>'); 224 $container = jQuery(this).parent().parent().parent().find('.otw_portfolio_manager-portfolio-newspaper'); 225 var oldPagination = jQuery( this ).parents( '.js-pagination_container' ).first(); 226 227 jQuery.get(url, function(data){ 228 if( data.length > 1 ){ 229 var $newElements = jQuery( jQuery(data).find('.otw_portfolio_manager-portfolio-items-holder').html() ); 230 231 //slider fixing 232 $newElements.find('.otw_portfolio_manager-portfolio-media-wrapper.otw_portfolio_manager-format-gallery').each(function(){ 233 var image = new Image(); 234 image.src = jQuery(this).find('.slides li img').attr("src"); 235 jQuery(this).css({'max-width': image.naturalWidth + 'px' }); 236 jQuery(this).find('.slides li').css({'max-width': image.naturalWidth + 'px' }); 237 }); 238 239 otw_pm_enable_sliders(); 240 241 var $paginationElement = jQuery(data).find('.js-pagination_container'); 242 243 if($this.data('isotope') !== false){ 244 245 $container.append( $newElements ).isotope( 'appended', $newElements ); 246 $container.isotope( 'reloadItems' ); 247 $container.imagesLoaded( function(){ 248 $container.isotope( 'layout' ); 249 }); 250 251 } else { 252 253 $newElements.appendTo( $this.parent('.otw_portfolio_manager-load-more').parent().find('.otw_portolio_manager-portfolio-item-holder') ).each(function(){ 254 if($this.data('layout') === 'horizontal'){ 255 otw_portfolio_horizontal_layout('.otw_portfolio_manager-horizontal-layout-items'); 256 } 257 }); 258 } 259 otw_pm_social_shares(); 260 otw_pm_enable_sliders(); 261 262 //next page 263 oldPagination.remove(); 264 $container.parent().append( $paginationElement ); 265 266 otw_pm_calculate_columns('.otw_portfolio_manager-mosaic-layout'); 267 } else { 268 $this.html( otw_pm_js_labels.otw_pm_no_more_posts_text ).animate({ opacity: 1 }, 2000, function () { 269 $this.fadeOut('fast'); 270 }); 271 } 272 }); 273 }); 274 275 //Infinite Scroll for Grid Layout 276 try { 277 jQuery('.otw_portfolio_manager-infinite-pagination-holder').infinitescroll({ 278 navSelector : '.otw_portfolio_manager-pagination', // selector for the paged navigation 279 nextSelector : '.otw_portfolio_manager-pagination a', // selector for the NEXT link (to page 2) 280 itemSelector : '.otw_portfolio_manager-portfolio-item-holder', // selector for all items
280you'll retrieve 281 loading: { 282 finishedMsg: otw_pm_js_labels.otw_pm_no_more_posts_text, 283 msgText: otw_pm_js_labels.otw_pm_loading_text, 284 img: '//i.imgur.com/o4Qsgvx.gif' 285 } 286 }, 287 288 //call horizontal layout as a callback 289 function( newElements ) { 290 291 otw_pm_hover_effects(); 292 otw_pm_responsive_videos(); 293 otw_pm_social_shares(); 294 otw_pm_enable_sliders(); 295 } 296 ); 297 } 298 catch(err) { } 299 300 //Infinite Scroll for Newspaper Layout 301 try { 302 303 jQuery('.otw_portfolio_manager-infinite-scroll').infinitescroll({ 304 navSelector : '.otw_portfolio_manager-pagination', // selector for the paged navigation 305 nextSelector : '.otw_portfolio_manager-pagination a', // selector for the NEXT link (to page 2) 306 itemSelector : '.otw_portfolio_manager-portfolio-newspaper-item', // selector for all items you'll retrieve 307 loading: { 308 finishedMsg: otw_pm_js_labels.otw_pm_no_more_posts_text, 309 msgText: otw_pm_js_labels.otw_pm_loading_text, 310 img: '//i.imgur.com/o4Qsgvx.gif' 311 } 312 }, 313 314 //call Isotope as a callback 315 function( newElements ) { 316 jQuery('.otw_portfolio_manager-infinite-scroll').isotope( 'layout' ); 317 318 var $newElements = jQuery(newElements); 319 320 //slider fixing 321 $newElements.find('.otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-gallery').each(function(){ 322 var image = new Image(); 323 image.src = jQuery(this).find('.slides li img').attr("src"); 324 jQuery(this).css({'max-width': image.naturalWidth + 'px' }); 325 jQuery(this).find('.slides li').css({'max-width': image.naturalWidth + 'px' }); 326 }); 327 328 if($newElements.find('.otw_portfolio_manager-format-gallery .slides').length > 0 ) { 329 $newElements.find('.otw_portfolio_manager-format-gallery').flexslider({ 330 animation: "slide" 331 }); 332 } 333 334 jQuery('.otw_portfolio_manager-infinite-scroll').isotope( 'appended', $newElements ); 335 otw_pm_social_shares(); 336 otw_pm_calculate_columns('.otw_portfolio_manager-mosaic-layout'); 337 jQuery('.otw_portfolio_manager-infinite-scroll').isotope( 'reloadItems' ); 338 otw_pm_hover_effects(); 339 setTimeout( function(){ 340 jQuery('.otw_portfolio_manager-infinite-scroll').isotope( 'layout' ); 341 }, 1000 ); 342 343 } 344 ); 345 } catch(err) { } 346 347 //Infinite Scroll for Horizontal Layout 348 try { 349 jQuery('.otw_portfolio_manager-horizontal-layout-items-infinite-scroll').infinitescroll({ 350 navSelector : '.otw_portfolio_manager-pagination', // selector for the paged navigation 351 nextSelector : '.otw_portfolio_manager-pagination a', // selector for the NEXT link (to page 2) 352 itemSelector : '.otw_portfolio_manager-horizontal-item', // selector for all items you'll retrieve 353 loading: { 354 finishedMsg: otw_pm_js_labels.otw_pm_no_more_posts_text, 355 msgText: otw_pm_js_labels.otw_pm_loading_text, 356 img: '//i.imgur.com/o4Qsgvx.gif' 357 } 358 }, 359 360 //call horizontal layout as a callback 361 function( newElements ) { 362 otw_pm_hover_effects(); 363 otw_pm_social_shares(); 364 365 otw_portfolio_horizontal_layout('.otw_portfolio_manager-horizontal-layout-items'); 366 } 367 ); 368 } catch(err) { } 369 370 //Infinite Scroll for Timeline Layout 371 try { 372 jQuery('.otw_portfolio_manager-portfolio-timeline').infinitescroll({ 373 navSelector : '.otw_portfolio_manager-pagination', // selector for the paged navigation 374 nextSelector : '.otw_portfolio_manager-pagination a', // selector for the NEXT link (to page 2) 375 itemSelector : '.otw_portfolio_manager-portfolio-timeline-item', // selector for all items you'll retrieve 376 loading: { 377 finishedMsg: otw_pm_js_labels.otw_pm_no_more_posts_text, 378 msgText: otw_pm_js_labels.otw_pm_loading_text, 379 img: '//i.imgur.com/o4Qsgvx.gif' 380 } 381 }, 382 383 //callback 384 function( newElements ) { 385 var $newElements = jQuery(newElements); 386 387 //slider fixing 388 $newElements.find('.otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-gallery').each(function(){ 389 var image = new Image(); 390 image.src = jQuery(this).find('.slides li img').attr("src");
391 jQuery(this).css({'max-width': image.naturalWidth + 'px' }); 392 jQuery(this).find('.slides li').css({'max-width': image.naturalWidth + 'px' }); 393 }); 394 395 if($newElements.find('.otw_portfolio_manager-format-gallery .slides').length > 0 ) { 396 $newElements.find('.otw_portfolio_manager-format-gallery').flexslider({ 397 animation: "slide" 398 }); 399 } 400 401 //hover styles 402 $newElements.each(function(){ 403 otw_pm_hover_effects(); 404 otw_pm_social_shares(); 405 }); 406 407 jQuery('.otw_portfolio_manager-portfolio-timeline').append($newElements); 408 409 jQuery('#infscr-loading').remove().insertAfter( jQuery('.otw_portfolio_manager-portfolio-timeline .otw_portfolio_manager-portfolio-timeline-item:last') ); 410 411 timeline_pm_layout_fixer(); 412 } 413 ); 414 } catch(err) { } 415 416 //Tabs 417 try { 418 jQuery('.otw_portfolio_manager-tabs').tabs(); 419 } catch(err) { } 420 421 //Accordion 422 try { 423 jQuery('.otw_portfolio_manager-accordion').accordion({ 424 heightStyle: "content" 425 }); 426 } catch(err) { } 427 428 //Slider 429 jQuery('.otw_portfolio_manager-slider').each(function(){ 430 var $this = jQuery(this); 431 432 var slider_animation = jQuery(this).data('animation'); 433 434 if($this.find('.slides').length > 0 ) { 435 if($this.hasClass('otw_portfolio_manager-carousel')){ 436 var item_margin = $this.data('item-margin'); 437 var item_per_page = $this.data('item-per-page'); 438 var item_width = ( ($this.width() - ( item_margin * (item_per_page - 1) )) / item_per_page ); 439 440 var prev_text = ""; 441 var next_text = ""; 442 443 if($this.data('type') == "widget"){ 444 prev_text = '<i class="icon-angle-left"></i>'; 445 next_text = '<i class="icon-angle-right"></i>'; 446 } 447 448 var autoSlide = true; 449 450 if( $this.attr('data-auto-slide') == '0' ){ 451 autoSlide = false; 452 }; 453 454 var navigation = $this.attr('data-nav'); 455 456 if( navigation == '0' ){ 457 navigation = false; 458 }else{ 459 navigation = true; 460 } 461 462 $this.flexslider({ 463 animation: slider_animation, 464 animationLoop: false, 465 prevText: prev_text, 466 nextText: next_text, 467 itemWidth: item_width, 468 itemMargin: item_margin, 469 controlNav: navigation, 470 directionNav: navigation, 471 slideshow: autoSlide 472 }); 473 } else { 474 var navigation = $this.attr('data-nav'); 475 476 if( navigation == '0' ){ 477 navigation = false; 478 }else{ 479 navigation = true; 480 } 481 $this.flexslider({ 482 animation: slider_animation, 483 smoothHeight: true, 484 controlNav: navigation, 485 directionNav: navigation 486 }); 487 } 488 } 489 }); 490 491 //Timeline Layout 492 jQuery('.otw_portfolio_manager-portfolio-timeline.with-heading').before('<div class="otw_portfolio_manager-portfolio-timeline-heading"></div>'); 493 timeline_pm_layout_fixer(); 494 495 //IE8 496 jQuery('.otw_portfolio_manager-portfolio-meta-item:last-child').css({'padding': '0px'}); 497 498 jQuery( '.otw_portfolio_manager-widget-carousel .slider_item .otw_ier, .otw_portfolio_manager-horizontal-item .otw_ier' ).removeAttr( 'style' ); 499 500 setTimeout( function(){ 501 otw_pm_responsive_videos(); 502 }, 2000 ); 503}); 504 505var $container = jQuery('.otw_portfolio_manager-portfolio-newspaper'); 506 507jQuery(window).on('load', function() { 508 509 //Socail shares 510 otw_pm_social_shares(); 511 512 try { 513 $container = jQuery('.otw_portfolio_manager-portfolio-newspaper'); 514 515 otw_pm_calculate_columns('.otw_portfolio_manager-mosaic-layout'); 516 517 $container.isotope({ 518 itemSelector: '.otw_portfolio_manager-portfolio-newspaper-item', 519 layoutMode: 'masonry', 520 getSortData: { 521 date: function( $elem ) { 522 return parseInt(String( jQuery( $elem ).attr('data-date')).replace(/-/g, "")); 523 }, 524 alphabetical: function( $elem ) { 525 return jQuery( $elem ).attr('data-title'); 526 } 527 } 528 }); 529 530 531 if( jQuery( '.otw_portfolio_manager-mosaic-layout' ).size() ){ 532 533 jQuery( window ).resize(function() { 534 535 otw_pm_calculate_columns('.otw_portfolio_manager-mosaic-layout'); 536 $container.isotope( 'layout' ); 537 } ); 538 539 $container.imagesLoaded( function(){ 540 otw_pm_calculate_columns('.otw_portfolio_manager-mosaic-layout'); 541 $container.isotope( 'layout' ); 542 }); 543 }; 544 545 jQuery('.otw_portfolio_manager-mosaic-layout').each(function(){ 546 var $this = jQuery(this); 547 548 jQuery(this).isotope({ 549 masonry: { 550 columnWidth: $this.attr('data-item-width') 551 } 552 }); 553 }); 554 555 var $optionSets_filter = jQuery('.option-set.otw_portfolio_manager-portfolio-filter'), 556 $optionLinks_filter = $optionSets_filter.find('a'); 557 558 $optionLinks_filter.on( 'click', function(e) { 559 e.preventDefault(); 560 561 var $this = jQuery(this); 562 563 if ($this.hasClass('selected')) { 564 return false; 565 } 566 567 var $optionSet = $this.parents('.option-set'); 568 $optionSet.find('.selected').removeClass('selected'); 569 $this.addClass('selected'); 570 571 var selector = jQuery(this).data('filter'); 572 jQuery(this).parents('.otw_portfolio_manager-portfolio-newspaper-filter').parent().find($container).isotope({filter: selector}); 573 }); 574 } catch(err) {} 575 576 //Portfolio Sorting 577 var $optionSets_sort = jQuery('.option-set.otw_portfolio_manager-portfolio-sort'), 578 $optionLinks_sort = $optionSets_sort.find('a'); 579 580 $optionLinks_sort.on( 'click', function(e){
581 e.preventDefault(); 582 583 var $this = jQuery(this); 584 585 if ($this.hasClass('selected')) { 586 return false; 587 } 588 589 var $optionSet = $this.parents('.option-set'); 590 $optionSet.find('.selected').removeClass('selected'); 591 $this.addClass('selected'); 592 593 var value = $this.attr('data-option-value'); 594 jQuery(this).parents('.otw_portfolio_manager-portfolio-newspaper-sort').parent().find($container).isotope({ sortBy : value }); 595 }); 596 597 //horizontal layout 598 otw_portfolio_horizontal_layout('.otw_portfolio_manager-horizontal-layout-items'); 599 600 //Hover effect 601 otw_pm_hover_effects(); 602 603}); 604 605//Window resize event 606try { 607 jQuery(window).resize(function(){ 608 otw_portfolio_horizontal_layout('.otw_portfolio_manager-horizontal-layout-items'); 609 otw_pm_responsive_videos(); 610 }); 611 612 jQuery(window).smartresize(function(){ 613 try { 614 otw_pm_calculate_columns('.otw_portfolio_manager-mosaic-layout'); 615 } catch(err) { } 616 617 try { 618 otw_portfolio_horizontal_layout('.otw_portfolio_manager-horizontal-layout-items'); 619 } catch(err) { } 620 621 try { 622 jQuery('.otw_portfolio_manager-mosaic-layout').each(function(){ 623 var $this = jQuery(this); 624 625 jQuery(this).isotope({ 626 masonry: { 627 columnWidth: $this.attr('data-item-width') 628 } 629 }); 630 }); 631 } catch(err) { } 632 633 otw_pm_responsive_videos(); 634 }); 635} catch(err) { } 636 637function otw_pm_hover_effects(){ 638 jQuery('.otw_portfolio_manager-hover-effect-5, .otw_portfolio_manager-hover-effect-12').each(function(){ 639 $this = jQuery(this).find('.otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-image > a'); 640 641 if( $this.find('span.otw-hover-effect').length == 0 ){ 642 $this.append('<span class="otw-hover-effect"></span>'); 643 } 644 }); 645 646 jQuery('.otw_portfolio_manager-valign-middle').each(function(){ 647 jQuery(this).css({'margin-top': 0 - (jQuery(this).outerHeight() / 2) + 'px'}) 648 }); 649 650 //Special effects 651 jQuery('img', '.otw_portfolio_manager-hover-effect-13 .otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-image > a').each(function(){ 652 jQuery(this).clone().addClass("otw_portfolio_manager-hover-img").insertAfter(jQuery(this)).load(function(){ 653 Pixastic.process(this, "desaturate", {average: !1}); 654 }); 655 }); 656 657 jQuery('img', '.otw_portfolio_manager-hover-effect-14 .otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-image > a').each(function(){ 658 jQuery(this).clone().addClass("otw_portfolio_manager-hover-img").insertAfter(jQuery(this)).load(function(){ 659 Pixastic.process(this, "blurfast", {amount: 0.3}); 660 }); 661 }); 662 663 jQuery('img', '.otw_portfolio_manager-hover-effect-15 .otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-image > a').each(function(){ 664 jQuery(this).clone().addClass("otw_portfolio_manager-hover-img").insertAfter(jQuery(this)).load(function(){ 665 Pixastic.process(this, "blurfast", {amount: 0.05}); 666 }); 667 }); 668 669 jQuery('img', '.otw_portfolio_manager-hover-effect-16 .otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-image > a').each(function(){ 670 jQuery(this).clone().addClass("otw_portfolio_manager-hover-img").insertAfter(jQuery(this)).load(function(){ 671 Pixastic.process(this, "glow", {amount: 0.3, radius: 0.2}); 672 }); 673 }); 674 675 //IE8 frameborder fixer 676 jQuery('.otw_portfolio_manager-format-video iframe, .otw_portfolio_manager-format-audio iframe').each(function(){ 677 jQuery(this).attr({'frameBorder': 'no'}); 678 }); 679 680} 681 682//Masonry layout 683function otw_pm_calculate_columns(container) { 684 685 jQuery(container).each(function(){ 686 687 688 var $this = jQuery(this), 689 690 containerWidth = $this.width(), 691 692 minCol = containerWidth / 12; 693 694 695 696 var max_width = $this.attr( 'data-max' ); 697 var columns = $this.attr( 'data-columns' ); 698 699 if (minCol*3 >= 150) { 700 701 if($this.data('columns') == 3){ 702 } else if($this.data('columns') == 4){ 703 } 704 705 jQuery('> .otw_portfolio_manager-iso-item', $this).each(function() { 706 var $this = jQuery(this); 707 if ($this.hasClass('otw_portfolio_manager-1-4')) { 708 $this.css('width', minCol*3); 709 } else if ($this.hasClass('otw_portfolio_manager-2-4') || $this.hasClass('otw_portfolio_manager-1-2')) { 710 $this.css('width', minCol*6); 711 } else if ($this.hasClass('otw_portfolio_manager-1-3')) { 712 $this.css('width', minCol*4); 713 } else if ($this.hasClass('otw_portfolio_manager-2-3')) { 714 $this.css('width', minCol*8); 715 } else if( columns == 3 ){ 716 $this.css('width', minCol*4); 717 } else if( columns == 4 ){ 718 $this.css('width', minCol*3); 719 } 720 }); 721 722 } else if ( minCol*3 < 200 && minCol*3 > 150) { 723 724 if($this.data('columns') == 3){ 725 } else if($this.data('columns') == 4){ 726 } 727 728 jQuery('> .otw_portfolio_manager-iso-item', $this).each(function() { 729 var $this = jQuery(this); 730 if ($this.hasClass('otw_portfolio_manager-1-4')) { 731 $this.css('width', minCol*6); 732 } else if ($this.hasClass('otw_portfolio_manager-2-4') || $this.hasClass('otw_portfolio_manager-1-2')) { 733 $this.css('width', minCol*12); 734 } else if ($this.hasClass('otw_portfolio_manager-1-3')) { 735 $this.css('width', minCol*6); 736 } else if ($this.hasClass('otw_portfolio_manager-2-3')) { 737 $this.css('width', minCol*12); 738 } 739 }); 740 741 } else if ( minCol*3 <= 150) { 742 743 744 jQuery('> .otw_portfolio_manager-iso-item', $this).each(function() { 745 jQuery(this).css('width', minCol * 12 ); 746 }); 747 } 748 749 jQuery('> .otw_portfolio_manager-iso-item', $this).each(function() { 750 751 if( max_width && containerWidth < max_width ){ 752 753 var proportion = jQuery( this ).attr( 'data-max_width' ) / jQuery( this ).attr( 'data-max_he
753ight' ); 754 755 jQuery(this).css( 'max-width', '100%' ); 756 jQuery(this).css( 'min-width', '' ); 757 jQuery(this).css( 'min-height', '' ); 758 jQuery(this).css( 'max-height', '' ); 759 760 var new_height = jQuery(this).outerWidth() / proportion; 761 var new_width = jQuery(this).outerWidth(); 762 jQuery(this).css( 'height', new_height ); 763 764 var paddings = 20; 765 766 if( $container.hasClass( 'without-space' ) ){ 767 paddings = 0; 768 } 769 770 jQuery(this).find('.otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-image a img').css({'width': new_width - paddings, 'height': new_height - paddings }); 771 jQuery(this).find('.otw_ier').removeAttr( 'style' ); 772 773 }else{ 774 775 if( jQuery( this ).attr( 'data-max_width' ) ){ 776 777 jQuery(this).css( 'max-width', jQuery( this ).attr( 'data-max_width' ) + 'px' ); 778 } 779 if( jQuery( this ).attr( 'data-max_height' ) ){ 780 jQuery(this).css( 'max-height', jQuery( this ).attr( 'data-max_height' ) + 'px' ); 781 } 782 783 if( ( jQuery(this).hasClass('otw_portfolio_manager-1-2') || jQuery(this).hasClass('otw_portfolio_manager-2-3') ) && jQuery(this).hasClass('height1')){ 784 jQuery(this).css('height', jQuery(this).outerWidth()/2); 785 } else if(jQuery(this).hasClass('height2')){ 786 jQuery(this).css('height', jQuery(this).outerWidth()*2); 787 } else { 788 jQuery(this).css('height', jQuery(this).outerWidth()); 789 } 790 791 792 793 jQuery(this).find('.otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-image a img').css({'width': jQuery(this).width(), 'height': jQuery(this).height() }) 794 jQuery(this).find('.otw_ier').removeAttr( 'style' ); 795 jQuery(this).find('.otw_ier iframe').attr( 'width', jQuery(this).width() ).attr( 'height', jQuery(this).height() ); 796 } 797 }); 798 799 }); 800} 801 802//Timeline layout 803function timeline_pm_layout_fixer(){ 804 jQuery('.otw_portfolio_manager-portfolio-timeline .otw_portfolio_manager-portfolio-timeline-item').removeClass('odd').removeClass('even'); 805 jQuery('.otw_portfolio_manager-portfolio-timeline .otw_portfolio_manager-portfolio-timeline-item:nth-child(2n-1)').addClass('odd'); 806 jQuery('.otw_portfolio_manager-portfolio-timeline .otw_portfolio_manager-portfolio-timeline-item:nth-child(2n)').addClass('even'); 807} 808 809//Horizontal layout 810function otw_portfolio_horizontal_layout(container){ 811 jQuery(container).each(function(){ 812 jQuery(this).css({'opacity': '0'}); 813 814 var $this = jQuery(this), 815 container_width = $this.parent('.otw_portfolio_manager-horizontal-layout-wrapper').width(), 816 row = 1, 817 item_margin = $this.data('item-margin'), 818 cache_width = 0, 819 height_items = []; 820 821 $this.children('.otw_portfolio_manager-horizontal-item').each(function(){ 822 if( jQuery(this).attr('data-original-width') === undefined ){ 823 var $img = jQuery(this).find('.otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-image img'); 824 825 jQuery(this).attr({'data-original-width': $img.attr('width')}); 826 jQuery(this).attr({'data-original-height': $img.attr('height')}); 827 828 //remove image size 829 $img.attr({'width': ''}); 830 $img.attr({'height': ''}); 831 } 832 833 jQuery(this).css({'margin-right': ''}); 834 835 cache_width += ( jQuery(this).data('original-width') + item_margin ); 836 837 jQuery(this).attr({'data-row': row}); 838 839 if( cache_width >= container_width ){ 840 //new height is original height - original width x new width 841 height_items.push( (jQuery(this).data('original-height') / (cache_width - item_margin) * container_width) ); 842 843 jQuery(this).css({'margin-right': '0px'}); 844 jQuery(this).attr( 'data-last', 1 ); 845 846 cache_width = 0; 847 row += 1; 848 }else{ 849 jQuery(this).attr( 'data-last', 0 ); 850 } 851 }); 852 853 for (var i = 0; i < height_items.length; i++) { 854 var tw_size = 0; 855 $this.children('.otw_portfolio_manager-horizontal-item[data-row="'+ (i + 1) +'"]').each(function(){ 856 //new width is original wdith / original height x new height 857 var new_width = Math.ceil( jQuery(this).data('original-width') / jQuery(this).data('original-height') * height_items[i] ); 858 859 tw_size = tw_size + new_width + item_margin; 860 861 if(jQuery( this ).attr( 'data-last' ) == '1' ){ 862 863 if( tw_size < container_width ){ 864 865 new_width = new_width + ( container_width - tw_size ); 866 867 }else if( tw_size > container_width ){ 868 869 new_width = new_width - ( tw_size - container_width ); 870 } 871 new_width = new_width + item_margin; 872 } 873 874 jQuery(this).find('.otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-image').css( {'width': new_width + 'px', 'height': parseInt(height_items[i]) }); 875 876 jQuery(this).find('.otw_ier iframe').attr( 'width', new_width ).attr( 'height', parseInt(height_items[i]) ); 877 }); 878 } 879 880 if( $this.children('.otw_portfolio_manager-horizontal-item[data-row="'+ row +'"]').length > 0 ){ 881 $this.children('.otw_portfolio_manager-horizontal-item[data-row="'+ row +'"]').each(function(){ 882 jQuery(this).find('.otw_portfolio_manager-portfolio-media.otw_portfolio_manager-format-image').css({'width': jQuery(this).data('original-width') + 'px', 'height': jQuery(this).data('original-height') }); 883 884 jQuery(this).find('.otw_ier iframe').attr( 'width', jQuery(this).data('original-width') ).attr( 'height', jQuery(this).data('original-height') ); 885 }); 886 887 $this.children('.otw_portfolio_manager-horizontal-item[data-row="'+ row +'"]:last-child').css({'margin-right': '0px'}); 888 } 889 890 $this.css({'opacity': '1'}); 891 }); 892} 893 894//Social shares 895function otw_pm_social_shares(){ 896 897 var has_soccial_shares = false; 898 899 if( jQuery('.otw_portfolio_manager-social-share-buttons-wrapper').size() || jQuery('.otw_portfolio_manager-social-wrapper').size() ) 900 { 901 has_soccial_shares = true; 902 } 903 904 jQuery('.otw_portfolio_manager-social-share-buttons-wrapper').each(function(){ 905 var $this = jQuery(this); 906 title = jQuery(this).data('title'), 907 description = jQuery(this).data('description'), 908 image = jQuery(this).data('image'), 909 url = jQuery(this).data('url'); 910 911 jQuery.ajax({ 912 type: 'POST', 913 url: socialShareURL, 914 dataType: 'json', 915 cache: false, 916 data: 'url='+ url, 917 success: function(data) { 918 919 if(data.info !== 'error'){ 920 921 $this.find('.otw_portfolio-manager-social-share').each(function(){ 922 if(jQuery(this).hasClass('otw-facebook')){ 923 jQuery(this).append('<span class="data-shares">'+ data.facebook +'</span>'); 924 jQuery(this).attr({'href': 'http://www.facebook.com/sharer.php?u='+ url}); 925 } else if(jQuery(this).hasClass('otw-twitter')){ 926 jQuery(this).attr({'href': 'https://twitter.com/intent/tweet?source=tweetbutton&text='+ title +'&url='+ encodeURIComponent(url)}); 927 } else if(jQuery(this).hasClass('otw-google_plus')){ 928 jQuery(this).append('<span class="data-shares">'+ data.google_plus +'</span>'); 929 jQuery(this).attr({'href': 'https://plus.google.com/share?url='+ url}); 930 } else if(jQuery(this).hasClass('otw-linkedin')){ 931 jQuery(this).append('<span class="data-shares">'+ data.linkedin +'</span>'); 932 jQuery(this).attr({'href': 'http://www.linkedin.com/shareArticle?mini=true&url='+ encodeURIComponent(url) +'&title='+ escape(title) +'&summary='+ escape(description)}); 933 } else if(jQuery(this).hasClass('otw-pinterest')){ 934 jQuery(this).append('<span class="data-shares">'+ data.pinterest +'</span>'); 935 jQuery(this).attr({'href': 'http://pinterest.com/pin/create/button/?url='+ encodeURIComponent(url) +'&media='+ encodeURIComponent(image) +'&description='+ escape(description)}); 936 } 937 });
938 } 939 } 940 }); 941 }); 942 943 jQuery('.otw_portfolio_manager-social-wrapper').each(function(){ 944 var $this = jQuery(this); 945 title = jQuery(this).data('title'), 946 description = jQuery(this).data('description'), 947 image = jQuery(this).data('image'), 948 url = jQuery(this).data('url'); 949 950 jQuery(this).children('.otw_portfolio_manager-social-item').each(function(){ 951 if(jQuery(this).hasClass('otw-facebook')){ 952 jQuery(this).attr({'href': 'http://www.facebook.com/sharer.php?u='+ url}); 953 } else if(jQuery(this).hasClass('otw-twitter')){ 954 jQuery(this).attr({'href': 'https://twitter.com/intent/tweet?source=tweetbutton&text='+ title +'&url='+ encodeURIComponent(url)}); 955 } else if(jQuery(this).hasClass('otw-google_plus')){ 956 jQuery(this).attr({'href': 'https://plus.google.com/share?url='+ url}); 957 } else if(jQuery(this).hasClass('otw-linkedin')){ 958 jQuery(this).attr({'href': 'http://www.linkedin.com/shareArticle?mini=true&url='+ encodeURIComponent(url) +'&title='+ escape(title) +'&summary='+ escape(description)}); 959 } else if(jQuery(this).hasClass('otw-pinterest')){ 960 jQuery(this).attr({'href': 'http://pinterest.com/pin/create/button/?url='+ encodeURIComponent(url) +'&media='+ encodeURIComponent(image) +'&description='+ escape(description)}); 961 } 962 }); 963 }); 964 965 if( has_soccial_shares ) 966 { 967 update_pm_social_stuff(); 968 } 969} 970 971function otw_pm_responsive_videos() { 972 973 jQuery('.otw_portfolio_manager-portfolio-media .otw_ier').each( function(){ 974 975 var propoption = jQuery( this ).attr( 'data-width' ) / jQuery( this ).attr( 'data-height' ); 976 977 var parent = jQuery( this ).parents( '.otw_portfolio_manager-portfolio-full' ).first(); 978 979 jQuery( this ).css( 'max-width', '100%' ); 980 981 if( parent.size() && ( parent.hasClass('with-border') || parent.hasClass('with-bg') ) ){ 982 983 var new_width = parent.outerWidth(); 984 985 parent.css( 'max-width', '100%' ); 986 987 if( parent.outerWidth() < jQuery( this ).attr( 'data-width' ) ){ 988 jQuery( this ).css( 'width', '' ); 989 }else{ 990 jQuery( this ).css( 'width', jQuery( this ).attr( 'data-width' ) + 'px' ); 991 } 992 }else{ 993 jQuery( this ).parents( '.otw_portfolio_manager-portfolio-media' ).first().css( 'max-width', '100%' ); 994 } 995 jQuery( this ).parents( '.otw_portfolio_manager_related_posts_hover' ).first().css( 'max-width', '100%' ); 996 997 var new_height = parseInt( Number( jQuery( this ).width() / propoption ) ); 998 999 jQuery( this ).css( 'height', new_height ); 1000 1001 jQuery( this ).find( '> iframe' ).attr( 'height', new_height ); 1002 } ) 1003} 1004 1005function otw_pm_enable_sliders () { 1006 jQuery('.otw_portfolio_manager-format-gallery').flexslider({ 1007 animation: "slide" // slide or fade 1008 }); 1009} 1010function update_pm_social_stuff() { 1011 //Twitter 1012 1013 jQuery.getScript("//platform.twitter.com/widgets.js"); 1014 1015 // G+ 1016 (function() { 1017 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; 1018 po.src = 'https://apis.google.com/js/platform.js'; 1019 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); 1020 })(); 1021}
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.