1jQuery(document).ready(function($) { 2 3$("img.lazy:hidden").show().lazyload({ 4 effect : "fadeIn" 5 }); 6 7if($('.mc4wp-form-submitted').length){ 8 $('#newsletterregister>p, #newsletterregister>hr').hide(); 9} 10 11//MAPS 12function initializeMap() { 13 14 var latlngs=[]; 15 var latlngbounds; 16 17 var mapOptions = { 18 center: new google.maps.LatLng(49.810075,6.096725), 19 zoom: 8, 20 mapTypeId: google.maps.MapTypeId.ROADMAP, 21 panControl: false, 22 zoomControl: true, 23 mapTypeControl: true, 24 scaleControl: false, 25 streetViewControl: false, 26 overviewMapControl: false 27 }; 28 29 map = new google.maps.Map(document.getElementById("gmap"), mapOptions); 30 31 var myIcon = new google.maps.MarkerImage("../wp-content/themes/femmesmagazine/img/gmarker.png", null, null, null, new google.maps.Size(32,39)); 32 33 for(i=0;i<stations.length;i++){ 34 var point = new google.maps.LatLng(stations[i]['location']['lat'],stations[i]['location']['lng']); 35 36 37 var marker = new google.maps.Marker({ 38 39 draggable: false, 40 raiseOnDrag: false, 41 icon: myIcon, 42 map: map, 43 position: point, 44 html: '<div><h1>'+stations[i]['title']+'</h1><div>'+stations[i]['content']+'</div></div><a class="closeinfobox" onclick="infobox.close();return false;" href="#">Ã</a>' 45 }); 46 47 markers[stations[i]['pointid']]=marker; 48 latlngs.push(point); 49 50 infobox = new InfoBox({ 51 content: document.getElementById("infobox"), 52 disableAutoPan: false, 53 maxWidth: 150, 54 pixelOffset: new google.maps.Size(-75, 0), 55 zIndex: null, 56 boxStyle: { 57 width: "150px" 58 }, 59 closeBoxMargin: "0px", 60 closeBoxURL: "", 61 infoBoxClearance: new google.maps.Size(1, 1) 62 }); 63 64 google.maps.event.addListener(marker, 'click', function() { 65 for(i in markers){ 66 markers[i].setIcon(myIcon); 67 } 68 this.setIcon(new google.maps.MarkerImage("../wp-content/themes/femmesmagazine/img/gmarker_pink.png", null, null, null, new google.maps.Size(44,54))); 69 infobox.setContent(this.html); 70 infobox.open(map, this); 71 map.panTo(this.position); 72 }); 73 } 74 if(latlngs.length>1){ 75 latlngbounds = new google.maps.LatLngBounds(); 76 for (i in latlngs){ 77 latlngbounds.extend(latlngs[i]); 78 }; 79 80 map.setCenter(latlngbounds.getCenter()); 81 map.fitBounds(latlngbounds); 82 } 83 84 $(window).on('resizemymap', function(){ 85 google.maps.event.trigger(map, 'resize'); 86 map.setCenter(latlngbounds.getCenter()); 87 map.fitBounds(latlngbounds); 88 }); 89 90} 91var map; 92var infobox; 93var markers=[]; 94var current=false; 95 96// Initialize map if element exists 97if($("#gmap").length){ 98 initializeMap(); 99} 100 101//GEOCODING 102var geocoder = new google.maps.Geocoder(); 103 104$('#city').change(function(){ 105 var address = $(this).val(); 106 if(address!=''){ 107 $('.em-search-form input[type=submit]').prop('disabled', true); 108 109 geocoder.geocode({'address': address}, function(results, status) { 110 if (status === google.maps.GeocoderStatus.OK) { 111 $('#near').val(results[0].geometry.location.lat()+','+results[0].geometry.location.lng()); 112 $('.em-search-form input[type=submit]').prop('disabled', false); 113 } else { 114 alert('Geocode was not successful for the following reason: ' + status); 115 } 116 }); 117 }else{ 118 $('#near').val(''); 119 } 120}); 121 122//LAYOUT ADJUSTMENTS 123$('.sectionwithsidebar .pageright').each(function(){ 124 var prevside=$(this).prev('.pageleft'); 125 if(!prevside.length){ 126 prevside=$(this).next('.pageleft'); 127 } 128 prevside.css('min-height', $(this).height()+'px'); 129}); 130 131if($('article.single .postthumb img').length && $('article.single .postcontent .wf_caption .stphoto').length){ 132 $('article.single .postthumb figure').append('<figcaption>'+$('article.single .postcontent .wf_caption .stphoto').html()+'</figcaption>'); 133 $('article.single .postcontent .wf_caption').remove(); 134} 135 136$('h1.arrowtitle.immotitle').click(function(){ 137 $('.pageleft .immoform').toggleClass('active'); 138}); 139 140$('header .search a').click(function(e){ 141 e.preventDefault(); 142 $('#childcategories').removeClass('active'); 143 $('#searchform').addClass('active'); 144}); 145 146$('#searchform .closeform').click(function(e){ 147 e.preventDefault(); 148 $('#searchform').removeClass('active'); 149}); 150 151$('#agendaformtoggle').click(function(e){ 152 e.preventDefault(); 153 $('.em-events-search-form').toggleClass('active'); 154}); 155 156$('.agendaform .title').click(function(e){ 157 e.preventDefault(); 158 $('.agendaform').toggleClass('active'); 159}); 160 161$('.mobilemenutoggle').click(function(e){ 162 e.preventDefault(); 163 $('header nav, .mobilemenutoggle').toggleClass('active'); 164}); 165 166$('.immotrigger').click(function(e){ 167 e.preventDefault(); 168 $('.immoform, .immotrigger').toggleClass('active'); 169}); 170 171$('.subcattoggle').click(function(){ 172 $('#childcategories').toggleClass('active'); 173}); 174 175$('.mailtooptions span, .mailtooptions i').click(function(){ 176 $('.mailtooptions').toggleClass('active'); 177}); 178 179$('.mailtooptions a').click(function(e){ 180 e.preventDefault(); 181 $('.mailtooptions').removeClass('active'); 182 $('.mailtooptions span').html($(this).html()); 183 $('input[name=mailto]').val($(this).data('mail')); 184}); 185 186$('.banner .news li:first a').hover(function(){ 187 $('.news .newslettertoggle').removeClass('mag contact'); 188 $('.news .newslettertoggle a').html('Newsletter'); 189 $('.news .newslettertoggle').removeClass('contact').addClass('active'); 190}, function(){ 191 $('.news .newslettertoggle').removeClass('active'); 192}); 193 194$('.banner .news li:eq(1) a').hover(function(){ 195 $('.news .newslettertoggle').removeClass('mag contact'); 196 $('.news .newslettertoggle a').html('Contact'); 197 $('.news .newslettertoggle').addClass('active contact'); 198}, function(){ 199 $('.news .newslettertoggle').removeClass('active '); 200}); 201 202$('.banner .news li:eq(2) a').hover(function(){ 203 $('.news .newslettertoggle').removeClass('mag contact'); 204 $('.news .newslettertoggle a').html('Trouver le magazine'); 205 $('.news .newslettertoggle').addClass('active mag'); 206}, function(){ 207 $('.news .newslettertoggle').removeClass('active '); 208}); 209 210$('footer .backtotop').click(function(e){ 211 e.preventDefault(); 212 $('html, body').animate({ 213 scrollTop:0 214 }, 1000); 215}); 216 217var minOffset = 0, maxOffset = 100; 218var thisYear = new Date().getFullYear(); 219var select=$('select[name=MMERGE6]'); 220for (var i = minOffset; i <= maxOffset; i++) { 221 var year = thisYear - i; 222 $('<option>', {value: year, text: year}).appendTo(select); 223} 224 225//SWIPERS 226//initialize swiper when document ready 227var mySwiper = new Swiper ('.slider .swiper-container', { 228 // Optional parameters 229 direction: 'horizontal', 230 loop:true, 231 autoplay:5000, 232 nextButton: '.slider .swiper-button-next', 233 prevButton: '.slider .swiper-button-prev', 234 speed:700, 235 onInit:function(){ 236 applyShares(); 237 } 238}); 239 240var mySwiper2 = new Swiper ('.textslider .swiper-container', { 241 // Optional parameters 242 direction: 'vertical', 243 loop:true, 244 autoplay:3000, 245 pagination: '.textslider .swiper-pagination', 246 paginationClickable:true, 247 onInit:function(){ 248 applyShares(); 249 } 250}); 251 252var mySwiper3 = new Swiper ('.featured .swiper-container', { 253 // Optional parameters 254 direction: 'vertical', 255 loop:true, 256 autoplay:6000, 257 pagination: '.featured .swiper-pagination', 258 paginationClickable:true, 259 onInit:function(){ 260 applyShares(); 261 } 262}); 263 264//gallery swiper 265var mySwiper4 = new Swiper ('.postgallery .swiper-container', { 266 // Optional parameters 267 direction: 'horizontal', 268 loop:false, 269 slidesPerView:3, 270 nextButton: '.postgallery .swiper-button-next', 271 prevButton: '.postgallery .swiper-button-prev' 272}); 273 274var mySwiper5 = new Swiper ('.offerimagepreview .swiper-container', { 275 // Optional parameters 276 direction: 'horizontal', 277 loop:false 278}); 279 280var mySwiper6 = new Swiper ('.offerimagenav .swiper-container', { 281 // Optional parameters 282 direction: 'vertical', 283 loop:false, 284 slidesPerView:3, 285 nextButton: '.offerimagenav .swiper-button-next', 286 prevButton: '.offerimagenav .swiper-button-prev', 287 onClick:function(swiper, event){ 288 mySwiper5.slideTo(mySwiper6.clickedIndex); 289 } 290}); 291 292var mySwiper7 = new Swiper ('.offerimagepreviewonsingle .swiper-container', { 293 // Optional parameters 294 direction: 'horizontal', 295 loop:false, 296 nextButton: '.offerimagepreviewonsingle .swiper-button-next', 297 prevButton: '.offerimagepreviewonsingle .swiper-button-prev', 298 onClick:function(swiper, event){ 299 $.magnificPopup.open({ 300 type: 'inline', 301 items:{ 302 src:'#postgallery' 303 }, 304 mainClass: 'mfp-fade mfp-galleria', 305 removalDelay: 160, 306 preloader: false, 307 fixedContentPos: true, 308 closeBtnInside:true, 309 callbacks:{ 310 open:function(){ 311 Galleria.loadTheme(mygallerytheme); 312 Galleria.run('.galleria', { 313 imageCrop:false, 314 show:mySwiper7.clickedIndex 315 }); 316 }, 317 close:function(){ 318 319 } 320 } 321 }); 322 323 } 324}); 325 326//SLIDERS 327$('.rangeslider').each(function(){ 328 var min=$(this).data('min'); 329 var max=$(this).data('max'); 330 var step=$(this).data('step'); 331 var label_from=$('#'+$(this).data('from-label')); 332 var label_to=$('#'+$(this).data('to-label')); 333 var value_from=$('#'+$(this).data('from-field')); 334 var value_to=$('#'+$(this).data('to-field')); 335 var startminval=min; 336 var startmaxval=max; 337 if(value_from.val()){ 338 startminval=value_from.val(); 339 } 340 341 if(value_to.val()){ 342 startmaxval=value_to.val(); 343 } 344
345 label_from.html(parseFloat(startminval).toLocaleString('fr')); 346 label_to.html(parseFloat(startmaxval).toLocaleString('fr')); 347 348 value_from.val(startminval); 349 value_to.val(startmaxval); 350 351 $(this).slider({ 352 range:true, 353 values:[startminval,startmaxval], 354 min:min, 355 max:max, 356 357 step:step, 358 slide:function(event, ui){ 359 label_from.html(ui.values[0].toLocaleString('fr')); 360 label_to.html(ui.values[1].toLocaleString('fr')); 361 362 value_from.val(ui.values[0]); 363 value_to.val(ui.values[1]); 364 } 365 }); 366}); 367 368$('#main_immo_type_rent, #main_immo_type_sell').change(function(){ 369 //rent only 370 var mpr=$('#main_price_range'); 371 var oldmax=mpr.data('max'); 372 373 var actualmax=1200000; 374 var actualstep=1000; 375 if($('#main_immo_type_rent').is(':checked') && !$('#main_immo_type_sell').is(':checked')){ 376 actualmax=5000; 377 actualstep=200; 378 } 379 380 if(actualmax!==oldmax){ 381 mpr.data('max', actualmax); 382 mpr.data('step', actualstep); 383 mpr.slider('option', 'max', actualmax); 384 mpr.slider('option', 'step', actualstep); 385 mpr.slider( 'option', 'values', [0,actualmax]); 386 $('#'+mpr.data('from-label')).html(parseFloat('0').toLocaleString('fr')); 387 $('#'+mpr.data('to-label')).html(parseFloat(actualmax).toLocaleString('fr')); 388 console.log($('#'+mpr.data('to-label'))); 389 } 390}); 391 392//POPUPS 393$('.open-popup-link').magnificPopup({ 394 type:'inline', 395 midClick: true, // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href. 396 mainClass: 'mfp-fade mfp-map', 397 callbacks:{ 398 beforeOpen:function(){ 399 $(window).trigger('resizemymap'); 400 myid=(this.st.el.data('pointid')); 401 if(typeof myid !== 'undefined'){ 402 for(i in markers){ 403 markers[i].setVisible(false); 404 } 405 markers[myid].setVisible(true); 406 infobox.setContent(markers[myid].html); 407 infobox.open(map, markers[myid]); 408 409 currentmarker=markers[myid]; 410 }else{ 411 for(i in markers){ 412 markers[i].setVisible(true); 413 } 414 currentmarker=false; 415 } 416 }, 417 open:function(){ 418 $(window).trigger('resizemymap'); 419 if(currentmarker){ 420 map.panTo(currentmarker.position); 421 }else{ 422 infobox.close(); 423 } 424 } 425 } 426}); 427 428$('a[href="#newsletterregister"]').magnificPopup({ 429 type:'inline', 430 callbacks:{ 431 open:function(){ 432 $('#mc4wp-form-1 input[name=EMAIL]').val($('#prenewsletter').val()); 433 } 434 } 435}); 436 437// Newsletter form submission popup 438if($('#mc4wp-form-1').hasClass('mc4wp-form-submitted')){ 439 $.magnificPopup.open({ 440 type:'inline', 441 items:{ 442 src:'#newsletterregister' 443 } 444 }); 445} 446 447// Auto popups 448if(typeof autopopup !== 'undefined'){ 449 if(autopopup=='newsletter'){ 450 $.magnificPopup.open({ 451 type:'inline', 452 items:{ 453 src:'#newsletterregister' 454 } 455 }); 456 }else if(autopopup=='facebook'){ 457 $.magnificPopup.open({ 458 type:'inline', 459 items:{ 460 src:'#facebookpopup' 461 }, 462 callbacks:{ 463 open:function(){ 464 $('#nothanks').click(function(e){ 465 e.preventDefault(); 466 $.magnificPopup.close(); 467 }); 468 } 469 } 470 }); 471 }else if(autopopup=='imagelink'){ 472 $.magnificPopup.open({ 473 type:'inline', 474 items:{ 475 src:'#imagepopup' 476 }, 477 callbacks:{ 478 open:function(){ 479 $('#nothanks').click(function(e){ 480 e.preventDefault(); 481 $.magnificPopup.close(); 482 }); 483 } 484 } 485 }); 486 } 487} 488 489$('.offerimagepreview a').magnificPopup({ 490 type:'image', 491 gallery:{ 492 enabled:true 493 } 494}); 495 496$('.offerimagepreviewonsingle a').click(function(e){ 497 e.preventDefault(); 498}); 499 500$('.interstitial').click(function(){ 501 $('.pagewrapper').addClass('active'); 502 setTimeout(function(){ 503 $('.interstitial').remove(); 504 }, 600); 505}); 506 507$('.postthumb figure a').magnificPopup({ 508 /*type:'image', 509 gallery:{ 510 enabled:true 511 }*/ 512 type: 'inline', 513 mainClass: 'mfp-fade mfp-galleria', 514 removalDelay: 160, 515 preloader: false, 516 fixedContentPos: true, 517 closeBtnInside:true, 518 callbacks:{ 519 open:function(){ 520 Galleria.loadTheme(mygallerytheme); 521 Galleria.run('.galleria', { 522 imageCrop:false 523 }); 524 }, 525 close:function(){ 526 527 } 528 } 529}); 530/* 531$('.postthumb figure a').click(function(e){ 532 e.preventDefault(); 533 $('.postgallery a:first').trigger('click'); 534});*/ 535 536//AJAX CALLS 537if($('.pageleft .immoform').length){ 538 var originalfilters=$('.pageleft .immoform').serialize(); 539} 540 541$('.immoform #place').autocomplete({ 542 source:function(request, response){ 543 $.ajax({ 544 url: ajaxurl, 545 dataType: "json", 546 data: { 547 action:'getPlaces', 548 q: request.term 549 }, 550 success: function( data ) { 551 response( data ); 552 } 553 }); 554 }, 555 minLength:3 556}); 557 558$('#loadmore .ready').click(function(){ 559 $('#loadmore').addClass('working'); 560 561 var params={ 562 url:ajaxurl, 563 data:{ 564 excludes:excludes, 565 action:'morePosts' 566 }, 567 success:function(response){ 568 if(typeof isimmo !== 'undefined'){ 569 $('.immoresults').append(response); 570 if($('.immoresults li.new').length==0){ 571 $('#loadmore').empty().remove(); 572 }else{ 573 $('.immoresults li.new').each(function(){ 574 excludes.push('!'+$(this).data('postid')); 575 $(this).removeClass('new'); 576 }); 577 } 578 }else if(typeof blogcategory!=='undefined'){ 579 $('.grid').isotope('insert', $(response)); 580 $('.grid').imagesLoaded(function(){ 581 $('.grid').isotope('layout'); 582 583 if($('.grid .item.new').length==0){ 584 $('#loadmore').empty().remove(); 585 } 586 587 $('.grid .item.new').each(function(){ 588 excludes.push($(this).data('id')); 589 }); 590 $('.grid .item.new').removeClass('new'); 591 }); 592 }else{ 593 $('#newscontainer').append(response); 594 if($('#newscontainer article.new').length==0){ 595 $('#loadmore').empty().remove(); 596 }else{ 597 $('#newscontainer article.new').each(function(){ 598 if(typeof issearch === 'undefined'){ 599 excludes.push($(this).data('postid')); 600 } 601 $(this).removeClass('new'); 602 }); 603 } 604 } 605 $('#loadmore').removeClass('working'); 606 applyShares(); 607 $('img.lazy:hidden').show().lazyload({ 608 effect : "fadeIn" 609 }); 610 } 611 }; 612 613 if(typeof pagecategory !== 'undefined'){ 614 params.data.category=pagecategory; 615 }else if(typeof issearch !== 'undefined'){ 616 params.data.s=issearch; 617 currentPage++; 618 params.data.currentPage=currentPage; 619 }else if(typeof blogcategory!=='undefined'){ 620 params.data.blogcategory=blogcategory; 621 } 622 else if(typeof isimmo !== 'undefined'){ 623 params.url=params.url+'?'+originalfilters; 624 isimmo=isimmo+1; 625 params.data.isimmo = 1; 626 params.data.currentPage = isimmo; 627 params.data.excludes=excludes; 628 } 629 630 $.ajax(params); 631}); 632 633//VALIDATIONS 634$('#offercontactform').validate({ 635 rules: { 636 name: { 637 required: true 638 }, 639 email:{ 640 required:function(el){ 641 return $('#cagent_tel:empty'); 642 }, 643 email:true 644 }, 645 phone:{ 646 required:function(el){ 647 return $('#cagent_email:empty'); 648 } 649 }, 650 message:{ 651 required:true 652 } 653 }, 654 messages:{ 655 name:'Merci d\'indiquer votre nom', 656 email:{ 657 required:'Merci d\'indiquer votre email et/ou votre téléphone', 658 email:'L\'adresse email semble invalide' 659 }, 660 phone:{ 661 required:'Merci d\'indiquer votre email et/ou votre téléphone', 662 }, 663 message:'Merci d\'écrire le message à envoyer' 664 }, 665 submitHandler: function (form) { // for demo 666 $.ajax({ 667 url: ajaxurl+'?'+$('#offercontactform').serialize(), 668 data:{action: 'contactOffer'}, 669 cache:false, 670 success:function(response){ 671 if(response>0){ 672 $('#offercontactform').addClass('success'); 673 }else{ 674 if(response==-0){ 675 alert('Il y a un problème avec vos champs. Merci de bien vouloir vérifier la validité des donnés insérés.'); 676 }else if(response==-1){ 677 alert('Merci de bien vouloir valider le reCaptcha.'); 678 }else if(response==-2){ 679 alert('Votre message n\'a pas pu être envoyé. Merci de bien vouloir essayer plus tard; si cet erreur subsiste, merci de nous contacter.'); 680 } 681 } 682 } 683 }); 684 685 } 686}); 687 688//ISOTOPE 689$rcontainer=$('.regiongrid'); 690$rcontainer.isotope({ 691 itemSelector: '.city', 692 /*layoutMode:'fitColumns',*/ 693 masonry:{ 694 gutter:30, 695 columnWidth:211 696 }, 697 filter: '.centre' 698}); 699 700regfilt=$('.regionfilter a'); 701regfilt.click(function(e){ 702 e.preventDefault(); 703 regfilt.removeClass('active'); 704 $(this).addClass('active'); 705 var filterValue = $(this).attr('data-filter'); 706 $rcontainer.isotope({ filter: filterValue }); 707}); 708 709var $icontainer; 710if($('.grid').length){ 711 var $icontainer = $('.grid'); 712 // initialize Masonry after all images have loaded 713 $icontainer.isotope({ 714 itemSelector: '.item', 715 masonry:{ 716 gutter:20, 717 columnWidth:208 718 } 719 }); 720 $icontainer.imagesLoaded( function() { 721 $icontainer.isotope('layout'); 722 }); 723} 724 725function applyShares(){ 726 //FB+PINTEREST SHARE 727 $('.facebookshare').unbind('click').click(function(e){ 728 e.preventDefault();
729 var linkshare=$(this).attr('href'); 730 return FB.ui({method: 'share', href:linkshare}, function(response){}); 731 }); 732 733 $('.pinterestshare').unbind('click').click(function(e){ 734 e.preventDefault(); 735 var linkshare=$(this).attr('href'); 736 var linkid=$(this).data('id'); 737 var linktitle=$(this).data('title'); 738 $.ajax({ 739 url:statsurl, 740 data:{ 741 elid:linkid, 742 action:'getthumb' 743 }, 744 cache:false, 745 type:'post', 746 success:function(response){ 747 window.open('http://pinterest.com/pin/create/button/?url='+linkshare+'&media='+response+'&description='+linktitle, 'twitterwindow', 'height=450, width=550, top='+($(window).height()/2 - 225) +', left='+$(window).width()/2 +', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0'); 748 } 749 }); 750 751 }); 752 753 $('.gshare').unbind('click').click(function(e){ 754 e.preventDefault(); 755 var linkshare=$(this).attr('href'); 756 window.open('https://plus.google.com/share?url='+linkshare, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600'); 757 }); 758 759 $('.twittershare').unbind('click').click(function(e){ 760 e.preventDefault(); 761 var linkshare=$(this).attr('href'); 762 window.open('http://twitter.com/share?url='+linkshare, 'twitterwindow', 'height=450, width=550, top='+($(window).height()/2 - 225) +', left='+$(window).width()/2 +', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0'); 763 }); 764} 765 766applyShares(); 767 768//FORMS 769$('#bigdatesdays input').datepicker({ 770 dateFormat: 'yy-mm-dd', 771 minDate:0 772}); 773 774$('#bigdates input[type=radio]').on('change', function(){ 775 var today = new Date(); 776 777 var dd = today.getDate(); 778 var mm = today.getMonth()+1; 779 var yyyy = today.getFullYear(); 780 781 var tomorrow = new Date(new Date().getTime() + 24 * 60 * 60 * 1000); 782 var dd2 = tomorrow.getDate(); 783 var mm2 = tomorrow.getMonth()+1; 784 var yyyy2 = tomorrow.getFullYear(); 785 if(dd<10 && dd>0){ dd='0'+dd; } 786 if(dd2<10 && dd2>0){ dd2='0'+dd2; } 787 if(mm<10 && mm>0){ mm='0'+mm; } 788 if(mm2<10 && mm2>0){ mm2='0'+mm2; } 789 790 if($(this).val()=='today'){ 791 $('#bigdatesdays').removeClass('active'); 792 $('#startdate').val(yyyy+'-'+mm+'-'+dd); 793 $('#enddate').val(yyyy+'-'+mm+'-'+dd); 794 }else if($(this).val()=='tomorrow'){ 795 $('#bigdatesdays').removeClass('active'); 796 $('#startdate').val(yyyy2+'-'+mm2+'-'+dd2); 797 $('#enddate').val(yyyy2+'-'+mm2+'-'+dd2); 798 }else if($(this).val()=='specificdate'){ 799 $('#startdate').val(yyyy+'-'+mm+'-'+dd); 800 $('#enddate').val(yyyy2+'-'+mm2+'-'+dd2); 801 $('#bigdatesdays').addClass('active'); 802 803 } 804}); 805 806//ADSERVER 807mymedias=[]; 808if($('.mediacontainer').length){ 809 $('.mediacontainer').each(function(){ 810 mymedias.push($(this).data('id')); 811 }); 812 mymedias=$.unique(mymedias); 813 814 if(typeof donottrack === 'undefined'){ 815 $.ajax({ 816 url:statsurl, 817 data:{ 818 myels:mymedias.join(','), 819 action:'printStats' 820 }, 821 cache:false, 822 type:'post', 823 success:function(response){ 824 } 825 }); 826 } 827} 828 829$('.staticmedia').click(function(e){ 830 e.preventDefault(); 831 window.open($(this).data('clicktag')); 832}); 833 834$('.interstitial').click(function(){ 835 $('.contentwrapper').addClass('active'); 836 setTimeout(function(){ 837 $('.interstitial').remove(); 838 }, 600); 839}); 840 841//follow scroll 842if($('#followside').length){ 843 var sheight = 0; 844 var cheight = 0; 845 var diff = 0; 846 847 var fsx=$('#followside'); 848 var fcx=$('#followcontainer'); 849 850 $(window).scroll(function(){ 851 if($(window).width()>1024){ 852 sheight = fsx.height(); 853 cheight = fcx.eq(0).height(); 854 aheight = fcx.eq(0).height(); 855 856 diff = cheight-sheight; 857 if(aheight>sheight){ 858 859 var wscroll = $(this).scrollTop(); 860 var stop = fcx.offset().top; 861 if(wscroll > stop -10){ 862 if(wscroll-stop<diff){ 863 fsx.css('margin-top', wscroll-stop+10+'px'); 864 }else{ 865 fsx.css('margin-top', diff+10+'px'); 866 } 867 }else{ 868 fsx.css('margin-top', '0px'); 869 } 870 871 } 872 }else{ 873 fsx.css('margin-top', '0px'); 874 } 875 876 }); 877} 878 879var selLocation=$('#sm_location').select2({ width: '100%' }); 880 881});
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.