1// --------------------------------------------------------- 2// !!!!!!!!!!!!!!!!!document ready!!!!!!!!!!!!!!!!!!!!!!!!!! 3// --------------------------------------------------------- 4jQuery(document).ready(function(){ 5// --------------------------------------------------------- 6// Blog masonry 7// --------------------------------------------------------- 8 if(jQuery('body.blog')[0]){ 9 var isotope_holder = jQuery('.isotope'); 10 isotope_holder.imagesLoaded( function() { 11 isotope_holder.isotope({ 12 itemSelector : '.post_wrapper', 13 hiddenClass : 'hidden', 14 resizable : true, 15 transformsEnabled : false, 16 layoutMode: 'masonry' 17 }).bind("resize.rainbows", function(){ 18 isotope_holder.isotope('reLayout'); 19 }).trigger("resize.rainbows").css({'visibility':'visible'}); 20 }); 21 } 22// --------------------------------------------------------- 23// Call Magnific Popup 24// --------------------------------------------------------- 25 jQuery(".thumbnail").parent().each(function(){magnific_popup_init(jQuery(this))}); 26// --------------------------------------------------------- 27// Tooltip 28// --------------------------------------------------------- 29 jQuery("[rel='tooltip']").tooltip(); 30// --------------------------------------------------------- 31// Back to Top 32// --------------------------------------------------------- 33 jQuery(window).scroll(function () { 34 if (jQuery(this).scrollTop() > 100) { 35 jQuery('#back-top').fadeIn(); 36 } else { 37 jQuery('#back-top').fadeOut(); 38 } 39 }); 40 jQuery('#back-top a').click(function () { 41 jQuery('body,html').stop(false, false).animate({ 42 scrollTop: 0 43 }, 800); 44 return false; 45 }); 46// --------------------------------------------------------- 47// Add accordion active class 48// --------------------------------------------------------- 49 jQuery('.accordion').on('show', function (e) { 50 jQuery(e.target).prev('.accordion-heading').find('.accordion-toggle').addClass('active'); 51 }); 52 jQuery('.accordion').on('hide', function (e) { 53 jQuery(this).find('.accordion-toggle').not(jQuery(e.target)).removeClass('active'); 54 });
55// --------------------------------------------------------- 56// Isotope Init 57// --------------------------------------------------------- 58 jQuery("#portfolio-grid").css({"visibility" : "visible"}); 59// --------------------------------------------------------- 60// Menu Android 61// --------------------------------------------------------- 62 if(window.orientation!=undefined){ 63 var regM = /ipod|ipad|iphone/gi, 64 result = navigator.userAgent.match(regM) 65 if(!result) { 66 jQuery('.sf-menu li').each(function(){ 67 if(jQuery(">ul", this)[0]){ 68 jQuery(">a", this).toggle( 69 function(){ 70 return false; 71 }, 72 function(){ 73 window.location.href = jQuery(this).attr("href"); 74 } 75 ); 76 } 77 }) 78 } 79 } 80// --------------------------------------------------------- 81// images loader 82// --------------------------------------------------------- 83 var MSIE8 = (jQuery.browser.msie) && (jQuery.browser.version == 8); 84 jQuery('img[data-src]').bind('load', img_load_complete); 85 jQuery(window).bind('resize', img_loader).bind('scroll', img_loader).trigger('scroll'); 86 87 function img_loader(){ 88 var get_img = jQuery('img[data-src]').eq(0) 89 if(get_img[0]){ 90 var visible_height = jQuery(window).scrollTop() + jQuery(window).height(), 91 img_top_position = get_img.offset().top; 92 93 if(img_top_position<visible_height){ 94 get_img.attr({'src':get_img.attr('data-src')}).removeAttr('data-src'); 95 if(!MSIE8){ 96 get_img.fadeOut(0) 97 } 98 }; 99 }else{ 100 jQuery(window).unbind('resize', img_loader).unbind('scroll', img_loader); 101 } 102 } 103 function img_load_complete(){ 104 jQuery(this).unbind('load'); 105 if(!MSIE8){ 106 jQuery(this).fadeIn(500) 107 } 108 if(jQuery('body.blog')[0]){ 109 isotope_holder.isotope('reLayout'); 110 } 111 img_loader(); 112 } 113// --------------------------------------------------------- 114// set voting post JS 115// --------------------------------------------------------- 116 jQuery('.ajax_voting').bind('click', voitng); 117 function voitng(){ 118 var item= jQuery(this), 119 item_parent = item.parents('[class*="meta_type"]'), 120 type = item.attr('date-type'), 121 item_class='user_'+type, 122 count = parseInt(jQuery('.voting_count', item).text()), 123 top_position = (type==='like') ? -18 : 18 , 124 mark = (type==='like') ? '+' : '-', 125 post_url = item.attr('href'); 126 127 jQuery('.post_like>a, .post_dislike>a', item_parent).unbind('click', voitng).removeAttr('href date-type').removeClass('ajax_voting').addClass('user_voting'); 128 item.removeClass('user_voting').addClass(item_class).find('.voting_count').text(++count).append('<span class="animation_item">'+mark+'1</span>'); 129 jQuery('.animation_item', item).stop(true).animate({'top':top_position, opacity:'0'}, 500, 'easeOutCubic', function(){jQuery(this).remove()}); 130 131 jQuery.post(post_url); 132 return false; 133 } 134// --------------------------------------------------------- 135// Contact form loader 136// --------------------------------------------------------- 137 jQuery('.wpcf7-submit').after('<div class="ajax-loader"></div>'); 138 jQuery('.wpcf7-submit').click(function(){ 139 var listener = setInterval( 140 function(){ 141 if(jQuery('img.ajax-loader').css('visibility')=='visible'){ 142 jQuery('div.ajax-loader').css({'display':'inline-block'}); 143 }else{ 144 jQuery('div.ajax-loader').css({'display':'none'}); 145 clearInterval(listener); 146 } 147 },100); 148 }) 149// --------------------------------------------------------- 150// Contact form notvalid tip fadeOut 151// --------------------------------------------------------- 152 jQuery(function() { 153 // clear cf7 error msg on mouseover 154 jQuery(".wpcf7-form-control-wrap").on("mouseover", function(){ 155 jQuery("span.wpcf7-not-valid-tip", this).fadeOut(); 156 }); 157 }); 158// --------------------------------------------------------- 159// Cookie Banner 160// --------------------------------------------------------- 161 jQuery('#cf-cookie-banner .close').click(function() { 162 createCookie('cf-cookie-banner', 1, 365); 163 }); 164}); 165// --------------------------------------------------------- 166// Magnific Popup Init 167// --------------------------------------------------------- 168function magnific_popup_init(item) { 169 item.magnificPopup({ 170 delegate: 'a[rel^="prettyPhoto"]', 171 type: 'image', 172 removalDelay: 500, 173 mainClass: 'mfp-zoom-in', 174 callbacks: { 175 beforeOpen: function() { 176 // just a hack that adds mfp-anim class to markup 177 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 178 } 179 }, 180 gallery: {enabled:true} 181 }); 182} 183// --------------------------------------------------------- 184// Cookie utilities 185// --------------------------------------------------------- 186function createCookie(name, value, days) { 187 if (days) { 188 var date = new Date(); 189 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 190 var expires = "; expires=" + date.toGMTString() 191 } else var expires = ""; 192 document.cookie = name + "=" + value + expires + "; path=/" 193} 194function deleteCookie(name) { 195 createCookie( name, "", { expires: -1 } ); 196}
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.