1(function ($) { 2 "use strict"; 3 4 var pickApp = { 5 /* --------------------------------------------- 6 Preloader 7 --------------------------------------------- */ 8 preloader: function() { 9 $(window).on('load', function () { 10 $("body").imagesLoaded(function(){ 11 $('.preloader').delay(500).slideUp('slow', function() { 12 $(this).remove(); 13 }); 14 }); 15 }); 16 }, 17 /* --------------------------------------------- 18 Top Search 19 --------------------------------------------- */ 20 top_search: function () { 21 $('#top-search').clone().addClass('mobile-search').appendTo('#masthead .menuexpandermain'); 22 $('#search-btn, #top-search .mobile-search #search-btn').on('click', function () { 23 $('#search-screen').fadeIn('500'); 24 }); 25 $('#search-screen .search-close').on('click', function () { 26 $('#search-screen').fadeOut('slow'); 27 }); 28 }, 29 /* --------------------------------------------- 30 Menu 31 --------------------------------------------- */ 32 menu: function() { 33 var items = $('.overlapblackbg, .slideLeft'), 34 menucontent = $('.menucontent'), 35 submenu = $('.menu-list li').has('.menu-submenu'), 36 menuopen = function() { 37 $(items).removeClass('menuclose').addClass('menuopen'); 38 }, 39 menuclose = function() { 40 $(items).removeClass('menuopen').addClass('menuclose'); 41 }; 42 $('#navToggle').on('click', function() { 43 if (menucontent.hasClass('menuopen')) { 44 $(menuclose); 45 } else { 46 $(menuopen); 47 } 48 }); 49 menucontent.on('click', function() { 50 if (menucontent.hasClass('menuopen')) { 51 $(menuclose); 52 } 53 }); 54 $('#navToggle,.overlapblackbg').on('click', function() { 55 $('.menucontainer').toggleClass("mrginleft"); 56 }); 57 if(submenu) { 58 $('.menu-submenu').prev().append('<span class="fa fa-angle-down"></span>'); 59 } 60 submenu.prepend('<span class="menu-click"><i class="menu-arrow fa fa-plus"></i></span>'); 61 $('.menu-mobile').on('click', function() { 62 $('.menu-list').slideToggle('slow'); 63 }); 64 $('.menu-click').on('click', function() { 65 $(this).siblings('.menu-submenu').slideToggle('slow'); 66 $(this).children('.menu-arrow').toggleClass('menu-extend'); 67 }); 68 }, 69 /* --------------------------------------------- 70 smooth scroll 71 --------------------------------------------- */ 72 smoothscroll: function() { 73 if (typeof smoothScroll == 'object') { 74 smoothScroll.init(); 75 } 76 }, 77 /* --------------------------------------------- 78 Pick Video 79 --------------------------------------------- */ 80 video: function () { 81 $("#featured-item .post-thumb").fitVids(); 82 $(".content-area").fitVids(); 83 }, 84 /* --------------------------------------------- 85 Pick Featured Area 86 --------------------------------------------- */ 87 featured_area: function () { 88 if (typeof pick !== 'undefined') { 89 var featured_post_auto_slide = pick.featured_post_auto_slide; 90 var featured_slide_speed = pick.featured_slide_speed; 91 var featured_autoplay_timeout = pick.featured_autoplay_timeout; 92 } 93 if (featured_post_auto_slide == 1) { 94 var featured_post_auto_slide = true; 95 } else {
96 var featured_post_auto_slide = false; 97 } 98 99 var check_rtl = pick.check_rtl; 100 if (check_rtl == 0) { 101 var check_rtl = false; 102 } else { 103 var check_rtl = true; 104 } 105 106 $('#featured-item').owlCarousel({ 107 rtl: check_rtl, 108 center: false, 109 items: 1, 110 autoplay: featured_post_auto_slide, 111 autoplayTimeout: featured_autoplay_timeout, 112 autoplaySpeed: featured_slide_speed, 113 navSpeed: featured_slide_speed, 114 autoplayHoverPause: true, 115 singleItem: true, 116 loop: true, 117 margin: 30, 118 nav: false, 119 dots: true 120 }); 121 var featuredImage = $('#featured-item .post-thumb'); 122 featuredImage.each(function () { 123 var $image = $(this).find('img'); 124 var imageSource = $image.attr('src'); 125 $(this).css('backgroundImage', 'url(' + imageSource + ')'); 126 $image.css('visibility','hidden'); 127 }); 128 if ($('#featured-item .post-thumb .fluid-width-video-wrapper').length || $('#featured-item .post-thumb .post-video-player').length) { 129 $('#featured-item .post-thumb .fluid-width-video-wrapper').parent().parent().css('padding-top','0'); 130 $('#featured-item .post-thumb .post-video-player').parent().parent().css('padding-top','0'); 131 } 132 }, 133 /* --------------------------------------------- 134 Pick Masonry And Infinity Scroll 135 --------------------------------------------- */ 136 masonry: function() { 137 if ($('#masonry-layout').length > 0) { 138 var $container = $('#masonry-layout'); 139 $container.imagesLoaded(function() { 140 $container.masonry({ 141 itemSelector: '.grid, .full-width' 142 }); 143 }); 144 } 145 if ($('#pick-theme-infinity-scroll').length > 0) { 146 var $infinity_container = $('#pick-theme-infinity-scroll'); 147 if (typeof pick !== 'undefined') { 148 var infinity_scroll_img = pick.infinity_scroll_img; 149 } 150 $infinity_container.infinitescroll({ 151 navSelector : '.paging-navigation', // selector for the paged navigation 152 nextSelector : '.paging-navigation .nav-next a', // selector for the NEXT link (to page 2) 153 itemSelector : '.grid, .full-width', // selector for all items you'll retrieve 154 loading: { 155 finishedMsg: 'No more pages to load.', 156 img: infinity_scroll_img 157 } 158 }, 159 // trigger Masonry as a callback 160 function( newElements ) { 161 // hide new items while they are loading 162 var $newElems = $( newElements ).css({ opacity: 0 }); 163 // ensure that images load before adding to masonry layout 164 $newElems.imagesLoaded(function(){
165 // show elems now they're ready 166 $newElems.animate({ opacity: 1 }); 167 if (pick.list_layout == false) { 168 $container.masonry( 'appended', $newElems, true ); 169 } 170 }); 171 } 172 ); 173 } 174 }, 175 /* --------------------------------------------- 176 Sticky Fix 177 --------------------------------------------- */ 178 sticky: function () { 179 if($('#main .sticky').length) { 180 $('#main .sticky').prepend('<div class="sticky-icon"><i class="fa fa-star"></i></div>'); 181 } 182 }, 183 /* --------------------------------------------- 184 Gallery One 185 --------------------------------------------- */ 186 gallary_one: function () { 187 var check_rtl = pick.check_rtl; 188 if (check_rtl == 0) { 189 var check_rtl = false; 190 } else { 191 var check_rtl = true; 192 } 193 194 $('.gallery-one').owlCarousel({ 195 rtl:check_rtl, 196 items:1, 197 autoplay: true, 198 autoplayTimeout:5000, 199 autoplayHoverPause:true, 200 singleItem:true, 201 loop:true, 202 nav : true, 203 navText: ["<i class='fa fa-angle-left'></i>","<i class='fa fa-angle-right'></i>"], 204 owl2row: 'true', 205 owl2rowTarget: 'item', 206 responsive: { 207 1170:{ 208 items:1 209 } 210 } 211 }); 212 $('.gallery-one .item').on('click',function(e){ 213 e.preventDefault(); 214 $('.gallery-one').magnificPopup({ 215 delegate: 'a', 216 type: 'image', 217 closeOnContentClick: false, 218 closeBtnInside: false, 219 mainClass: 'mfp-with-zoom mfp-img-mobile', 220 image: { 221 verticalFit: true, 222 }, 223 gallery: { 224 enabled: true 225 }, 226 zoom: { 227 enabled: true, 228 duration: 300, 229 opener: function(element) { 230 return element.find('img'); 231 } 232 }, 233 }); 234 }); 235 }, 236 /* --------------------------------------------- 237 Gallery Two 238 --------------------------------------------- */ 239 gallary_two: function () { 240 var check_rtl = pick.check_rtl; 241 if (check_rtl == 0) { 242 var check_rtl = false; 243 } else { 244 var check_rtl = true; 245 } 246 247 var $sync1 = $(".full-view"), 248 $sync2 = $(".list-view"), 249 duration = 300; 250 251 $sync1 252 .owlCarousel({ 253 rtl:check_rtl, 254 items: 1, 255 margin: 10, 256 nav : true, 257 navText: ["<i class='fa fa-angle-left'></i>","<i class='fa fa-angle-right'></i>"], 258 owl2row: 'true', 259 owl2rowTarget: 'item' 260 }) 261 .on('changed.owl.carousel', function (e) { 262 var syncedPosition = syncPosition(e.item.index); 263 if ( syncedPosition != "stayStill" ) { 264 $sync2.trigger('to.owl.carousel', [syncedPosition, duration, true]); 265 } 266 }); 267 $('.full-view .item').on('click',function(e){ 268 e.preventDefault(); 269 $sync1.magnificPopup({ 270 delegate: 'a', 271 type: 'image', 272 closeOnContentClick: false, 273 closeBtnInside: false, 274 mainClass: 'mfp-with-zoom mfp-img-mobile', 275 image: { 276 verticalFit: true, 277 }, 278 gallery: { 279 enabled: true 280 }, 281 zoom: { 282 enabled: true, 283 duration: 300, 284 opener: function(element) { 285 return element.find('img'); 286 } 287 }, 288 }); 289 }); 290 if (typeof pick !== 'undefined') { 291 var owl_item = pick.owl_item; 292 } 293 294 var check_rtl = pick.check_rtl; 295 if (check_rtl == 0) { 296 var check_rtl = false; 297 } else { 298 var check_rtl = true; 299 } 300 $sync2 301 .owlCarousel({ 302 rtl:check_rtl, 303 margin: 5, 304 items: owl_item, 305 nav: false, 306 center: false, 307 dots: false, 308 responsive:{ 309 280:{ 310 items:2 311 }, 312 500:{ 313 items:2 314 }, 315 600:{ 316 items:3 317 }, 318 800:{ 319 items:4 320 }, 321 1000:{ 322 items:5 323 }, 324 1200:{ 325 items:5 326 }, 327 1400:{
328 items:5 329 }, 330 } 331 }) 332 .on('initialized.owl.carousel', function() { 333 addClassCurrent(0); 334 }) 335 .on('click', '.owl-item', function () { 336 $sync1.trigger('to.owl.carousel', [$(this).index(), duration, true]); 337 338 }); 339 function addClassCurrent( index ) { 340 $sync2 341 .find(".owl-item.active") 342 .removeClass("current") 343 .eq( index ) 344 .addClass("current"); 345 } 346 addClassCurrent(0); 347 function syncPosition( index ) { 348 addClassCurrent( index ); 349 var itemsNo = $sync2.find(".owl-item").length; 350 var visibleItemsNo = $sync2.find(".owl-item.active").length; 351 352 if (itemsNo === visibleItemsNo) { 353 return "stayStill"; 354 } 355 var visibleCurrentIndex = $sync2.find(".owl-item.active").index( $sync2.find(".owl-item.current") ); 356 if (visibleCurrentIndex == 0 && index != 0) { 357 return index - 1; 358 } 359 if (visibleCurrentIndex == (visibleItemsNo - 1) && index != (itemsNo - 1)) { 360 return index - visibleItemsNo + 2; 361 } 362 return "stayStill"; 363 } 364 }, 365 /* --------------------------------------------- 366 Justified Gallery 367 --------------------------------------------- */ 368 gallery_justified: function () { 369 if ($('.pick-theme-tiled-gallery').length) { 370 if (typeof pick !== 'undefined') { 371 var tiled_gallery_row_height = pick.tiled_gallery_row_height; 372 } 373 var tiledItemSpacing = 4; 374 $('.pick-theme-tiled-gallery').wrap('<div class="pick-theme-tiled-gallery-row"></div>'); 375 $('.pick-theme-tiled-gallery').parent().css('margin', -tiledItemSpacing); 376 $('.pick-theme-tiled-gallery').justifiedGallery({ 377 rowHeight: tiled_gallery_row_height, 378 lastRow: 'justify', 379 maxRowHeight: '200%', 380 margins: tiledItemSpacing, 381 waitThumbnailsLoad: false 382 }); 383 } 384 $('.pick-theme-tiled-gallery').magnificPopup({ 385 delegate: 'a', 386 type: 'image', 387 closeOnContentClick: false, 388 closeBtnInside: false, 389 mainClass: 'pp-gallery mfp-with-zoom mfp-img-mobile', 390 image: { 391 verticalFit: true, 392 }, 393 gallery: { 394 enabled: true 395 }, 396 zoom: { 397 enabled: true, 398 duration: 300, 399 opener: function(element) { 400 return element.find('img'); 401 } 402 }, 403 }); 404 }, 405 /* --------------------------------------------- 406 Image Background 407 --------------------------------------------- */ 408 image_bg: function () { 409 $.fn.bgImage = function() { 410 $(this).each(function() { 411 var $image = $(this).find('img'); 412 var imageSource = $image.attr('src'); 413 $image.css('visibility','hidden'); 414 $(this).css('backgroundImage', 'url(' + imageSource + ')'); 415 if(!$image.length) { 416 $(this).css('backgroundImage', 'none'); 417 } 418 }); 419 }; 420 $('#author-image-bg').bgImage(); 421 $('.related-post .post-media').bgImage(); 422 }, 423 424 /* --------------------------------------------- 425 Chat More Button fix 426 --------------------------------------------- */ 427 chat_more_button: function() { 428 if ($('.chat-text p .more-link').length) { 429 $('.chat-text p .more-link').detach().appendTo('#readmore-add'); 430 } 431 }, 432 /* --------------------------------------------- 433 Related Post Image Height Fix 434 --------------------------------------------- */ 435 related_post: function () { 436 $.fn.fixedHeight = function() { 437 var maxHeight = 0; 438 $(this).each(function() { 439 var prevHeight = $(this).height(); 440 var thisHeight = $(this).height('auto').height(); 441 $(this).height(prevHeight); 442 maxHeight = (maxHeight > thisHeight ? maxHeight : thisHeight); 443 var video = $(this).find('.fluid-width-video-wrapper') || $(this).find('.mejs-container'); 444 if(video) { 445 video.parent().height('auto'); 446 video.css('height', '' + maxHeight + 'px'); 447 } 448 }); 449 $(this).height(maxHeight); 450 }; 451 $('.related-post .post-media').fixedHeight(); 452 }, 453 454 /* --------------------------------------------- 455 Author Skill 456 --------------------------------------------- */ 457 skill: function () { 458 if($('#author-skill').length) { 459 $('#author-skill .skill-one').circliful(); 460 } 461 }, 462 /* --------------------------------------------- 463 Google Maps 464 --------------------------------------------- */ 465 maps: function () { 466 if ($('#gmaps').length) { 467 var map; 468 if (typeof pick !== 'undefined') { 469 var lat = pick.lat; 470 var lon = pick.lon; 471 var map_mouse_wheel = pick.map_mouse_wheel; 472 var map_zoom_control = pick.map_zoom_control; 473 var map_point_img = pick.map_point_img; 474 } 475 map = new GMaps({ 476 el: '#gmaps', 477 lat: lat, 478 lng: lon, 479 scrollwheel: map_mouse_wheel, 480 zoom: 10, 481 zoomControl: map_zoom_control, 482 panControl: false, 483 streetViewControl: false, 484 mapTypeControl: false, 485 overviewMapControl: false, 486 clickable: false 487 }); 488 489 var image = map_point_img; 490 map.addMarker({ 491 lat: lat, 492 lng: lon, 493 icon: image, 494 animation: google.maps.Animation.DROP, 495 verticalAlign: 'bottom', 496 horizontalAlign: 'center' 497 }); 498 var styles = [{ 499 "featureType": "road", 500 "stylers": [{ 501 "color": "#b4b4b4" 502 }] 503 }, { 504 "featureType": "water", 505 "stylers": [{ 506 "color": "#d8d8d8" 507 }] 508 }, { 509 "featureType": "landscape", 510 "stylers": [{ 511 "color": "#f1f1f1" 512 }] 513 }, { 514 "elementType": "labels.text.fill", 515 "stylers": [{ 516 "color": "#000000" 517 }] 518 }, { 519 "featureType": "poi", 520 "stylers": [{ 521 "color": "#d9d9d9" 522 }] 523 }, { 524 "elementType": "labels.text", 525 "stylers": [{ 526 "saturation": 1 527 }, { 528 "weight": 0.1 529 }, { 530 "color": "#000000" 531 }] 532 }] 533 } 534 }, 535 /* --------------------------------------------- 536 Scroll To Top 537 --------------------------------------------- */ 538 scroll_top: function () { 539 $("body").append("<a href='#top' id='scroll-top' class='topbutton btn-hide'><span class='glyphicon glyphicon-menu-up'></span></a>"); 540 var $scrolltop = $('#scroll-top'); 541 $(window).on('scroll', function() { 542 if($(this).scrollTop() > $(this).height()) { 543 $scrolltop 544 .addClass('btn-show') 545 .removeClass('btn-hide'); 546 } else { 547 $scrolltop 548 .addClass('btn-hide') 549 .removeClass('btn-show'); 550 } 551 }); 552 $("a[href='#top']").on('click', function() { 553 $("html, body").animate({ 554 scrollTop: 0 555 }, "normal"); 556 return false; 557 }); 558 $('[data-toggle="tooltip"]').tooltip(); 559 }, 560 /* --------------------------------------------- 561 If WP Admin bar Come 562 --------------------------------------------- */ 563 wp_adminbar: function() { 564 // This function gets called with the user has scrolled the window. 565 $(window).on('scroll', function() { 566 if ($(this).scrollTop() > 0) { 567 // Add the scrolled class to those elements that you want changed 568 $(".top-menu.menuopen").addClass("scroll"); 569 } else { 570 $(".top-menu.menuopen").removeClass("scroll"); 571 } 572 }); 573 }, 574 pick_theme_initializ: function () { 575 pickApp.preloader(); 576 pickApp.top_search(); 577 pickApp.menu(); 578 pickApp.smoothscroll(); 579 pickApp.video(); 580 pickApp.featured_area(); 581 pickApp.masonry(); 582 pickApp.sticky(); 583 pickApp.gallary_one(); 584 pickApp.gallary_two(); 585 pickApp.gallery_justified(); 586 pickApp.image_bg(); 587 pickApp.chat_more_button(); 588 pickApp.related_post(); 589 pickApp.skill(); 590 pickApp.maps(); 591 pickApp.scroll_top(); 592 pickApp.wp_adminbar(); 593 } 594 }; 595 /* --------------------------------------------- 596 Document Ready Function 597 --------------------------------------------- */ 598 $(function() { 599 pickApp.pick_theme_initializ(); 600 });
601})(jQuery);
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.