1 2 3jQuery(window).resize(function(e) { 4 articleHeadlinePos(); 5 specialDesignArticleHeight(); 6 mobileMenuTrigger(); 7 attachmentArrowPosition(); 8 removeShareButtonsForSmallImg(); 9 singleStuff(); 10 addDecoTriangle(); 11 toggleSubCatTravelContainer(); 12}); 13 14jQuery(window).load(function(){ 15 specialDesignArticleHeight(); // load it again to be true that it worked 16 //specialDesignTopDistance(); 17}); 18 19 20jQuery(document).ready(function ($) { 21 firefoxCheck(); 22 articleHeadlinePos(); 23 mobileMenuTrigger(); 24 attachmentArrowPosition(); 25 removeShareButtonsForSmallImg(); 26 singleStuff(); 27 addDecoTriangle(); 28 29 specialDesignTopDistance(); 30 specialDesignArticleHeight(); 31 32 toggleSubCatTravelContainer(); 33 toggleReplyBtn(); 34}); 35 36function toggleReplyBtn() { 37 jQuery('.comment-reply-link').bind('click touchstart', function() { 38 jQuery('.comment-reply-link').show(); 39 jQuery(this).hide(); 40 }); 41 42 jQuery('#cancel-comment-reply-link').bind('click touchstart', function() { 43 jQuery('.comment-reply-link').show(); 44 }); 45} 46 47function articleHeadlinePos() { 48 49 // Change Headline Position 50 jQuery( ".article__headlineLink" ).each(function( index ) { 51 //console.log( index + ": " + jQuery( this ).text() ); 52 var element = jQuery( this ); 53 54 // wenn nicht special Design 55 if(!element.parents('.article__specialDesign').length){ 56 57 var height = element.outerHeight(); 58 var windowWidth = window.innerWidth; 59 60 if(windowWidth > 550) 61 { 62 if (height < 80) { 63 element.css('top', 280 + 'px'); 64 } 65 else if (height > 200 && height < 250) { 66 element.css('top', 100 + 'px'); 67 } 68 69 else if (height > 250 && height < 320) { 70 element.css('top', 120 + 'px'); 71 } 72 73 else if (height >= 320) { 74 element.css('top', 120 + 'px'); 75 element.css('width', 350 + 'px'); 76 } 77 } 78 else if(windowWidth <= 550 && windowWidth > 470){ 79 if (height < 80) { 80 element.css('top', 150 + 'px'); 81 } 82 if (height > 200) { 83 element.css('top', 80 + 'px'); 84 } 85 } 86 else if(windowWidth <= 470 && windowWidth > 400){ 87 if (height < 80) { 88 element.css('top', 120 + 'px'); 89 } 90 if (height > 130) { 91 element.css('top', 80 + 'px'); 92 } 93 } 94 else if(windowWidth <= 400){ 95 if (height < 80) { 96 element.css('top', 80 + 'px'); 97 } 98 if (height > 120) { 99 element.css('top', 60 + 'px'); 100 } 101 } 102 103 //console.log("ww: " + windowWidth); 104 //console.log(height); 105 } 106 }); 107} 108 109function addDecoTriangle() { 110 111 var windowWidth = window.innerWidth; 112 if(windowWidth > 900) { 113 // --> index.php 114 if (!jQuery('body').hasClass('single') && (!jQuery('body').hasClass('search'))) { 115 if (jQuery(".article").length) { 116 // Deco Element (triangle) --> left 117 var article3 = jQuery(".article:nth-child(4)"); 118 var article3Pos = article3.position(); 119 120 // Deco Element (triangle) --> right 121 var article5 = jQuery(".article:nth-child(2)"); 122 var article5Pos = article5.position(); 123 124 jQuery(window).ready(function ($) { 125 $('.content').append('<style>.decoElements:before{top: ' + article3Pos.top + 'px;}</style>'); 126 $('.content').append('<style>.decoElements:after{top: ' + (article5Pos.top + 250) + 'px;}</style>'); 127 }); 128 129 } 130 } 131 // --> single.php 132 else if (jQuery('body').hasClass('single') && !jQuery('body').hasClass('attachment')) { 133 //console.log('single'); 134 135 var articleHeight = jQuery('.article').height(); 136 //console.log(articleHeight); 137 138 139 if (articleHeight >= 5000) { 140 jQuery(window).ready(function ($) { 141 $('.content').append('<style>.decoElements:before{top: ' + (articleHeight / 2.5) + 'px;}</style>'); 142 }); 143 } 144 else { 145 jQuery(window).ready(function ($) { 146 $('.content').append('<style>.decoElements:before{display: none}</style>'); 147 }); 148 } 149 } 150 } 151} 152 153function singleStuff() { 154 155 if (jQuery('body').hasClass('single') && !jQuery('body').hasClass('attachment')) { 156 // remove unwanted <br> tags in gallery 157 jQuery('.gallery').find('br').remove(); 158 159 // mobile: related posts 160 jQuery('.related-post__post:nth-child(1)').on("mouseenter", function () { 161 jQuery('.yarpp-related').addClass("showFirst") 162 }).on("mouseleave", function () { 163 jQuery('.yarpp-related').removeClass("showFirst") 164 165 }); 166 167 jQuery('.related-post__post:nth-child(3)').on("mouseenter", function () { 168 jQuery('.yarpp-related').addClass("showLast") 169 }).on("mouseleave", function () { 170 jQuery('.yarpp-related').removeClass("showLast") 171 172 }); 173 } 174} 175 176function specialDesignArticleHeight() { 177 178 if ( !jQuery( 'body' ).hasClass( 'attachment' ) && !jQuery( 'body' ).hasClass( 'single' )) { 179 180 setTimeout(function () { 181 jQuery(".article__specialDesign").each(function (index) { 182 var windowWidth = window.innerWidth; 183 if (windowWidth > 550) { 184 185 var article = jQuery(this); 186 var content = article.find(".article__content"); 187 var img = article.find(".article__img"); 188 var headline = article.find(".article__headline"); 189 var shopThePost = article.find(".article__shopThePost"); 190 191 var contentHeight = content.outerHeight(); 192 var imgHeight = img.outerHeight(); 193 var headlineHeight = headline.outerHeight(); 194 //var shopThePostHeight = shopThePost.height(); 195 var shopThePostHeight = 200; 196 197 /* console.log("special design: article " + index + " height: " + contentHeight); 198 console.log("headline height: " + headlineHeight);*/ 199 200 // set article height 201 var newHeight; 202 203 if (!shopThePost.length) { 204 if(contentHeight >= imgHeight){ 205 newHeight = contentHeight + 30; 206 } 207 else{ 208 newHeight = (imgHeight+50) + 30; 209 } 210 } 211 else { 212 if(contentHeight >= imgHeight) { 213 newHeight = contentHeight + shopThePostHeight + 30; 214 } 215 else{ 216 newHeight = (imgHeight+50) + shopThePostHeight + 30; 217 } 218 } 219 220 content.css('padding-top', headlineHeight + 13); 221 222 223 // set distance between shopthepost widget 224 if (contentHeight > imgHeight) { 225 if (shopThePost.length) { 226 var newDistance = contentHeight - imgHeight -40; 227 shopThePost.find(".article__shopThePostHeadline").css('padding-top', newDistance + 'px'); 228 229 article.css('height', (newHeight + newDistance -80) + 'px'); 230 } 231 else{ 232 article.css('height', newHeight + 'px'); 233 } 234 235 } 236 else{ 237 article.css('height', newHeight + 'px'); 238 } 239 } 240 241 }); 242 }, 300); 243 } 244} 245 246function specialDesignTopDistance() { 247 248 if ( !jQuery( 'body' ).hasClass( 'attachment' )) { 249 if (jQuery("article").first().hasClass('article__specialDesign')) { 250 jQuery('.content-wrapper').addClass('moreDistance'); 251 } 252 } 253} 254 255function attachmentArrowPosition() { 256 257 if ( jQuery( 'body' ).hasClass( 'attachment' ) ) { 258 259 var windowWidth = window.innerWidth; 260 if(windowWidth > 970) { 261 262 var attachementIMG = jQuery('.attachment-850x850'); 263 var imgWidth = attachementIMG.width(); 264
265 if(imgWidth < 850){ 266 //console.log("attachment-width: " + imgWidth); 267 jQuery('.attachment__arrow--left').css('left', (425 - (imgWidth / 2))); 268 jQuery('.attachment__arrow--right').css('right', (425 - (imgWidth / 2))); 269 } 270 } 271 } 272} 273 274function removeShareButtonsForSmallImg() { 275 if (jQuery('body').hasClass('single')) { 276 jQuery(".imageShareWrapper").each(function (index) { 277 var windowWidth = window.innerWidth; 278 if (windowWidth > 550) { 279 var wrapper = jQuery(this); 280 var img = wrapper.find('img'); 281 var imgWidth = img.width(); 282 283 if (imgWidth < 850) { 284 wrapper.addClass('hideimageShareWrapper'); 285 } 286 } 287 }); 288 } 289} 290 291function mobileMenuTrigger() { 292 293 var windowWidth = window.innerWidth; 294 if(windowWidth <= 550) { 295 296 var touchmoved = false; 297 298 // mobile trigger 299 jQuery("#mobileMenuTrigger, .mobileMenuTrigger").on('touchmove', function(e){ 300 touchmoved = true; 301 302 // do moving stuff 303 }).on('touchstart', function(e){ 304 touchmoved = false; 305 306 }).on('click touchend', function (e) { 307 e.stopPropagation(); 308 e.preventDefault(); 309 e.stopImmediatePropagation(); 310 311 if(touchmoved != true) 312 { 313 jQuery('.mobileMenuBackground, .header__rightCornerBlock, .mobileMenuTrigger__closeIcon, .mobileMenuTrigger__openIcon').toggle(); 314 315 } 316 317 }); 318 } 319} 320 321function firefoxCheck() { 322 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1){ 323 console.log("Firefox"); 324 325 jQuery("body").addClass("Firefox"); 326 } 327} 328 329function toggleSubCatTravelContainer() { 330 let windowWidth = window.innerWidth; 331 let trigger = '.categoryTravel, .categoryTravelContainer'; 332 jQuery(trigger).off('mouseenter'); 333 334 if(windowWidth > 550){ 335 // dynmic heigth of decoBorder Element 336 let heigth = jQuery('.categoryTravelContainer').height(); 337 jQuery('.decoBorder').css('height', heigth + 39); 338 339 jQuery(trigger).mouseenter(function () { 340 jQuery('.categoryTravel').addClass('active'); 341 jQuery('.categoryTravelContainer').show(); 342 343 }).mouseleave(function () { 344 jQuery('.categoryTravel').removeClass('active'); 345 jQuery('.categoryTravelContainer').hide(); 346 }); 347 } else { 348 if(jQuery('.categoryTravel').has('.sub-menu').length === 0) { 349 jQuery('.categoryTravel').append(jQuery(".categoryTravelContainer").html()); 350 } 351 } 352}
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.