1var frontpageZoom = false; 2 3$(document).ready(function(){ 4 5 6 /* - - - - - - - - - - - - - - - - - - - - - - - - - 7 @ lazy kur */ 8 9 10 lazy(); 11 12 13 /* - - - - - - - - - - - - - - - - - - - - - - - - - 14 @ site : site tab'a gore manset ve yazarları kur */ 15 16 site(); 17 18 19 /* - - - - - - - - - - - - - - - - - - - - - - - - - 20 @ drop down kasa : box larda yer alan acılır kapanır kasaları kur */ 21 22 // dropkasa(); 23 24 25 /* - - - - - - - - - - - - - - - - - - - - - - - - - 26 @ list kasa : saklı kasa modelini kur */ 27 28 // yerelmenu(); 29 30 31 /* - - - - - - - - - - - - - - - - - - - - - - - - - 32 @ favori */ 33 34 favorites(); 35 36 $('.ivent-fallow').click(function(){ 37 38 console.log('canerde..'); 39 }); 40 41 $('.dev').click(function(e){ 42 43 e.preventDefault(); 44 alert('GeliÅtiriliyor'); 45 }); 46 47 $('.popup').click(function(e){ 48 49 popup($(this).attr('href'),'oturum', 440, 520); 50 e.preventDefault(); 51 }); 52 53 $('body.dergi .type-board').click(function(e){ 54 55 $('.field-type .select .h').click(); 56 }); 57 58 /* - - - - - - - - - - - - - - - - - - - - - - - - - 59 @ ellesmediklerim.. */ 60 61 62 site_contact_form(); 63 site_activation_form(); 64 site_resend_activation_mail(); 65 66 67 if($('header .caption h1').width() > 380) 68 { 69 $('header .as .social').addClass('hidden'); 70 } 71 72 $('input[name=alfabetik]').click(function(){ 73 74 var url = 'https://' + window.location.hostname + window.location.pathname; 75 76 if ( $(this).attr('checked') ) 77 { 78 window.location = url + '?a=1'; 79 } 80 else 81 { 82 window.location = url + '?a=0'; 83 } 84 85 }); 86 87 site_frame_resize(); 88 89 var fp_groups = $('.first-page-groups').cycle({ 90 'fx' : 'scrollHorz', 91 'timeout' : 0, 92 'speed' : 200, 93 'pause' : 1, 94 'next' : '.sekizli a.next', 95 'prev' : '.sekizli a.prev' 96 }); 97 98 var g_page = $('.first-page div.active').data('group-page'); 99 100 $(fp_groups).cycle(g_page); 101 102 103 $('.media_tabs a').live('click', function(e){ 104 e.preventDefault(); 105 $.get( $(this).attr('href'),function(html){ 106 $('#media-box').replaceWith(html); 107 // cufon_set(); 108 }); 109 }) 110 111 $('.cat_tabs a').live('click', function(e){ 112 e.preventDefault(); 113 $.get( $(this).attr('href'),function(html){ 114 $('#cat-box').replaceWith(html); 115 116 }); 117 }) 118 119 120 121 /* Box filtreleri ------------------------------------------------------- */ 122 123 $('.box-filter .format').click(function(e){ 124 125 var il = $(this).parents('.new-box').data('il'); 126 var type = $(this).parents('.new-box').data('type'); 127 var format = $(this).data('format'); 128 var content = $(this).parents('.new-box').find('.padding'); 129 130 var rating = $('.box-filter select[name=rating]').val(); 131 var ilce = $('.box-filter select[name=ilce]').val(); 132 133 $('.list-type').data('list-type', format); 134 135 // console.log( format ); 136 137 switch(format) 138 { 139 case 'logo': 140 $('.list-type-label').text('Logolu biçimde göster'); 141 break; 142 143 case 'table': 144 $('.list-type-label').text('Tablo Åeklinde göster'); 145 break; 146 147 case 'text': 148 $('.list-type-label').text('Alfabetik sırada göster'); 149 break; 150 } 151 152 box_filter_result(content, format, type, il, ilce, rating); 153 }) 154 155 $('.box-filter select[name=rating]').change(function(){ 156 157 var rating = $(this).val(); 158 var il = $(this).parents('.new-box').data('il'); 159 var type = $(this).parents('.new-box').data('type'); 160 // var format = $(this).parents('.box-filter').find('.format').data('format'); 161 var format = $('.list-type').data('list-type'); 162 var content = $(this).parents('.new-box').find('.padding'); 163 var ilce = $('.box-filter select[name=ilce]').val(); 164 165 // console.log( format ); 166 167 box_filter_result(content, format, type, il, ilce, rating); 168 }) 169 170 $('.box-filter select[name=ilce]').change(function(){ 171 172 var ilce = $(this).val(); 173 var il = $(this).parents('.new-box').data('il'); 174 var type = $(this).parents('.new-box').data('type'); 175 // var format = $(this).parents('.box-filter').find('.format').data('format'); 176 var format = $('.list-type').data('list-type'); 177 var content = $(this).parents('.new-box').find('.padding'); 178 var rating = $('.box-filter select[name=rating]').val(); 179 180 // console.log( format ); 181 182 box_filter_result(content, format, type, il, ilce, rating); 183 }) 184 185 186 187 var tab_mode = 'a'; 188 189 190 191 $('.tab-prev').addClass('hidden'); 192 193 194 195 $(".newfrontpage .ncase-fronpage .bar").stick_in_parent({ 196 197 offset_top : 104 198 199 }); 200 201 202 $(".ncase .sol.tut").stick_in_parent({ 203 204 offset_top : 100 205 206 }); 207 208 $('.frontpage-detail img').draggable(); 209 210 211 $('.frontpage-detail-img').on('click', function(e){ 212 magnify(e); 213 $('.glass').on('click', function(){ 214 $(this).remove(); 215 // console.log('glass silindi'); 216 }); 217 }) 218 219 220 onesignalRegister(); 221 222 /* 223 $('.most img.bttrlazyloading').bttrlazyloading({ 224 placeholder:'', 225 animation: 'fadeIn' 226 });*/ 227 228 // magnify(); 229 ajax_forms(); 230 231}) 232 233 234 235/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 236@ site : site tab manset ve yazarlar */ 237 238function site() 239{ 240 241 242 /* 243 @ site tab sistem */ 244 245 var site_tab = $('.site-tab .list').cycle({ 246 247 'fx' : 'scrollHorz', 248 'timeout' : 0, 249 'speed' : 200, 250 'pause' : 1, 251 'next' : '.site-tab .next', 252 'prev' : '.site-tab .prev', 253 'after' : function(currSlideElement, nextSlideElement, options, forwardFlag){ 254 255 256 var nth = parseInt(options.currSlide); 257 var total = parseInt(options.slideCount); 258 259 if( nth==0 ) $('.manset-wrap .sponsor').removeClass('hidden'); else $('.manset-wrap .sponsor').addClass('hidden'); 260 261 tabsetno=nth+1; 262 263 tabset= $('#tabset-'+tabsetno); 264 265 266 if( !$(tabset).hasClass('no-lazy') && !$(tabset).hasClass('lazy-on') ) 267 { 268 269 $('#tabset-'+tabsetno+' img').bttrlazyloading({ 270 placeholder :'', 271 animation : 'fadeIn', 272 }); 273 274 $(tabset).addClass('lazy-on'); 275 } 276 } 277 }); 278 279 280 var active_tab_page = $('.site-tab .list a.active').data('page'); 281 282 $(site_tab).cycle(active_tab_page - 1); 283 284 285 286 /* 287 @ site tab sistem */ 288 289 290 var gazete = $('.manset .m-item article.format-gazete').length; 291 var reklam = $('.manset .m-item article.format-reklam').length; 292 293 294 var manset = $('.manset .m-item').cycle({ 295 296 'fx' : 'none', 297 'timeout' : 0, 298 'speed' : 1, 299 'pause' : 1, 300 'pager' : '.manset .m-page', 301 'pagerEvent': 'hover', 302 'activePagerClass':'on', 303 'pauseOnPagerHover':true, 304 pagerAnchorBuilder: function(i, el){ 305 306 //console.log(i); 307 if ( i == 6 && gazete == 1 ) 308 { 309 return '<a href="'+$(el).children("a").attr("href")+'" class="frontpage-pager-item">G</a>'; 310 //$('.manset .m-info').addClass('no-bar'); 311 } 312
313 else if ((i == 7 || i==14) && reklam > 0 ) { 314 return '<a href="'+$(el).children("a").attr("href")+'" class="frontpage-pager-item">R</a>'; 315 } 316 else 317 { 318 //data = i > 2 ? 'data-load="load"' : '' ; 319 320 return '<a href="'+$(el).children("a").attr("href")+'">' + (i+1) + '</a>'; 321 /* 322 if($('.manset .m-info').hasClass('no-bar')) 323 { 324 $('.manset .m-info').removeClass('no-bar'); 325 } 326 */ 327 } 328 329 }, 330 331 before: function (curr, next, opts) 332 { 333 334 if( opts.nextSlide == 6 || ((opts.nextSlide == 7 || opts.nextSlide == 14) && reklam > 0) ) 335 { 336 $('.manset .m-info').addClass('no-bar'); 337 } 338 else 339 { 340 if($('.manset .m-info').hasClass('no-bar')) 341 { 342 $('.manset .m-info').removeClass('no-bar'); 343 } 344 } 345 346 } 347 348 }); 349 350 351 var coverload=true; 352 353 $('.manset nav.m-page a').hover( 354 355 function(){ 356 357 if(coverload) 358 { 359 $('.manset .m-item img.load').each(function(index){ 360 361 $(this).attr('src',$(this).attr('data-src')); 362 363 }); 364 365 coverload=false; 366 } 367 }, 368 369 function(){ 370 371 372 } 373 ); 374 375 376 377 378 // sitebox > manset > click 379 380 $('.manset nav.m-page a').click(function(e){ window.open($(this).attr('href'),'_blank'); }); 381 382 // sitebox > manset > share 383 384 $('.manset .share a').click(function(e){ 385 386 eleman = $(this).parent().parent().parent().prev(); 387 388 url = $(eleman).attr('href'); 389 post = $(eleman).attr('data-post'); 390 site = $('.site-box .manset').attr('data-site'); 391 392 if($(this).hasClass('face')) 393 { 394 shareStat(site,post,'facebook'); 395 popup('https://www.facebook.com/sharer/sharer.php?u='+url+'&href='+url, 'share', 800, 600); 396 } 397 398 399 if($(this).hasClass('twit')) 400 { 401 shareStat(site,post,'twitter'); 402 popup('https://twitter.com/home?status='+url, 'share', 800, 600); 403 } 404 405 e.preventDefault(); 406 }); 407 408 409 // Genel paylaÅım 410 $('.social-share a.twitter, .social-share a.facebook').on('click',function(e){ 411 412 platform = $(this).data('platform'); 413 url = $(this).data('url'); 414 post = 0; 415 site = $(this).data('site-id'); 416 417 switch(platform){ 418 case 'twitter': 419 popup('https://twitter.com/home?status='+url, 'share', 800, 600); 420 break; 421 case 'facebook': 422 popup('https://www.facebook.com/sharer/sharer.php?u='+url+'&href='+url, 'share', 800, 600); 423 break; 424 } 425 426 e.preventDefault(); 427 428 }) 429 430 431 432 // sitebox > yazarlar 433 434 $('.authors nav a').click(function(){ 435 436 if( !$('.authors').hasClass('on') ) 437 { 438 $('.authors').addClass('on'); 439 $(this).text('YAZARLARI GİZLE'); 440 } 441 else 442 { 443 $('.authors').removeClass('on'); 444 $(this).text('TÃM YAZARLARI GÃSTER'); 445 } 446 447 448 }) 449 450} 451 452 453/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 454@ lazy */ 455 456function lazy(){ 457 458 $('.box-tab.lazy').each(function(index){ 459 460 var tag = $(this).attr('id'), 461 tab = $('#'+tag+' .tab-con .tab.on'), 462 img = $('#'+tag+' .tab-con .tab.on img'), 463 inr = $('#'+tag+' .tab-con .tab.on .tab-inner'); 464 465 $(img).bttrlazyloading({ 466 container : $(inr), 467 placeholder :'', 468 animation : 'fadeIn', 469 }); 470 471 }); 472 473 474 475 $('.box-tab .tab-nav a').click(function(e){ 476 477 e.preventDefault(); 478 479 // tab acık degil ise islemi baslat 480 481 if( !$(this).hasClass('on') ) 482 { 483 484 var tabset = $(this).data('tabset'), // tabset : tam grup id no'su 485 box_id = '#boxtab-'+tabset, // tab grup kasasının id etiketi 486 tab_no = $(this).data('tab'), // acilaack tabın no'su 487 tab_id = '#tab-'+tabset+'-'+tab_no, // tab grup ta acilan tab'ın id etiketi 488 tab = $(tab_id); // acilan tabın kendisi 489 490 $(box_id+' .tab-nav a').removeClass('on'); 491 $(this).addClass('on'); 492 493 $(box_id+' .tab-con .tab').removeClass('on'); 494 $(tab).addClass('on'); 495 496 // set 497 498 var set = { 'boxid': box_id,'tabid': tab_id, 'tab': tab } 499 500 // json data href varsa ve ilk kez (json-on) yuklenmek uzere cagriliyor ise 501 502 if( $(this).data('href') && !$(set.tab).hasClass('json-on')) 503 { 504 $.get( $(this).data('href') , function(dom){ 505 506 $(tab_id+' .tab-inner').html(dom); 507 508 lazy_on_tab(set); 509 510 $(set.tab).addClass('json-on'); 511 512 }) 513 } 514 else 515 {
516 lazy_on_tab(set); 517 } 518 } 519 520 }); 521 522 523 524 $('.list-lazy img, .site-logo img,img.lazy').bttrlazyloading({ 525 526 placeholder:'', 527 animation: 'fadeIn' 528 }); 529 530 $('.list-con-lazy').each(function(index){ 531 532 var kasa = $(this); 533 534 $($(kasa).find('img')).bttrlazyloading({ 535 container : kasa, 536 placeholder : '', 537 animation : 'fadeIn' 538 }); 539 540 }); 541 542} 543 544/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545@ lazy on tab : aktif tab sonrası lazy tetikler */ 546 547function lazy_on_tab(set){ 548 549 // tab lazy destegi varsa ve tab icin lazy hic setlenmemsi ise tetikle 550 551 if( $(set.boxid).hasClass('lazy') && !$(set.tab).hasClass('lazy-on')) 552 { 553 554 // setlencek olan tab gurubunun tab'ı 555 556 $(set.tabid+' img').bttrlazyloading({ 557 558 container: $(set.tabid+' .tab-inner'), 559 animation: 'fadeIn', 560 placeholder:'' 561 562 }); 563 564 // lazy-on : tan icin azy setlendi isareti dir 565 566 $(set.tab).addClass('lazy-on'); 567 } 568 569 570} 571 572/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 573@ dropkasa : sakla kasa modeli */ 574 575function dropkasa(){ 576 577 $('.site-authors').click(function(e){ 578 579 $('.site-box .list-ctrl:not(.no-js) a').click(); 580 581 }); 582 583 584 585 $('.list-ctrl:not(.no-js) a').click(function(e){ 586 587 var buton = $(this), 588 tag = 'list-'+$(buton).data('listkasa') 589 kasa = $('#'+tag), 590 of_size = $(buton).data('listsize'), 591 on_size = $('#'+tag+' .list').height(), 592 etiket = $(buton).children('span'); 593 icon = $(buton).children('i'); 594 595 if( !$(buton).hasClass('on') ) 596 { 597 598 $(kasa).height(on_size); 599 $(buton).addClass('on'); 600 $(etiket).text($(buton).data('oftext')); 601 $(icon).removeClass('ss-down').addClass('ss-up'); 602 603 604 605 } 606 else 607 { 608 609 capa(tag+'-block',300); 610 611 window.setTimeout(function(){ 612 613 $(kasa).height(of_size); 614 $(buton).removeClass('on'); 615 $(etiket).text($(buton).data('ontext')); 616 $(icon).removeClass('ss-up').addClass('ss-down'); 617 618 },280); 619 620 //window.location.href = '#'+kasa; 621 622 } 623 624 e.preventDefault() 625 }) 626} 627 628 629/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 630@ yerelmenu : yerel menuyu kur */ 631 632function yerelmenu() 633{ 634 635 636 $('.site-tab .maps a.local').click(function(e){ 637 638 var buton = $('#headmenu a.case'); 639 yerelmenu_on(buton); 640 yerelmenu_on_after(buton,true); 641 e.preventDefault(); 642 }); 643 644 645 646 647 $('#headmenu a.case').click(function(){ 648 649 var yerelmenu = $('#casemenu'); 650 var buton = $(this); 651 652 if( $(buton).hasClass('on') ) 653 { 654 yerelmenu_off(buton); 655 } 656 else 657 { 658 659 yerelmenu_on(buton); 660 661 yerelmenu_on_after(buton); 662 } 663 664 return false; 665 666 }) 667 668 669 670 $('#casemenu .tul').click(function(){ 671 672 yerelmenu_off(); 673 }) 674} 675 676/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 677@ yerelmenu_on : yerel menuyu ac */ 678 679 680 681function yerelmenu_on(buton) 682{ 683 $(buton).addClass('on'); 684 $('#casemenu').addClass('on'); 685 $('html').addClass('scroll-off'); 686} 687 688/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 689@ yerelmenu_on_after : yerel menuyu acilim sonrası */ 690 691function yerelmenu_on_after(buton,dislink) 692{ 693 694 $('#casemenu .tul').click(function(){ 695 696 yerelmenu_off(buton); 697 }) 698 699 700 if (!dislink) 701 { 702 $('#casemenu > div').clickoutside(function(){ 703 704 yerelmenu_off(buton); 705 706 }); 707 } 708 709 710 $(document).keydown(function(e){ 711 712 if(e.keyCode==27) { 713 714 yerelmenu_off(buton); 715 } 716 717 }); 718 719 $('#headmenu a:not(.on)').hover( 720 721 function(){ 722 723 yerelmenu_off(buton); 724 }, 725 726 function(){ 727 728 729 } 730 ); 731 732 733 734} 735 736/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 737@ yerelmenu_off : yerel menuyu kapa */ 738 739function yerelmenu_off(buton) 740{ 741 $(buton).removeClass('on'); 742 $('#casemenu').removeClass('on'); 743 $('html').removeClass('scroll-off '); 744} 745 746 747 748 749 750 751 752 753/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
754@ box_filter_result */ 755 756 757 758function box_filter_result(content, format, type, il, ilce, rating) 759{ 760 $.post('/ajax/siteler', {f:format, t:type, i:il, ilce:ilce, rating:rating}, function(html){ 761 $(content).html(html); 762 763 $('img.bttrlazyloading').bttrlazyloading({ 764 placeholder:'', 765 animation: 'fadeIn' 766 }); 767 768 }); 769} 770 771 772 773 774/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 775@ resize */ 776 777$(window).resize(function() { 778 site_frame_resize(); 779}) 780 781 782/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 783@ site_frame_resize */ 784 785 786function site_frame_resize() { 787 var header_height = $('header').height(); 788 $('.site_frame').height($(window).height() - header_height ); 789} 790 791 792 793 794 795/*------------------------------------------------------------------------------ 796 * Istenen boyutta bir popup açar ve sayfanin ortasinda gösterir 797 *----------------------------------------------------------------------------*/ 798function popup(url, name, width, height, scroll, resize) { 799 800 /* 801 * Pencerenin ekranin tam 802 * ortasinda çikmasini saglayalim 803 */ 804 var sw = screen.width; 805 var sh = screen.height; 806 var w = width; 807 var h = height; 808 var x = (sw - w)/2; 809 var y = (sh - h)/2; 810 811 /* 812 * Pencereyi aç 813 */ 814 window.open(url, name,"left="+x+",top="+y+",width="+w+",height="+h+",scrollbars="+scroll+",resizable="+resize); 815 816 return false; 817} 818 819// ----------------------------------------------------------------------------- 820 821/* 822 * Stores a value in localStorage 823 */ 824function set_local( name , value ) 825{ 826 if( 'localStorage' in window && window['localStorage'] !== null ) 827 { 828 localStorage[name] = value; 829 return true; 830 }else{ 831 832 setCookie( name, value, 32); 833 } 834 835 return false; 836} 837 838// ----------------------------------------------------------------------------- 839 840/* 841 * Fetchs a value from localStorage 842 */ 843function get_local( name ) 844{ 845 if( 'localStorage' in window && window['localStorage'] !== null ) 846 { 847 if(localStorage[name]) return localStorage[name]; 848 }else{ 849 return getCookie( name ); 850 } 851 852 return false; 853} 854 855// ----------------------------------------------------------------------------- 856 857/* 858 * Deletes a value from localStorage 859 */ 860function del_local( name ) 861{ 862 if( 'localStorage' in window && window['localStorage'] !== null ) 863 { 864 if(localStorage[name]) return localStorage.removeItem(name); 865 } 866 867 return false; 868} 869 870// ----------------------------------------------------------------------------- 871 872/** 873 * Generate a cookie 874 */ 875function setCookie(c_name,value,expiredays) 876{ 877 var exdate = new Date(); 878 exdate.setDate(exdate.getDate()+expiredays); 879 document.cookie=c_name+ "=" +escape(value)+ 880 ((expiredays==null) ? "" : ";expires="+exdate.toUTCString()); 881} 882 883// ----------------------------------------------------------------------------- 884 885/** 886 * Read cookie value 887 */ 888function getCookie(c_name) 889{ 890 c_name = c_name.replace('#',''); 891 892 if (document.cookie.length>0) 893 { 894 c_start=document.cookie.indexOf(c_name + "="); 895 if (c_start!=-1) 896 { 897 c_start=c_start + c_name.length+1; 898 c_end=document.cookie.indexOf(";",c_start); 899 if (c_end==-1) c_end=document.cookie.length; 900 return unescape(document.cookie.substring(c_start,c_end)); 901 } 902 } 903 return ""; 904} 905 906// ----------------------------------------------------------------------------- 907 908function jump(element) 909{ 910 911 var url = $(element).val(); 912 913 if ( url != '' ) 914 { 915 //window.open([url], "_blank"); 916 window.location = url; 917 } 918 else 919 { 920 var mesaj = $(element).find('option:selected').data('mesaj'); 921 922 if ( false != mesaj ) 923 { 924 alert(mesaj); 925 } 926 } 927 928 return true; 929} 930 931// ----------------------------------------------------------------------------- 932 933/** 934 * Elemanları istenen anahtara göre sılarar 935 * @param ana element 936 * @param sıralanacak çocuk elementler 937 * @param sıralama verisini tutan data anahtarı 938 * @param sıralama yapacak fonksiyon 939 */ 940function element_sort(parent, children, key, func) 941{ 942 var list = []; 943 var map = {}; 944 945 $(children).each(function(){ 946 var index = $(this).data(key); 947 list.push( index ); 948 map[index] = $(this); 949 }); 950 951 list.sort(func); 952 953 $(parent).empty(); 954 955 $(list).each(function(index, val){ 956 $(parent).append( map[val] ); 957 }) 958} 959 960// ----------------------------------------------------------------------------- 961 962/* Küçükten büyüye doÄru sırala */ 963function sort_asc(a, b) 964{ 965 return a > b; 966} 967 968/* Büyükten küçüÄe doÄru sırala */ 969function sort_desc(a, b) 970{ 971 return a < b; 972} 973 974 975function img_error(element, subject) 976{ 977 var src = $(element).attr('src'); 978 var site_id = $('.site-tab .list a.active').data('key'); 979 var url = window.location.href; 980 981 $.post('/action/html', 982 { 983 action:'img_report', 984 subject:subject, 985 src:src, 986 site_id:site_id, 987 url:url 988 }, 989 function(html){ 990 991 } 992 ); 993 994} 995 996function stream_error(subject, src, site_id) 997{ 998 var url = window.location.href; 999 1000 $.post('/action/html', 1001 { 1002 action:'stream_report', 1003 subject:subject, 1004 src:src, 1005 site_id:site_id, 1006 url:url 1007 }, 1008 function(html){ 1009 1010 } 1011 ); 1012 1013} 1014 1015 1016function site_contact_form(){ 1017 1018 $('.site-contact-form').submit(function(e){ 1019 1020 e.preventDefault(); 1021 1022 var form_data = $(this).serializeArray(); 1023 1024 $.post('/ajax/site_contact', form_data, function(json){ 1025 1026 alert(json.message); 1027 1028 }) 1029 1030 }); 1031 1032} 1033 1034function site_activation_form(){ 1035 1036 $('.site-activation-form').submit(function(e){ 1037 1038 e.preventDefault(); 1039 1040 var form_data = $(this).serializeArray(); 1041 1042 $.post('/ajax/site_activate', form_data, function(json){ 1043 1044 if ( json.redirect !== undefined ) 1045 { 1046 window.location = json.redirect; 1047 } 1048 1049 if ( json.message !== undefined ) 1050 { 1051 alert(json.message); 1052 }; 1053 }); 1054 1055 }); 1056 1057}; 1058 1059function site_resend_activation_mail() { 1060 1061 $('.site-resend-mail-form').submit(function(e){ 1062 1063 e.preventDefault(); 1064 1065 var form_data = $(this).serializeArray(); 1066 1067 $.post('/ajax/site_resend_activation_mail', form_data, function(json){ 1068 1069 if ( json.redirect !== undefined ) 1070 { 1071 window.location = json.redirect; 1072 return true; 1073 } 1074 1075 if ( json.message !== false ) 1076 { 1077 alert(json.message); 1078 } 1079 1080 }) 1081 1082 }); 1083} 1084 1085function ajax_forms() { 1086 1087 $('.ajax_form').submit(function(e){ 1088 1089 e.preventDefault(); 1090 1091 var form_data = $(this).serializeArray(); 1092 var form_action = $(this).attr('action'); 1093 1094 $.post(form_action, form_data, function(json){ 1095 1096 if ( json.redirect !== undefined ) 1097 { 1098 window.location = json.redirect; 1099 return true; 1100 } 1101 1102 if ( json.message !== false ) 1103 { 1104 alert(json.message); 1105 } 1106 1107 }) 1108 1109 }); 1110} 1111 1112function shareStat(site_id, post_id, type){ 1113 $.post('/stat/add', {'site_id':site_id, 'post_id':post_id, 'type':type}, function(){ 1114 1115 }); 1116} 1117 1118 1119function favorites(){ 1120 1121 $('.fav').on('click', function(){ 1122 1123 var type = $(this).data('type'); 1124 var id = $(this).data('id'); 1125 1126 if ( user != null ){ 1127 userFavorite(type, id, this); 1128 } else { 1129 popup('/mobil/giris?noheader=1&from=desktop','oturum', 440, 520); 1130 // alert('GeliÅtiriliyor'); 1131 } 1132 1133 }); 1134} 1135 1136 1137function userFavorite(type, id, element){ 1138 1139 var op = $(element).hasClass('on') ? 'remove' : 'add'; 1140 1141 var msg = $(element).data('title'); 1142 1143 $.post('/mobil/'+op+'_favorite', {'type':type, 'id':id, 'op':op}, function(){ 1144 1145 if ( op == 'add') 1146 { 1147 $(element).addClass('on'); 1148 1149 msg = msg + " favorilerinize eklendi"; 1150 1151 if (type == 'site'){ 1152 $(element).find('span.sub-verb').text('takibi bırak'); 1153 } 1154 1155 } else { 1156 1157 $(element).removeClass('on'); 1158 1159 msg = msg + " favorilerinizden çıkartıldı"; 1160 1161 if (type == 'site'){ 1162 $(element).find('span.sub-verb').text('takip et'); 1163 } 1164 } 1165 1166 alert(msg); 1167 1168 }); 1169} 1170 1171 1172function show_modal(id){ 1173 $('html').addClass('modal-on'); 1174 ga('send', 'event', 'ad', 'sponsor_popup', 'Sponsor popup açıldı'); 1175} 1176 1177function close_modal(id){ 1178 $('html').removeClass('modal-on'); 1179} 1180 1181function frontpage_detail(){ 1182 $('.frontpage-detail-wrapper').css({ 1183 'display':'block' 1184 }); 1185} 1186 1187function frontpage_detail_close(){ 1188 $('.frontpage-detail-wrapper').css({ 1189 'display':'none' 1190 }); 1191} 1192 1193function onesignalRegister(){ 1194 1195 if ( getCookie("onesignal_autoregister_ask") != 15000) { 1196 1197 setCookie("onesignal_autoregister_ask", "15000", 7); 1198 OneSignal.push(function() { 1199 if (!OneSignal.isPushNotificationsSupported()) { 1200 return; 1201 // console.log('0'); 1202 } 1203 OneSignal.isPushNotificationsEnabled(function (isEnabled) { 1204 if (isEnabled) { 1205 // console.log('1'); 1206 } else { 1207 // console.log('2'); 1208 // OneSignal.push(["registerForPushNotifications"]); 1209 showNotificationPopup(); 1210 } 1211 }); 1212 }); 1213 } 1214 1215} 1216 1217function showNotificationPopup(){ 1218 $('.push-wrapper').css('display','block'); 1219} 1220 1221function hideNotificationPopup(){ 1222 $('.push-wrapper').css('display','none'); 1223} 1224 1225function pushRegister(){ 1226 OneSignal.push(["registerForPushNotifications"]); 1227 hideNotificationPopup(); 1228} 1229 1230 1231function magnify() 1232{ 1233 var native_width = 0; 1234 var native_height = 0; 1235 var mouse = {x: 0, y: 0}; 1236 var magnify; 1237 var cur_img; 1238 1239 var ui = { 1240 magniflier: $('.magniflier') 1241 }; 1242 1243 // Add the magnifying glass 1244 if (ui.magniflier.length) { 1245 var div = document.createElement('div'); 1246 div.setAttribute('class', 'glass'); 1247 ui.glass = $(div); 1248 $('body').append(div); 1249 } 1250 1251 // All the magnifying will happen on "mousemove" 1252 1253 var mouseMove = function(e) { 1254 1255 var $el = $(this); 1256 1257 // Container offset relative to document 1258 var magnify_offset = cur_img.offset(); 1259 1260 // Mouse position relative to container 1261 // pageX/pageY - container's offsetLeft/offetTop 1262 mouse.x = e.pageX - magnify_offset.left; 1263 mouse.y = e.pageY - magnify_offset.top; 1264 1265 // The Magnifying glass should only show up when the mouse is inside 1266 // It is important to note that attaching mouseout and then hiding 1267 // the glass wont work cuz mouse will never be out due to the glass 1268 // being inside the parent and having a higher z-index (positioned above) 1269 if ( 1270 mouse.x < cur_img.width() && 1271 mouse.y < cur_img.height() && 1272 mouse.x > 0 && 1273 mouse.y > 0 1274 ) { 1275 1276 magnify(e); 1277 } 1278 else { 1279 ui.glass.fadeOut(100); 1280 } 1281 1282 return; 1283 }; 1284 1285 var magnify = function(e) { 1286 1287 // The background position of div.glass will be 1288 // changed according to the position 1289 // of the mouse over the img.magniflier 1290 // 1291 // So we will get the ratio of the pixel 1292 // under the mouse with respect 1293 // to the image and use that to position the 1294 // large image inside the magnifying glass 1295 1296 var rx = Math.round(mouse.x/cur_img.width()*native_width - ui.glass.width()/2)*-1; 1297 var ry = Math.round(mouse.y/cur_img.height()*native_height - ui.glass.height()/2)*-1; 1298 var bg_pos = rx + "px " + ry + "px"; 1299 1300 // Calculate pos for magnifying glass 1301 // 1302 // Easy Logic: Deduct half of width/height 1303 // from mouse pos. 1304 1305 // var glass_left = mouse.x - ui.glass.width() / 2; 1306 // var glass_top = mouse.y - ui.glass.height() / 2; 1307 var glass_left = e.pageX - ui.glass.width() / 2; 1308 var glass_top = e.pageY - ui.glass.height() / 2; 1309 // console.log(glass_left, glass_top, bg_pos) 1310 // Now, if you hover on the image, you should 1311 // see the magnifying glass in action 1312 1313 //if(ui.glass.hasClass('on')){ 1314 ui.glass.css({ 1315 left: glass_left, 1316 top: glass_top, 1317 backgroundPosition: bg_pos 1318 }); 1319 //} 1320 1321 return; 1322 }; 1323 1324 $('.magniflier').on('click, mousemove', function() { 1325 1326 ui.glass.fadeIn(100); 1327 1328 cur_img = $(this); 1329 1330 var large_img_loaded = cur_img.data('large-img-loaded'); 1331 var src = cur_img.data('large') || cur_img.attr('src'); 1332 1333 // Set large-img-loaded to true 1334 // cur_img.data('large-img-loaded', true) 1335 1336 if (src) { 1337 ui.glass.css({ 1338 'background-image': 'url(' + src + ')', 1339 'background-repeat': 'no-repeat', 1340 }); 1341 } 1342 1343 // When the user hovers on the image, the script will first calculate 1344 // the native dimensions if they don't exist. Only after the native dimensions 1345 // are available, the script will show the zoomed version. 1346 //if(!native_width && !native_height) { 1347 1348 if (!cur_img.data('native_width')) { 1349 // This will create a new image object with the same image as that in .small
1350 // We cannot directly get the dimensions from .small because of the 1351 // width specified to 200px in the html. To get the actual dimensions we have 1352 // created this image object. 1353 var image_object = new Image(); 1354 1355 image_object.onload = function() { 1356 // This code is wrapped in the .load function which is important. 1357 // width and height of the object would return 0 if accessed before 1358 // the image gets loaded. 1359 native_width = image_object.width; 1360 native_height = image_object.height; 1361 1362 cur_img.data('native_width', native_width); 1363 cur_img.data('native_height', native_height); 1364 1365 // console.log(native_width, native_height); 1366 mouseMove.apply(this, arguments); 1367 1368 ui.glass.on('click, mousemove', mouseMove); 1369 }; 1370 1371 image_object.src = src; 1372 1373 return; 1374 1375 } else { 1376 native_width = cur_img.data('native_width'); 1377 native_height = cur_img.data('native_height'); 1378 } 1379 //} 1380 //console.log(native_width, native_height); 1381 1382 mouseMove.apply(this, arguments); 1383 1384 ui.glass.on('click, mousemove', mouseMove); 1385 }); 1386 1387 ui.glass.on('mouseout',function(){ 1388 ui.glass.off('click, mousemove', mouseMove); 1389 }); 1390} 1391 1392/* 1393function optionsNationalSites(){ 1394 $('.field-gazete label.stroke').text('Seçiniz'); 1395 $.post(window.location, {'mode':'ulusal'}, function(html){ 1396 $('#ajax-sites').html(html); 1397 }); 1398} 1399 1400function optionsLocalSites(state){ 1401 $('.field-gazete label.stroke').text('Seçiniz'); 1402 $.post(window.location, {'mode':'yerel','state':state}, function(html){ 1403 $('#ajax-sites').html(html); 1404 }); 1405} 1406*/ 1407 1408/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1409 @ Capa fonksyonlar */ 1410 1411function capa(e,speed,pay,unlink,mono,fun){speed=(!speed)?300:speed;pay=(!pay)?0:pay;fun=(!fun)?false:fun;if(!mono){point=$('#'+e).offset().top-pay}else{point=mono};if($('#'+e+'').length){scrollElem=scrollableElement('html','body');if(speed>1){$(scrollElem).animate({scrollTop:point},speed,function(){if(fun)eval(fun+"()")})}else{$(scrollElem).scrollTop(point)}}else{alert('Dom \'da boyle bir capa adresi bulunamadi')}};function filterPath(string){return string.replace(/^\//,'').replace(/(index|default).[a-zA-Z]{3,4}$/,'').replace(/\/$/,'')};function scrollableElement(els){for(var i=0,argLength=arguments.length;i<argLength;i++){var el=arguments[i],$scrollElement=$(el);if($scrollElement.scrollTop()>0){return el}else{$scrollElement.scrollTop(1);var isScrollable=$scrollElement.scrollTop()>0;$scrollElement.scrollTop(0);if(isScrollable){return el}}};return[]};
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.