// --------------------------------------------------------- // Magnific Popup Init // --------------------------------------------------------- function magnific_popup_init(item) { item.magnificPopup({ delegate: 'a[rel^="prettyPhoto"]', type: 'image', removalDelay: 500, mainClass: 'mfp-zoom-in', callbacks: { beforeOpen: function() { // just a hack that adds mfp-anim class to markup this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); } }, gallery: {enabled:true} }); } // --------------------------------------------------------- // !!!!!!!!!!!!!!!!!document ready!!!!!!!!!!!!!!!!!!!!!!!!!! // --------------------------------------------------------- jQuery(document).ready(function(){ // --------------------------------------------------------- // Call Magnific Popup // --------------------------------------------------------- jQuery(".thumbnail").parent().each(function(){magnific_popup_init(jQuery(this))}); // --------------------------------------------------------- // Tooltip // --------------------------------------------------------- jQuery("[rel='tooltip']").tooltip(); // --------------------------------------------------------- // Back to Top // --------------------------------------------------------- jQuery(window).scroll(function () { if (jQuery(this).scrollTop() > 100) { jQuery('#back-top').fadeIn(); } else { jQuery('#back-top').fadeOut(); } }); jQuery('#back-top a').click(function () { jQuery('body,html').stop(false, false).animate({ scrollTop: 0 }, 800); return false; }); // --------------------------------------------------------- // Add accordion active class // --------------------------------------------------------- jQuery('.accordion').on('show', function (e) { jQuery(e.target).prev('.accordion-heading').find('.accordion-toggle').addClass('active'); }); jQuery('.accordion').on('hide', function (e) { jQuery(this).find('.accordion-toggle').not(jQuery(e.target)).removeClass('active'); }); // --------------------------------------------------------- // Isotope Init // --------------------------------------------------------- jQuery("#portfolio-grid").css({"visibility" : "visible"}); // --------------------------------------------------------- // Menu Android // --------------------------------------------------------- if(window.orientation!=undefined){ var regM = /ipod|ipad|iphone/gi, result = navigator.userAgent.match(regM) if(!result) { jQuery('.sf-menu li').each(function(){ if(jQuery(">ul", this)[0]){ jQuery(">a", this).toggle( function(){ return false; }, function(){ window.location.href = jQuery(this).attr("href"); } ); } }) } } // --------------------------------------------------------- // images loader // --------------------------------------------------------- var MSIE8 = (jQuery.browser.msie) && (jQuery.browser.version == 8); jQuery('img[data-src]').bind('load', img_load_complete); jQuery(window).bind('resize', img_loader).bind('scroll', img_loader).trigger('scroll'); function img_loader(){ var get_img = jQuery('img[data-src]').eq(0) if(get_img[0]){ var visible_height = jQuery(window).scrollTop() + jQuery(window).height(), img_top_position = get_img.offset().top; if(img_top_positiona, .post_dislike>a', item_parent).unbind('click', voitng).removeAttr('href date-type').removeClass('ajax_voting').addClass('user_voting'); item.removeClass('user_voting').addClass(item_class).find('.voting_count').text(++count).append(''+mark+'1'); jQuery('.animation_item', item).stop(true).animate({'top':top_position, opacity:'0'}, 500, 'easeOutCubic', function(){jQuery(this).remove()}); jQuery.post(post_url); return false; } }); /* playback timings (ms): LoadShardBlock: 176.316 (3) esindex: 0.005 captures_list: 225.364 CDXLines.iter: 11.202 (3) PetaboxLoader3.datanode: 99.308 (5) exclusion.robots.fetch: 33.286 (2) exclusion.robots: 34.076 exclusion.robots.policy: 0.289 RedisCDXSource: 0.793 PetaboxLoader3.resolve: 79.476 (2) load_resource: 115.541 */